summaryrefslogtreecommitdiffstats
path: root/applypatch/bspatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-04-20 20:11:02 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-04-20 20:11:02 +0200
commit4cf3bc18756782bfe09f683b0a52431f4430ec33 (patch)
treece9cf683304b2d70ae800bb6811842b375904beb /applypatch/bspatch.cpp
parentMerge "applypatch: Dump patch info on mismatching patching result." (diff)
parentMerge "applypatch: Drop the SHA_CTX parameter in Apply{BSDiff,Image}Patch." (diff)
downloadandroid_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.tar
android_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.tar.gz
android_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.tar.bz2
android_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.tar.lz
android_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.tar.xz
android_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.tar.zst
android_bootable_recovery-4cf3bc18756782bfe09f683b0a52431f4430ec33.zip
Diffstat (limited to 'applypatch/bspatch.cpp')
-rw-r--r--applypatch/bspatch.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/applypatch/bspatch.cpp b/applypatch/bspatch.cpp
index 912dbbdd8..ba33c3a9c 100644
--- a/applypatch/bspatch.cpp
+++ b/applypatch/bspatch.cpp
@@ -66,18 +66,12 @@ void ShowBSDiffLicense() {
}
int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value& patch,
- size_t patch_offset, SinkFn sink, SHA_CTX* ctx) {
- auto sha_sink = [&sink, &ctx](const uint8_t* data, size_t len) {
- len = sink(data, len);
- if (ctx) SHA1_Update(ctx, data, len);
- return len;
- };
-
+ size_t patch_offset, SinkFn sink) {
CHECK_LE(patch_offset, patch.data.size());
int result = bsdiff::bspatch(old_data, old_size,
reinterpret_cast<const uint8_t*>(&patch.data[patch_offset]),
- patch.data.size() - patch_offset, sha_sink);
+ patch.data.size() - patch_offset, sink);
if (result != 0) {
LOG(ERROR) << "bspatch failed, result: " << result;
// print SHA1 of the patch in the case of a data error.