summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2019-10-09 16:17:59 +0000
committerjsing <>2019-10-09 16:17:59 +0000
commit105bc8595c473163e0ca56e4c842e62e3d2e6dde (patch)
treec501e646f3a4951d0b1515347ee8503ed8de3933 /src
parent1ca222b99cd8109472a06c22d6ed0c0b5e76aea0 (diff)
downloadopenbsd-105bc8595c473163e0ca56e4c842e62e3d2e6dde.tar.gz
openbsd-105bc8595c473163e0ca56e4c842e62e3d2e6dde.tar.bz2
openbsd-105bc8595c473163e0ca56e4c842e62e3d2e6dde.zip
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 'src')
-rw-r--r--src/lib/libcrypto/rsa/rsa_oaep.c9
1 files changed, 2 insertions, 7 deletions
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 @@
1/* $OpenBSD: rsa_oaep.c,v 1.31 2019/10/04 16:51:31 jsing Exp $ */ 1/* $OpenBSD: rsa_oaep.c,v 1.32 2019/10/09 16:17:59 jsing Exp $ */
2/* 2/*
3 * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. 3 * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
4 * 4 *
@@ -73,10 +73,6 @@
73#include <stdlib.h> 73#include <stdlib.h>
74#include <string.h> 74#include <string.h>
75 75
76#include <openssl/opensslconf.h>
77
78#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
79
80#include <openssl/bn.h> 76#include <openssl/bn.h>
81#include <openssl/err.h> 77#include <openssl/err.h>
82#include <openssl/evp.h> 78#include <openssl/evp.h>
@@ -177,7 +173,7 @@ RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
177 const unsigned char *maskeddb; 173 const unsigned char *maskeddb;
178 int lzero; 174 int lzero;
179 unsigned char *db = NULL; 175 unsigned char *db = NULL;
180 unsigned char seed[SHA_DIGEST_LENGTH], phash[SHA_DIGEST_LENGTH]; 176 unsigned char seed[EVP_MAX_MD_SIZE], phash[EVP_MAX_MD_SIZE];
181 unsigned char *padded_from; 177 unsigned char *padded_from;
182 int bad = 0; 178 int bad = 0;
183 int mdlen; 179 int mdlen;
@@ -312,4 +308,3 @@ PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
312 EVP_MD_CTX_cleanup(&c); 308 EVP_MD_CTX_cleanup(&c);
313 return rv; 309 return rv;
314} 310}
315#endif