mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2024-12-29 00:17:49 +00:00
programs/dh_client/server: Added entropy source to mbedtls_rsa_pkcs1_sign()
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
parent
a184fd0516
commit
f4dfd1c8a5
@ -193,8 +193,9 @@ int main(void)
|
|||||||
buf[n] = (unsigned char) (rsa.MBEDTLS_PRIVATE(len) >> 8);
|
buf[n] = (unsigned char) (rsa.MBEDTLS_PRIVATE(len) >> 8);
|
||||||
buf[n + 1] = (unsigned char) (rsa.MBEDTLS_PRIVATE(len));
|
buf[n + 1] = (unsigned char) (rsa.MBEDTLS_PRIVATE(len));
|
||||||
|
|
||||||
if ((ret = mbedtls_rsa_pkcs1_sign(&rsa, NULL, NULL, MBEDTLS_MD_SHA256,
|
if ((ret = mbedtls_rsa_pkcs1_sign(&rsa, mbedtls_ctr_drbg_random, &ctr_drbg,
|
||||||
MBEDTLS_MD_CAN_SHA256_MAX_SIZE, hash, buf + n + 2)) != 0) {
|
MBEDTLS_MD_SHA256, MBEDTLS_MD_CAN_SHA256_MAX_SIZE,
|
||||||
|
hash, buf + n + 2)) != 0) {
|
||||||
mbedtls_printf(" failed\n ! mbedtls_rsa_pkcs1_sign returned %d\n\n", ret);
|
mbedtls_printf(" failed\n ! mbedtls_rsa_pkcs1_sign returned %d\n\n", ret);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user