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 fb03bff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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
7 changes: 4 additions & 3 deletions include/openssl/evp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1144,12 +1144,13 @@ 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.
OPENSSL_EXPORT OPENSSL_DEPRECATED void *EVP_PKEY_get0(const EVP_PKEY *pkey);
OPENSSL_EXPORT OPENSSL_DEPRECATED void *EVP_PKEY_get0(EVP_PKEY *pkey);

// General No-op Functions [Deprecated].

Expand Down

0 comments on commit fb03bff

Please sign in to comment.