diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c index 0566ec1f9..dec3286f6 100644 --- a/crypto/cryptlib.c +++ b/crypto/cryptlib.c @@ -543,6 +543,8 @@ void OpenSSLDie(const char *file,int line,const char *assertion) void *OPENSSL_stderr(void) { return stderr; } +#ifndef OPENSSL_FIPS + int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) { size_t i; @@ -555,3 +557,4 @@ int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) return x; } +#endif diff --git a/crypto/o_init.c b/crypto/o_init.c index d767a90a5..c89fda589 100644 --- a/crypto/o_init.c +++ b/crypto/o_init.c @@ -93,4 +93,18 @@ void OPENSSL_init(void) #endif } +#ifdef OPENSSL_FIPS +int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) + { + size_t i; + const unsigned char *a = in_a; + const unsigned char *b = in_b; + unsigned char x = 0; + + for (i = 0; i < len; i++) + x |= a[i] ^ b[i]; + + return x; + } +#endif