aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2023-04-27 17:42:09 -0400
committerDavid Benjamin <davidben@google.com>2023-04-27 17:43:06 -0400
commiteedfb29cdb62ee79a3e0cb240a4fb0be6e1419c3 (patch)
treefe5b7bb8eb26c60f4d5622114a378eb8c5cc671d
parent78db2fd3c9d2d33d43c7cebbba1a90a0ff1177e1 (diff)
downloadvboot_reference-eedfb29cdb62ee79a3e0cb240a4fb0be6e1419c3.tar.gz
Use accessors instead of reaching into the RSA struct
Additionally, use the canonical name for the type, which is the RSA typedef, not rsa_st. Test: mm external/vboot_reference, treehugger Change-Id: I4fc98710441fa840926e24f38ccdf5eeaa1ea9c7
-rw-r--r--host/lib/util_misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/util_misc.c b/host/lib/util_misc.c
index e75251e6..ac0b3ea5 100644
--- a/host/lib/util_misc.c
+++ b/host/lib/util_misc.c
@@ -29,7 +29,7 @@ void PrintPubKeySha1Sum(VbPublicKey *key)
free(digest);
}
-int vb_keyb_from_rsa(struct rsa_st *rsa_private_key,
+int vb_keyb_from_rsa(RSA *rsa_private_key,
uint8_t **keyb_data, uint32_t *keyb_size)
{
uint32_t i, nwords;
@@ -46,7 +46,7 @@ int vb_keyb_from_rsa(struct rsa_st *rsa_private_key,
int retval = 1;
/* Size of RSA key in 32-bit words */
- nwords = BN_num_bits(rsa_private_key->n) / 32;
+ nwords = RSA_bits(rsa_private_key) / 32;
bufsize = (2 + nwords + nwords) * sizeof(uint32_t);
outbuf = malloc(bufsize);
@@ -75,7 +75,7 @@ int vb_keyb_from_rsa(struct rsa_st *rsa_private_key,
NEW_BIGNUM(B);
#undef NEW_BIGNUM
- BN_copy(N, rsa_private_key->n);
+ BN_copy(N, RSA_get0_n(rsa_private_key));
BN_set_word(Big1, 1L);
BN_set_word(Big2, 2L);
BN_set_word(Big32, 32L);