summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2019-10-09 16:18:00 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2019-10-09 16:18:00 +0000
commita1430cb52bc5ae408c6810e6be627b1733fc07a9 (patch)
tree317f480c51329f811e10e7bf4915ed3ad275c1ca /lib
parentb58e0ec571665a4094a7f29b500f818e8eee843b (diff)
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@
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/rsa/rsa_oaep.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/libcrypto/rsa/rsa_oaep.c b/lib/libcrypto/rsa/rsa_oaep.c
index c90299093a3..6b1760da60d 100644
--- a/lib/libcrypto/rsa/rsa_oaep.c
+++ b/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 <stdlib.h>
#include <string.h>
-#include <openssl/opensslconf.h>
-
-#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
-
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/evp.h>
@@ -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