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

@@ -91,24 +91,24 @@ uint8_t* DigestBuf(const uint8_t* buf, uint64_t len, int sig_algorithm) {
0,
0,
0, /* RSA 4096 */
SHA256,
internal_SHA256,
0,
0, /* RSA 8192 */
0,
0,
#else
SHA1, /* RSA 1024 */
SHA256,
SHA512,
SHA1, /* RSA 2048 */
SHA256,
SHA512,
SHA1, /* RSA 4096 */
SHA256,
SHA512,
SHA1, /* RSA 8192 */
SHA256,
SHA512,
internal_SHA1, /* RSA 1024 */
internal_SHA256,
internal_SHA512,
internal_SHA1, /* RSA 2048 */
internal_SHA256,
internal_SHA512,
internal_SHA1, /* RSA 4096 */
internal_SHA256,
internal_SHA512,
internal_SHA1, /* RSA 8192 */
internal_SHA256,
internal_SHA512,
#endif
};
/* Call the appropriate hash function. */