cryptolib: rename SHA* function to avoid openssl collision

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>
This commit is contained in:
Kees Cook
2012-05-22 18:05:53 -07:00
committed by Gerrit
parent b75d8adcc0
commit 201fe0bb55
7 changed files with 25 additions and 25 deletions

View File

@@ -69,19 +69,19 @@ uint8_t* SHA512_final(SHA512_CTX* ctx);
* and stores it into [digest]. [digest] should be pre-allocated to
* SHA1_DIGEST_SIZE bytes.
*/
uint8_t* SHA1(const uint8_t* data, uint64_t len, uint8_t* digest);
uint8_t* internal_SHA1(const uint8_t* data, uint64_t len, uint8_t* digest);
/* Convenience function for SHA-256. Computes hash on [data] of length [len].
* and stores it into [digest]. [digest] should be pre-allocated to
* SHA256_DIGEST_SIZE bytes.
*/
uint8_t* SHA256(const uint8_t* data, uint64_t len, uint8_t* digest);
uint8_t* internal_SHA256(const uint8_t* data, uint64_t len, uint8_t* digest);
/* Convenience function for SHA-512. Computes hash on [data] of length [len].
* and stores it into [digest]. [digest] should be pre-allocated to
* SHA512_DIGEST_SIZE bytes.
*/
uint8_t* SHA512(const uint8_t* data, uint64_t len, uint8_t* digest);
uint8_t* internal_SHA512(const uint8_t* data, uint64_t len, uint8_t* digest);
/*---- Utility functions/wrappers for message digests. */