An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.
. Reading private key from rsa_priv.txt
. Checking the private key
. Generating the RSA/SHA-256 signature failed
! mbedtls_rsa_pkcs1_sign returned -0x4080
+ Press Enter to exit this program.
Thanks for reporting this issue. The documentation of mbedtls_rsa_pkcs1_sign says that the RNG function parameter is mandatory thus you are right, the call to it in rsa_sign.c is not correct.
Summary
When trying
rsa_sign.exe
, I get this output:It is failing at this line: https://github.com/ARMmbed/mbedtls/blob/d1d0b41fc0b9e3d4012ccf9796ef9e641079cea2/library/rsa.c#L1887 because of this check: https://github.com/ARMmbed/mbedtls/blob/d1d0b41fc0b9e3d4012ccf9796ef9e641079cea2/library/rsa.c#L918-L919
I suppose, that there cannot be
NULL
for the random function here: https://github.com/ARMmbed/mbedtls/blob/d1d0b41fc0b9e3d4012ccf9796ef9e641079cea2/programs/pkey/rsa_sign.c#L145-L146NOTE: It was tested with the version
3.1.0
.