[Cryptech-Commits] [sw/libhal] 03/05: Helps to select the CSPRNG core before trying to call it.
git at cryptech.is
git at cryptech.is
Mon Oct 5 03:28:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
sra at hactrn.net pushed a commit to branch config_core_selector
in repository sw/libhal.
commit c48caf83239f971edf17c978ef7d0987e3aaa718
Author: Rob Austein <sra at hactrn.net>
Date: Sun Oct 4 23:04:33 2015 -0400
Helps to select the CSPRNG core before trying to call it.
---
csprng.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/csprng.c b/csprng.c
index 08ca794..4fc80d0 100644
--- a/csprng.c
+++ b/csprng.c
@@ -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;
More information about the Commits
mailing list