From: tb Date: Fri, 1 Sep 2023 17:12:19 +0000 (+0000) Subject: Fix EVP_PKEY_get0_RSA() for RSA-PSS X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bce0228317db8f4ed8ad8ed8b9006279e099b3e8;p=openbsd Fix EVP_PKEY_get0_RSA() for RSA-PSS It currently returns NULL. This is OpenSSL 4088b926 + De Morgan. ok jsing --- diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index 85e7978ff4f..e8f031714e2 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -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 *