diff options
author | Kees Cook <keescook@chromium.org> | 2012-05-22 18:05:53 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-05-22 19:52:55 -0700 |
commit | 201fe0bb55ddb5a7270c45aa58bcb91258c0a9ce (patch) | |
tree | 78155d6c7068e54695077715c9ed9472091ee821 /tests | |
parent | b75d8adcc01f08cf5a6d87b78aeb1d7cdfcd22af (diff) | |
download | vboot-201fe0bb55ddb5a7270c45aa58bcb91258c0a9ce.tar.gz |
cryptolib: rename SHA* function to avoid openssl collisionfirmware-link-2348.B
When linking tools that need OpenSSL functions on the target, the
resolution of SHA* functions was being redirected to the firmware
cryptolib instead of the OpenSSL implementations, which was causing
OpenSSL calls to crash. This renames the internal implementations
to avoid the collision.
BUG=None
TEST=make runtests passes, mount-encrypted runs on target again.
Change-Id: Ica4fb04faf203ae3b4118c540f18d40239753810
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23305
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sha_benchmark.c | 6 | ||||
-rw-r--r-- | tests/sha_tests.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/sha_benchmark.c b/tests/sha_benchmark.c index 9f4da367..a5bfc538 100644 --- a/tests/sha_benchmark.c +++ b/tests/sha_benchmark.c @@ -21,9 +21,9 @@ typedef struct HashFxTable { } HashFxTable; HashFxTable hash_functions[NUM_HASH_ALGORITHMS] = { - {SHA1, "sha1"}, - {SHA256, "sha256"}, - {SHA512, "sha512"} + {internal_SHA1, "sha1"}, + {internal_SHA256, "sha256"}, + {internal_SHA512, "sha512"} }; int main(int argc, char* argv[]) { diff --git a/tests/sha_tests.c b/tests/sha_tests.c index 65cbb462..6cc7e0f6 100644 --- a/tests/sha_tests.c +++ b/tests/sha_tests.c @@ -21,7 +21,7 @@ int SHA1_tests(void) { test_inputs[2] = (uint8_t *) long_msg; for (i = 0; i < 3; i++) { - SHA1(test_inputs[i], strlen((char *)test_inputs[i]), + internal_SHA1(test_inputs[i], strlen((char *)test_inputs[i]), sha1_digest); if (!memcmp(sha1_digest, sha1_results[i], SHA1_DIGEST_SIZE)) { fprintf(stderr, "Test vector %d PASSED for SHA-1\n", i+1); @@ -43,7 +43,7 @@ int SHA256_tests(void) { test_inputs[2] = (uint8_t *) long_msg; for (i = 0; i < 3; i++) { - SHA256(test_inputs[i], strlen((char *)test_inputs[i]), + internal_SHA256(test_inputs[i], strlen((char *)test_inputs[i]), sha256_digest); if (!memcmp(sha256_digest, sha256_results[i], SHA256_DIGEST_SIZE)) { fprintf(stderr, "Test vector %d PASSED for SHA-256\n", i+1); @@ -65,7 +65,7 @@ int SHA512_tests(void) { test_inputs[2] = (uint8_t *) long_msg; for (i = 0; i < 3; i++) { - SHA512(test_inputs[i], strlen((char *)test_inputs[i]), + internal_SHA512(test_inputs[i], strlen((char *)test_inputs[i]), sha512_digest); if (!memcmp(sha512_digest, sha512_results[i], SHA512_DIGEST_SIZE)) { fprintf(stderr, "Test vector %d PASSED for SHA-512\n", i+1); |