aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-03-14 11:39:48 -0500
committerMark Salyzyn2014-03-14 15:51:39 -0500
commitf3bb31c32fa879ccce358c15c93b7bd8582d1756 (patch)
tree0ce9c3520be76db70f29a63fca0b895a028934af /verifier.cpp
parenta7266ef0b1804e3ddeea58bda9a416e807a55f88 (diff)
downloadplatform-bootable-recovery-f3bb31c32fa879ccce358c15c93b7bd8582d1756.tar.gz
platform-bootable-recovery-f3bb31c32fa879ccce358c15c93b7bd8582d1756.tar.xz
platform-bootable-recovery-f3bb31c32fa879ccce358c15c93b7bd8582d1756.zip
Recovery 64-bit compile issues
Change-Id: I92d5abd1a628feab3b0246924fab7f97ba3b9d34
Diffstat (limited to 'verifier.cpp')
-rw-r--r--verifier.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/verifier.cpp b/verifier.cpp
index 0930fbd1..019552b9 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -152,7 +152,7 @@ int verify_file(const char* path, const Certificate* pKeys, unsigned int numKeys
152 152
153 size_t comment_size = footer[4] + (footer[5] << 8); 153 size_t comment_size = footer[4] + (footer[5] << 8);
154 size_t signature_start = footer[0] + (footer[1] << 8); 154 size_t signature_start = footer[0] + (footer[1] << 8);
155 LOGI("comment is %d bytes; signature %d bytes from end\n", 155 LOGI("comment is %zu bytes; signature %zu bytes from end\n",
156 comment_size, signature_start); 156 comment_size, signature_start);
157 157
158 if (signature_start <= FOOTER_SIZE) { 158 if (signature_start <= FOOTER_SIZE) {
@@ -292,24 +292,24 @@ int verify_file(const char* path, const Certificate* pKeys, unsigned int numKeys
292 if (pKeys[i].key_type == Certificate::RSA) { 292 if (pKeys[i].key_type == Certificate::RSA) {
293 if (sig_der_length < RSANUMBYTES) { 293 if (sig_der_length < RSANUMBYTES) {
294 // "signature" block isn't big enough to contain an RSA block. 294 // "signature" block isn't big enough to contain an RSA block.
295 LOGI("signature is too short for RSA key %d\n", i); 295 LOGI("signature is too short for RSA key %zu\n", i);
296 continue; 296 continue;
297 } 297 }
298 298
299 if (!RSA_verify(pKeys[i].rsa, sig_der, RSANUMBYTES, 299 if (!RSA_verify(pKeys[i].rsa, sig_der, RSANUMBYTES,
300 hash, pKeys[i].hash_len)) { 300 hash, pKeys[i].hash_len)) {
301 LOGI("failed to verify against RSA key %d\n", i); 301 LOGI("failed to verify against RSA key %zu\n", i);
302 continue; 302 continue;
303 } 303 }
304 304
305 LOGI("whole-file signature verified against RSA key %d\n", i); 305 LOGI("whole-file signature verified against RSA key %zu\n", i);
306 free(sig_der); 306 free(sig_der);
307 return VERIFY_SUCCESS; 307 return VERIFY_SUCCESS;
308 } else if (pKeys[i].key_type == Certificate::EC 308 } else if (pKeys[i].key_type == Certificate::EC
309 && pKeys[i].hash_len == SHA256_DIGEST_SIZE) { 309 && pKeys[i].hash_len == SHA256_DIGEST_SIZE) {
310 p256_int r, s; 310 p256_int r, s;
311 if (!dsa_sig_unpack(sig_der, sig_der_length, &r, &s)) { 311 if (!dsa_sig_unpack(sig_der, sig_der_length, &r, &s)) {
312 LOGI("Not a DSA signature block for EC key %d\n", i); 312 LOGI("Not a DSA signature block for EC key %zu\n", i);
313 continue; 313 continue;
314 } 314 }
315 315
@@ -317,11 +317,11 @@ int verify_file(const char* path, const Certificate* pKeys, unsigned int numKeys
317 p256_from_bin(hash, &p256_hash); 317 p256_from_bin(hash, &p256_hash);
318 if (!p256_ecdsa_verify(&(pKeys[i].ec->x), &(pKeys[i].ec->y), 318 if (!p256_ecdsa_verify(&(pKeys[i].ec->x), &(pKeys[i].ec->y),
319 &p256_hash, &r, &s)) { 319 &p256_hash, &r, &s)) {
320 LOGI("failed to verify against EC key %d\n", i); 320 LOGI("failed to verify against EC key %zu\n", i);
321 continue; 321 continue;
322 } 322 }
323 323
324 LOGI("whole-file signature verified against EC key %d\n", i); 324 LOGI("whole-file signature verified against EC key %zu\n", i);
325 free(sig_der); 325 free(sig_der);
326 return VERIFY_SUCCESS; 326 return VERIFY_SUCCESS;
327 } else { 327 } else {