sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-09-02 04:20:23 +00:00
parent 81d24aa0e0
commit 361861c7dd
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
8 changed files with 257 additions and 85 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: p_lib.c,v 1.34 2023/07/07 19:37:54 beck Exp $ */
/* $OpenBSD: p_lib.c,v 1.35 2023/09/01 17:12:19 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -439,11 +439,11 @@ EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len)
RSA *
EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
{
if (pkey->type != EVP_PKEY_RSA) {
EVPerror(EVP_R_EXPECTING_AN_RSA_KEY);
return NULL;
}
return pkey->pkey.rsa;
if (pkey->type == EVP_PKEY_RSA || pkey->type == EVP_PKEY_RSA_PSS)
return pkey->pkey.rsa;
EVPerror(EVP_R_EXPECTING_AN_RSA_KEY);
return NULL;
}
RSA *