Vboot Reference: Refactor Code.
This CL does the following:
1) It adds a SignatureBuf function which uses the OpenSSL library to generate RSA signature. This is more robust than the previous way of invoking the command line "openssl" utility and capturing its output. No more unnecessary temporary files for signature operations.
2) It adds functions that allow direct manipulation of binary verified Firmware and Kernel Image blobs in memory.
3) It changes the structure field members for FirmwareImage to make it consistent with KernelImage. Now it's clearer which key is used when.
4) Minor bug fixes and slightly improved API for dealing verified boot firmware and kernel images.
5) Renames the RSA_verify function to prevent conflicts with OpenSSL since it's linked into the firmware utility binary.
Review URL: http://codereview.chromium.org/661353
diff --git a/tests/rsa_padding_test.c b/tests/rsa_padding_test.c
index 7706ba8..429210b 100644
--- a/tests/rsa_padding_test.c
+++ b/tests/rsa_padding_test.c
@@ -25,14 +25,14 @@
}
/* The first test signature is valid. */
- if (!RSA_verify(key, signatures[0], RSA1024NUMBYTES, 0,
+ if (!RSAVerify(key, signatures[0], RSA1024NUMBYTES, 0,
test_message_sha1_hash)) {
fprintf(stderr, "RSA Padding Test vector 0 FAILED!\n");
error = 255; /* Test failure. */
}
/* All other signatures should fail verification. */
for (i = 1; i < sizeof(signatures) / sizeof(signatures[0]); i++) {
- if (RSA_verify(key, signatures[i], RSA1024NUMBYTES, 0,
+ if (RSAVerify(key, signatures[i], RSA1024NUMBYTES, 0,
test_message_sha1_hash)) {
fprintf(stderr, "RSA Padding Test vector %d FAILED!\n", i);
error = 255; /* Test failure. */