aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-12-16 16:52:45 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-12-23 14:31:32 +0100
commit9b858f57c507704bccac56fbb24635a93febc602 (patch)
tree8d2b47bdb29297746f9d2007caa7b14711b548fd
parent13c88a2e0a7a894f23be0a12a5b75876d8e24f21 (diff)
downloadlibssh-9b858f57c507704bccac56fbb24635a93febc602.tar.gz
libssh-9b858f57c507704bccac56fbb24635a93febc602.tar.xz
libssh-9b858f57c507704bccac56fbb24635a93febc602.zip
mbedcrypto_missing: Always check return values
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/mbedcrypto_missing.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mbedcrypto_missing.c b/src/mbedcrypto_missing.c
index cf789b13..ac0d688c 100644
--- a/src/mbedcrypto_missing.c
+++ b/src/mbedcrypto_missing.c
@@ -104,6 +104,9 @@ int ssh_mbedcry_rand(bignum rnd, int bits, int top, int bottom)
if (top == 0) {
rc = mbedtls_mpi_set_bit(rnd, bits - 1, 0);
+ if (rc != 0) {
+ return 0;
+ }
}
if (top == 1) {