summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2018-04-24 20:47:38 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-04-24 20:47:38 +0200
commit482d722f5beca025b72a9efa8e327ce39ce0a0c0 (patch)
tree9267b20d03ce80aa9bd0ac58eaf7666f47fee0a1 /applypatch/applypatch.cpp
parentMerge "update_verifier: Move to Soong." am: ed022fccdf am: 9bc286dd71 (diff)
parentMerge "Dump debug information for apply_patch unit tests" am: fe527cced4 (diff)
downloadandroid_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.tar
android_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.tar.gz
android_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.tar.bz2
android_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.tar.lz
android_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.tar.xz
android_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.tar.zst
android_bootable_recovery-482d722f5beca025b72a9efa8e327ce39ce0a0c0.zip
Diffstat (limited to 'applypatch/applypatch.cpp')
-rw-r--r--applypatch/applypatch.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 7104abd67..db7530be9 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -630,6 +630,11 @@ static int GenerateTarget(const FileContents& source_file, const std::unique_ptr
SHA_CTX ctx;
SHA1_Init(&ctx);
SinkFn sink = [&memory_sink_str, &ctx](const unsigned char* data, size_t len) {
+ if (len != 0) {
+ uint8_t digest[SHA_DIGEST_LENGTH];
+ SHA1(data, len, digest);
+ LOG(DEBUG) << "Appending " << len << " bytes data, sha1: " << short_sha1(digest);
+ }
SHA1_Update(&ctx, data, len);
memory_sink_str.append(reinterpret_cast<const char*>(data), len);
return len;