I am trying to get this example program https://github.com/ARMmbed/mbedtls/blob/mbedtls-2.11.0/programs/x509/cert_req.c (stripped out all the file handling stuff) to run on an nrf9160, but it fails to seed the RNG. I stepped through the mbedtls_ctr_drbg_seed() function, right to the call to mbedtls_ctr_drbg_reseed_internal(), in which the first line is this:
if( ctx->entropy_len > MBEDTLS_CTR_DRBG_MAX_SEED_INPUT )
ctx->entropy_len is 32 and MBEDTLS_CTR_DRBG_MAX_SEED_INPUT should be 384, but when I grep for MBEDTLS_CTR_DRBG_MAX_SEED_INPUT in the project directory, I can't see it being defined anywhere. If that were the case, it should evaluate to 0 and the condition should become true, which would cause the function to return MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG.
Instead, it goes directly to z_arm_usage_fault() and that is that.
I can't make any sense of this. Is there anyone who can help getting this to work?