mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-03 20:54:00 +00:00
Use mbedtls_rsa_info directly in rsa_decrypt_wrap()
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
parent
8e80504b46
commit
6b03a3de5c
@ -226,7 +226,6 @@ static int rsa_decrypt_wrap( void *ctx,
|
|||||||
mbedtls_pk_context key;
|
mbedtls_pk_context key;
|
||||||
int key_len;
|
int key_len;
|
||||||
unsigned char buf[MBEDTLS_PK_RSA_PRV_DER_MAX_BYTES];
|
unsigned char buf[MBEDTLS_PK_RSA_PRV_DER_MAX_BYTES];
|
||||||
mbedtls_pk_info_t pk_info = mbedtls_rsa_info;
|
|
||||||
|
|
||||||
((void) f_rng);
|
((void) f_rng);
|
||||||
((void) p_rng);
|
((void) p_rng);
|
||||||
@ -241,7 +240,7 @@ static int rsa_decrypt_wrap( void *ctx,
|
|||||||
|
|
||||||
/* mbedtls_pk_write_key_der() expects a full PK context;
|
/* mbedtls_pk_write_key_der() expects a full PK context;
|
||||||
* re-construct one to make it happy */
|
* re-construct one to make it happy */
|
||||||
key.pk_info = &pk_info;
|
key.pk_info = &mbedtls_rsa_info;
|
||||||
key.pk_ctx = ctx;
|
key.pk_ctx = ctx;
|
||||||
key_len = mbedtls_pk_write_key_der( &key, buf, sizeof( buf ) );
|
key_len = mbedtls_pk_write_key_der( &key, buf, sizeof( buf ) );
|
||||||
if( key_len <= 0 )
|
if( key_len <= 0 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user