Skip to content

Commit bd1e446

Browse files
committed
Add support for the crypto callback WC_PK_TYPE_RSA_GET_SIZE.
1 parent 549dcc1 commit bd1e446

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/tpm2_cryptocb.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ int wolfTPM2_CryptoDevCb(int devId, wc_CryptoInfo* info, void* ctx)
120120
#endif
121121
rc = exit_rc;
122122
}
123+
else if (info->pk.type == WC_PK_TYPE_RSA_GET_SIZE) {
124+
if (tlsCtx->rsaKey != NULL) {
125+
*info->pk.rsa_get_size.keySize =
126+
tlsCtx->rsaKey->pub.publicArea.parameters.rsaDetail.keyBits
127+
/ 8;
128+
rc = 0;
129+
}
130+
}
123131
else if (info->pk.type == WC_PK_TYPE_RSA) {
124132
switch (info->pk.rsa.type) {
125133
case RSA_PUBLIC_ENCRYPT:

0 commit comments

Comments
 (0)