diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2021-05-06 14:03:20 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-05-08 20:44:41 +1000 |
commit | 839261592ca447aa083403cee7b0ced97cef6159 (patch) | |
tree | 1791b2bc0c0cbd55c91eb71328b3724e69fe2f50 /ssl/s3_cbc.c | |
parent | 0d40ca47bd86e74a95c3a2f5fb6c67cdbee93c79 (diff) |
Remove unused code from the fips module
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15167)
Diffstat (limited to 'ssl/s3_cbc.c')
-rw-r--r-- | ssl/s3_cbc.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ssl/s3_cbc.c b/ssl/s3_cbc.c index 26f12654e4..2b4b16cb58 100644 --- a/ssl/s3_cbc.c +++ b/ssl/s3_cbc.c @@ -75,15 +75,16 @@ int ssl3_cbc_digest_record(const EVP_MD *md, */ #define MAX_HASH_BLOCK_SIZE 128 +#ifndef FIPS_MODULE /* * u32toLE serializes an unsigned, 32-bit number (n) as four bytes at (p) in * little-endian order. The value of p is advanced by four. */ -#define u32toLE(n, p) \ - (*((p)++)=(unsigned char)(n), \ - *((p)++)=(unsigned char)(n>>8), \ - *((p)++)=(unsigned char)(n>>16), \ - *((p)++)=(unsigned char)(n>>24)) +# define u32toLE(n, p) \ + (*((p)++)=(unsigned char)(n), \ + *((p)++)=(unsigned char)(n>>8), \ + *((p)++)=(unsigned char)(n>>16), \ + *((p)++)=(unsigned char)(n>>24)) /* * These functions serialize the state of a hash and thus perform the @@ -98,6 +99,7 @@ static void tls1_md5_final_raw(void *ctx, unsigned char *md_out) u32toLE(md5->C, md_out); u32toLE(md5->D, md_out); } +#endif /* FIPS_MODULE */ static void tls1_sha1_final_raw(void *ctx, unsigned char *md_out) { @@ -196,6 +198,9 @@ int ssl3_cbc_digest_record(const EVP_MD *md, return 0; if (EVP_MD_is_a(md, "MD5")) { +#ifdef FIPS_MODULE + return 0; +#else if (MD5_Init((MD5_CTX *)md_state.c) <= 0) return 0; md_final_raw = tls1_md5_final_raw; @@ -204,6 +209,7 @@ int ssl3_cbc_digest_record(const EVP_MD *md, md_size = 16; sslv3_pad_length = 48; length_is_big_endian = 0; +#endif } else if (EVP_MD_is_a(md, "SHA1")) { if (SHA1_Init((SHA_CTX *)md_state.c) <= 0) return 0; |