diff options
author | Rob Austein <sra@hactrn.net> | 2015-10-04 23:04:33 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2015-10-04 23:04:33 -0400 |
commit | c48caf83239f971edf17c978ef7d0987e3aaa718 (patch) | |
tree | 6e057442a25000f48c59a5aba2dc70c96e2f5521 /csprng.c | |
parent | b3bbd3dbccef8c499e980490203cd5085dd13a98 (diff) |
Helps to select the CSPRNG core before trying to call it.
Diffstat (limited to 'csprng.c')
-rw-r--r-- | csprng.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -50,6 +50,9 @@ hal_error_t hal_get_random(const hal_core_t *core, void *buffer, const size_t le hal_error_t err; size_t i; + if ((err = hal_core_check_name(&core, CSPRNG_NAME)) != HAL_OK) + return err; + for (i = 0; i < length; i += 4) { const int last = (length - i) < 4; |