Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Aug 15, 2024
1 parent 3d47485 commit 8ff46c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 8 additions & 3 deletions crypto/fipsmodule/evp/evp.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,15 @@ int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, const EVP_MD **out_md) {
void *EVP_PKEY_get0(const EVP_PKEY *pkey) {
SET_DIT_AUTO_DISABLE;
GUARD_PTR(pkey);
if (pkey->type == EVP_PKEY_NONE) {
return NULL;
switch (pkey->type) {
case EVP_PKEY_RSA:
case EVP_PKEY_RSA_PSS:
case EVP_PKEY_DSA:
case EVP_PKEY_EC:
return pkey->pkey.ptr;
default:
return NULL;
}
return pkey->pkey.ptr;
}

void OpenSSL_add_all_algorithms(void) {}
Expand Down
5 changes: 3 additions & 2 deletions include/openssl/evp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,9 @@ OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *engine,

// Deprecated functions

// EVP_PKEY_get0 returns the consumed key. The type of value returned differs
// depending on the type of the |EVP_PKEY|.
// EVP_PKEY_get0 returns the consumed key. The type of value returned will be
// one of the following, depending on the type of the |EVP_PKEY|:
// |RSA|, |DSA| or |EC_KEY|.
//
// This function is provided only for compatibility with OpenSSL.
// Prefer the use the typed |EVP_PKEY_get0_*| functions instead.
Expand Down

0 comments on commit 8ff46c9

Please sign in to comment.