diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-03-30 14:55:47 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-03-30 14:57:36 +0200 |
commit | db1c50c090bad72eb5c28b1867b7564708ba7f3c (patch) | |
tree | 02fcbe0780de8702a92efbd484b12319a8ac9e00 | |
parent | 16bf6f0f4b3bee60540af9b289d55faee2a3f86e (diff) | |
download | ustream-ssl-db1c50c090bad72eb5c28b1867b7564708ba7f3c.tar.gz |
polarssl: fix return code of entropy function
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | ustream-polarssl.c | 4 | ||||
-rw-r--r-- | ustream-polarssl.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/ustream-polarssl.c b/ustream-polarssl.c index e5c8455..cbf24cb 100644 --- a/ustream-polarssl.c +++ b/ustream-polarssl.c @@ -79,7 +79,9 @@ static bool urandom_init(void) static int _urandom(void *ctx, unsigned char *out, size_t len) { - read(urandom_fd, out, len); + if (read(urandom_fd, out, len) < 0) + return POLARSSL_ERR_ENTROPY_SOURCE_FAILED; + return 0; } diff --git a/ustream-polarssl.h b/ustream-polarssl.h index dfc287d..3265472 100644 --- a/ustream-polarssl.h +++ b/ustream-polarssl.h @@ -26,6 +26,7 @@ #include <polarssl/rsa.h> #include <polarssl/error.h> #include <polarssl/version.h> +#include <polarssl/entropy.h> #if POLARSSL_VERSION_MAJOR > 1 || POLARSSL_VERSION_MINOR >= 3 #define USE_VERSION_1_3 |