diff options
author | David Benjamin <davidben@google.com> | 2023-06-03 01:11:16 -0400 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-06-09 02:57:17 +0000 |
commit | d4553e0538509b673137900db28413706a2be792 (patch) | |
tree | 6ea477568a45969665ace8c8ceebc77d587cef19 /tool | |
parent | 23ed9d3852bbc738bebeaa0fe4a0782f91d7873c (diff) | |
download | boringssl-d4553e0538509b673137900db28413706a2be792.zip boringssl-d4553e0538509b673137900db28413706a2be792.tar.gz boringssl-d4553e0538509b673137900db28413706a2be792.tar.bz2 |
Make RSA opaque
Three years of updating calling code are finally complete!
Update-Note: Accessing the RSA struct directly is no longer supported.
Use accessors instead.
Bug: 316, 325
Change-Id: I27b4c9899cb96f5807075b8fe351eaf72a9a9d44
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/60610
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: Bob Beck <bbe@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Diffstat (limited to 'tool')
-rw-r--r-- | tool/speed.cc | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tool/speed.cc b/tool/speed.cc index e2594db..8b4b13c 100644 --- a/tool/speed.cc +++ b/tool/speed.cc @@ -367,15 +367,11 @@ static bool SpeedRSA(const std::string &selected) { // construct a new RSA key, with a new |BN_MONT_CTX| for the // public modulus. If we were to use |key| directly instead, then // these costs wouldn't be accounted for. - bssl::UniquePtr<RSA> verify_key(RSA_new()); + bssl::UniquePtr<RSA> verify_key(RSA_new_public_key( + RSA_get0_n(key.get()), RSA_get0_e(key.get()))); if (!verify_key) { return false; } - verify_key->n = BN_dup(key->n); - verify_key->e = BN_dup(key->e); - if (!verify_key->n || !verify_key->e) { - return false; - } return RSA_verify(NID_sha256, fake_sha256_hash, sizeof(fake_sha256_hash), sig, sig_len, verify_key.get()); |