mbedtls why I am getting the "The random generator failed to generate non-zeros" error -
i trying port aws sdk uses mbedtls on ameba board. have function aws : iot_tls_connect initialize mbedtls.
mcu has trng in first phase not important use hw trng. software rng , entropy can fine. tried lots of different combination , mbedtls config getting following error
iot_tls_connect: mbedtls_ssl_handshake(): rsa - random generator failed generate non-zeros aws_iot_mqtt_connect failed ssl handshake error
my last code
mbedtls_net_init(&server_fd); mbedtls_ssl_init(&ssl); mbedtls_ssl_config_init(&conf); mbedtls_ctr_drbg_init(&ctr_drbg); mbedtls_x509_crt_init(&cacert); mbedtls_x509_crt_init(&clicert); mbedtls_pk_init(&pkey); /* my_random returns random values hw trng */ mbedtls_ssl_conf_rng(&ssl, my_random, null); iot_debug("seeding random number generator..."); mbedtls_entropy_init(&entropy); /* added test */ ret = mbedtls_entropy_add_source(&entropy, entropy_dummy_source, null, 16, 1); if((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, pers, strlen(pers))) != 0) { ... } /* added test suggested in tutorials */ mbedtls_ctr_drbg_set_prediction_resistance(&ctr_drbg, mbedtls_ctr_drbg_pr_on );
it can config file. tutorials did not help. blocks me. idea.
thank you.
i using ameba sdk , found bug in modification hw crypto module in aes.c. reason not generic issue.
Comments
Post a Comment