crypto: use X509_ALGOR accessors instead of reaching into X509_ALGOR
While the struct is still public in OpenSSL, there is a (somewhat inconvenient) accessor. Use it to remain compatible if it becomes opaque in the future. PR-URL: https://github.com/nodejs/node/pull/50057 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
76004f3e56
commit
f10928f926
@ -577,7 +577,9 @@ Maybe<bool> GetRsaKeyDetail(
|
||||
int64_t salt_length = 20;
|
||||
|
||||
if (params->hashAlgorithm != nullptr) {
|
||||
hash_nid = OBJ_obj2nid(params->hashAlgorithm->algorithm);
|
||||
const ASN1_OBJECT* hash_obj;
|
||||
X509_ALGOR_get0(&hash_obj, nullptr, nullptr, params->hashAlgorithm);
|
||||
hash_nid = OBJ_obj2nid(hash_obj);
|
||||
}
|
||||
|
||||
if (target
|
||||
@ -590,9 +592,13 @@ Maybe<bool> GetRsaKeyDetail(
|
||||
}
|
||||
|
||||
if (params->maskGenAlgorithm != nullptr) {
|
||||
mgf_nid = OBJ_obj2nid(params->maskGenAlgorithm->algorithm);
|
||||
const ASN1_OBJECT* mgf_obj;
|
||||
X509_ALGOR_get0(&mgf_obj, nullptr, nullptr, params->maskGenAlgorithm);
|
||||
mgf_nid = OBJ_obj2nid(mgf_obj);
|
||||
if (mgf_nid == NID_mgf1) {
|
||||
mgf1_hash_nid = OBJ_obj2nid(params->maskHash->algorithm);
|
||||
const ASN1_OBJECT* mgf1_hash_obj;
|
||||
X509_ALGOR_get0(&mgf1_hash_obj, nullptr, nullptr, params->maskHash);
|
||||
mgf1_hash_nid = OBJ_obj2nid(mgf1_hash_obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user