Skip to content

Commit

Permalink
EVP_PKEY assert method found (#1279)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth authored Nov 3, 2023
1 parent 69f126f commit 22bd914
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions crypto/fipsmodule/evp/evp.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) {
}

int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key) {
evp_pkey_set_method(pkey, evp_pkey_asn1_find(EVP_PKEY_RSA));
const EVP_PKEY_ASN1_METHOD *meth = evp_pkey_asn1_find(EVP_PKEY_RSA);
assert(meth != NULL);
evp_pkey_set_method(pkey, meth);
pkey->pkey.ptr = key;
return key != NULL;
}
Expand Down Expand Up @@ -281,7 +283,9 @@ int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) {
}

int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key) {
evp_pkey_set_method(pkey, evp_pkey_asn1_find(EVP_PKEY_DSA));
const EVP_PKEY_ASN1_METHOD *meth = evp_pkey_asn1_find(EVP_PKEY_DSA);
assert(meth != NULL);
evp_pkey_set_method(pkey, meth);
pkey->pkey.ptr = key;
return key != NULL;
}
Expand Down Expand Up @@ -311,7 +315,9 @@ int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) {
}

int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) {
evp_pkey_set_method(pkey, evp_pkey_asn1_find(EVP_PKEY_EC));
const EVP_PKEY_ASN1_METHOD *meth = evp_pkey_asn1_find(EVP_PKEY_EC);
assert(meth != NULL);
evp_pkey_set_method(pkey, meth);
pkey->pkey.ptr = key;
return key != NULL;
}
Expand Down
6 changes: 4 additions & 2 deletions ssl/test/bssl_shim.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ class OwnedSocket {
OwnedSocket(OwnedSocket &&other) { *this = std::move(other); }
~OwnedSocket() { reset(); }
OwnedSocket &operator=(OwnedSocket &&other) {
drain_on_close_ = other.drain_on_close_;
reset(other.release());
if (this != &other) {
drain_on_close_ = other.drain_on_close_;
reset(other.release());
}
return *this;
}

Expand Down

0 comments on commit 22bd914

Please sign in to comment.