Fix a typo in the RSA benchmark.
Also fix error handling in RSAPublicKeyFromBuf().
BUG=1210
TEST=none
Review URL: http://codereview.chromium.org/660310
diff --git a/tests/rsa_verify_benchmark.c b/tests/rsa_verify_benchmark.c
index 29acf75..e72c36f 100644
--- a/tests/rsa_verify_benchmark.c
+++ b/tests/rsa_verify_benchmark.c
@@ -26,7 +26,7 @@
RSAPublicKey* key = NULL;
ClockTimerState ct;
char* sha_strings[] = { /* Maps algorithm->SHA algorithm. */
- "sha1", "sha256", "psha512", /* RSA-1024 */
+ "sha1", "sha256", "sha512", /* RSA-1024 */
"sha1", "sha256", "sha512", /* RSA-2048 */
"sha1", "sha256", "sha512", /* RSA-4096 */
"sha1", "sha256", "sha512", /* RSA-8192 */
@@ -37,7 +37,7 @@
snprintf(file_name, FILE_NAME_SIZE, "testkeys/key_rsa%d.keyb", key_size);
key = RSAPublicKeyFromFile(file_name);
if (!key) {
- fprintf(stderr, "Couldn't read key from file.\n");
+ fprintf(stderr, "Couldn't read RSA Public key from file: %s\n", file_name);
error_code = 1;
goto failure;
}
@@ -74,7 +74,8 @@
fprintf(stderr, "# rsa%d/%s:\tTime taken per verification = %.02f ms,"
" Speed = %.02f verifications/s\n", key_size, sha_strings[algorithm],
msecs, speed);
- fprintf(stdout, "rsa%d/%s:%.02f\n", key_size, sha_strings[algorithm], msecs);
+ fprintf(stdout, "ms_rsa%d_%s:%.02f\n", key_size, sha_strings[algorithm],
+ msecs);
failure:
Free(signature);
diff --git a/utils/file_keys.c b/utils/file_keys.c
index 1aac93f..98e878a 100644
--- a/utils/file_keys.c
+++ b/utils/file_keys.c
@@ -51,7 +51,7 @@
RSAPublicKey* RSAPublicKeyFromFile(const char* input_file) {
uint32_t len;
- RSAPublicKey* key;
+ RSAPublicKey* key = NULL;
uint8_t* buf = BufferFromFile(input_file, &len);
if (buf)
key = RSAPublicKeyFromBuf(buf, len);