components/openssl/openssl-fips-140/patches/205-allow-md5.patch
changeset 7103 398c9d0ab0f3
equal deleted inserted replaced
7102:64f95a1ef701 7103:398c9d0ab0f3
       
     1 # Allow MD5 in FIPS mode
       
     2 # Developed in house: not applicable to upstream
       
     3 --- a/crypto/evp/digest.c	2016-09-15 15:26:57.097982570 -0700
       
     4 +++ b/crypto/evp/digest.c	2016-09-15 15:29:22.781095415 -0700
       
     5 @@ -240,8 +240,13 @@
       
     6          return 1;
       
     7  #ifdef OPENSSL_FIPS
       
     8      if (FIPS_mode()) {
       
     9 -        if (FIPS_digestinit(ctx, type))
       
    10 -            return 1;
       
    11 +	if (type == EVP_md5()) {
       
    12 +		if (ctx->digest->init(ctx))
       
    13 +		    return 1;
       
    14 +	} else {
       
    15 +		if (FIPS_digestinit(ctx, type))
       
    16 +		    return 1;
       
    17 +	}
       
    18          OPENSSL_free(ctx->md_data);
       
    19          ctx->md_data = NULL;
       
    20          return 0;