aboutsummaryrefslogtreecommitdiff
path: root/src/pki_crypto.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2019-06-21 08:55:06 +0200
committerJakub Jelen <jjelen@redhat.com>2019-06-21 08:55:06 +0200
commita80547bdf99819d58bf8ca1f46d224a82b285ce3 (patch)
tree7ad953b54af7719a7b0eb152f07a78e66e4f24cc /src/pki_crypto.c
parenta4fa51454910f5d435e79248d5d0fd39703c4e28 (diff)
downloadlibssh-a80547bdf99819d58bf8ca1f46d224a82b285ce3.tar.gz
libssh-a80547bdf99819d58bf8ca1f46d224a82b285ce3.tar.xz
libssh-a80547bdf99819d58bf8ca1f46d224a82b285ce3.zip
pki_crypto: Correct error checking after RSA key generation
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Diffstat (limited to 'src/pki_crypto.c')
-rw-r--r--src/pki_crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 4274bf5b..4cb23e60 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -529,7 +529,7 @@ int pki_key_generate_rsa(ssh_key key, int parameter){
BN_free(e);
- if (rc == -1 || key->rsa == NULL)
+ if (rc <= 0 || key->rsa == NULL)
return SSH_ERROR;
return SSH_OK;
}