GeezerVison is showing github.com — crypto: use X509_ALGOR accessors instead of reaching into X509_ALGOR · nodejs/node@edb0ffd
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/crypto/crypto_rsa.cc +9-3Lines changed: 9 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -577,7 +577,9 @@ Maybe<bool> GetRsaKeyDetail( |
577 | 577 | int64_t salt_length = 20; |
578 | 578 |
|
579 | 579 | if (params->hashAlgorithm != nullptr) { |
580 | | - hash_nid = OBJ_obj2nid(params->hashAlgorithm->algorithm); |
| 580 | + const ASN1_OBJECT* hash_obj; |
| 581 | + X509_ALGOR_get0(&hash_obj, nullptr, nullptr, params->hashAlgorithm); |
| 582 | + hash_nid = OBJ_obj2nid(hash_obj); |
581 | 583 | } |
582 | 584 |
|
583 | 585 | if (target |
@@ -590,9 +592,13 @@ Maybe<bool> GetRsaKeyDetail( |
590 | 592 | } |
591 | 593 |
|
592 | 594 | if (params->maskGenAlgorithm != nullptr) { |
593 | | - mgf_nid = OBJ_obj2nid(params->maskGenAlgorithm->algorithm); |
| 595 | + const ASN1_OBJECT* mgf_obj; |
| 596 | + X509_ALGOR_get0(&mgf_obj, nullptr, nullptr, params->maskGenAlgorithm); |
| 597 | + mgf_nid = OBJ_obj2nid(mgf_obj); |
594 | 598 | if (mgf_nid == NID_mgf1) { |
595 | | - mgf1_hash_nid = OBJ_obj2nid(params->maskHash->algorithm); |
| 599 | + const ASN1_OBJECT* mgf1_hash_obj; |
| 600 | + X509_ALGOR_get0(&mgf1_hash_obj, nullptr, nullptr, params->maskHash); |
| 601 | + mgf1_hash_nid = OBJ_obj2nid(mgf1_hash_obj); |
596 | 602 | } |
597 | 603 | } |
598 | 604 |
|
|