From 105bc8595c473163e0ca56e4c842e62e3d2e6dde Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 9 Oct 2019 16:17:59 +0000 Subject: Use EVP_MAX_MD_SIZE instead of SHA_DIGEST_LENGTH and remove OPENSSL_NO_SHA* conditionals, now that this code handles arbitrary message digests. ok inoguchi@ tb@ --- src/lib/libcrypto/rsa/rsa_oaep.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/lib/libcrypto/rsa/rsa_oaep.c') diff --git a/src/lib/libcrypto/rsa/rsa_oaep.c b/src/lib/libcrypto/rsa/rsa_oaep.c index c90299093a..6b1760da60 100644 --- a/src/lib/libcrypto/rsa/rsa_oaep.c +++ b/src/lib/libcrypto/rsa/rsa_oaep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_oaep.c,v 1.31 2019/10/04 16:51:31 jsing Exp $ */ +/* $OpenBSD: rsa_oaep.c,v 1.32 2019/10/09 16:17:59 jsing Exp $ */ /* * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * @@ -73,10 +73,6 @@ #include #include -#include - -#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) - #include #include #include @@ -177,7 +173,7 @@ RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen, const unsigned char *maskeddb; int lzero; unsigned char *db = NULL; - unsigned char seed[SHA_DIGEST_LENGTH], phash[SHA_DIGEST_LENGTH]; + unsigned char seed[EVP_MAX_MD_SIZE], phash[EVP_MAX_MD_SIZE]; unsigned char *padded_from; int bad = 0; int mdlen; @@ -312,4 +308,3 @@ PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed, EVP_MD_CTX_cleanup(&c); return rv; } -#endif -- cgit v1.2.3-55-g6feb