Use EVP_PKEY_bits in SimplePathBuilderDelegate No need to dip out of EVP for this one. Change-Id: Ide03d28edd5316addbb9051d527fec23ace259ba Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/81660 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/pki/simple_path_builder_delegate.cc b/pki/simple_path_builder_delegate.cc index 7870611..a3b5205 100644 --- a/pki/simple_path_builder_delegate.cc +++ b/pki/simple_path_builder_delegate.cc
@@ -100,12 +100,7 @@ int pkey_id = EVP_PKEY_id(public_key); if (pkey_id == EVP_PKEY_RSA) { // Extract the modulus length from the key. - RSA *rsa = EVP_PKEY_get0_RSA(public_key); - if (!rsa) { - return false; - } - unsigned int modulus_length_bits = RSA_bits(rsa); - + unsigned int modulus_length_bits = EVP_PKEY_bits(public_key); if (modulus_length_bits < min_rsa_modulus_length_bits_) { errors->AddWarning( kRsaModulusTooSmall,