mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-11 02:02:32 +03:00
In mbedtls_rsa_rsaes_oaep_encrypt and mbedtls_rsa_rsaes_pkcs1_v15_encrypt, if the input length is 0 (which is unusual and mostly useless, but permitted) then it is fine for the input pointer to be NULL. Don't return an error in this case. When `input` is NULL, `memcpy( p, input, ilen )` has undefined behavior even if `ilen` is zero. So skip the `memcpy` call in this case. Likewise, in `mbedtls_rsa_rsaes_oaep_decrypt` and `mbedtls_rsa_rsaes_pkcs1_v15_decrypt`, skip the `memcpy` call if `*olen` is zero.
70 KiB
70 KiB