Ronald Cron | 6fe1bc3 | 2021-06-07 09:35:02 +0200 | [diff] [blame] | 1 | Remove the padding parameters from mbedtls_rsa_init() |
| 2 | ----------------------------------------------------- |
| 3 | |
| 4 | This affects all users who use the RSA encryption, decryption, sign and |
| 5 | verify APIs. |
| 6 | |
| 7 | The function mbedtls_rsa_init() no longer supports selecting the PKCS#1 v2.1 |
| 8 | encoding and its hash. It just selects the PKCS#1 v1.5 encoding by default. If |
| 9 | you were using the PKCS#1 v2.1 encoding you now need, subsequently to the call |
| 10 | to mbedtls_rsa_init(), to call mbedtls_rsa_set_padding() to set it. |
| 11 | |
Ronald Cron | f8abfa8 | 2021-06-09 10:17:04 +0200 | [diff] [blame] | 12 | To choose the padding type when initializing a context, instead of |
Ronald Cron | 6fe1bc3 | 2021-06-07 09:35:02 +0200 | [diff] [blame] | 13 | ```C |
| 14 | mbedtls_rsa_init(ctx, padding, hash_id); |
| 15 | ``` |
Ronald Cron | f8abfa8 | 2021-06-09 10:17:04 +0200 | [diff] [blame] | 16 | , use |
Ronald Cron | 6fe1bc3 | 2021-06-07 09:35:02 +0200 | [diff] [blame] | 17 | ```C |
| 18 | mbedtls_rsa_init(ctx); |
| 19 | mbedtls_rsa_set_padding(ctx, padding, hash_id); |
| 20 | ``` |
Ronald Cron | f8abfa8 | 2021-06-09 10:17:04 +0200 | [diff] [blame] | 21 | |
| 22 | To use PKCS#1 v1.5 padding, instead of |
Ronald Cron | 6fe1bc3 | 2021-06-07 09:35:02 +0200 | [diff] [blame] | 23 | ```C |
| 24 | mbedtls_rsa_init(ctx, MBEDTLS_RSA_PKCS_V15, <ignored>); |
| 25 | ``` |
Ronald Cron | f8abfa8 | 2021-06-09 10:17:04 +0200 | [diff] [blame] | 26 | , just use |
Ronald Cron | 6fe1bc3 | 2021-06-07 09:35:02 +0200 | [diff] [blame] | 27 | ```C |
| 28 | mbedtls_rsa_init(ctx); |
| 29 | ``` |