2021-06-07 09:35:02 +02:00
|
|
|
Remove the padding parameters from mbedtls_rsa_init()
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
This affects all users who use the RSA encryption, decryption, sign and
|
|
|
|
verify APIs.
|
|
|
|
|
|
|
|
The function mbedtls_rsa_init() no longer supports selecting the PKCS#1 v2.1
|
|
|
|
encoding and its hash. It just selects the PKCS#1 v1.5 encoding by default. If
|
|
|
|
you were using the PKCS#1 v2.1 encoding you now need, subsequently to the call
|
|
|
|
to mbedtls_rsa_init(), to call mbedtls_rsa_set_padding() to set it.
|
|
|
|
|
2021-06-09 10:17:04 +02:00
|
|
|
To choose the padding type when initializing a context, instead of
|
2021-06-07 09:35:02 +02:00
|
|
|
```C
|
|
|
|
mbedtls_rsa_init(ctx, padding, hash_id);
|
|
|
|
```
|
2021-06-09 10:17:04 +02:00
|
|
|
, use
|
2021-06-07 09:35:02 +02:00
|
|
|
```C
|
|
|
|
mbedtls_rsa_init(ctx);
|
|
|
|
mbedtls_rsa_set_padding(ctx, padding, hash_id);
|
|
|
|
```
|
2021-06-09 10:17:04 +02:00
|
|
|
|
|
|
|
To use PKCS#1 v1.5 padding, instead of
|
2021-06-07 09:35:02 +02:00
|
|
|
```C
|
|
|
|
mbedtls_rsa_init(ctx, MBEDTLS_RSA_PKCS_V15, <ignored>);
|
|
|
|
```
|
2021-06-09 10:17:04 +02:00
|
|
|
, just use
|
2021-06-07 09:35:02 +02:00
|
|
|
```C
|
|
|
|
mbedtls_rsa_init(ctx);
|
|
|
|
```
|