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>
(cherry picked from commit a80547bdf9)
This commit is contained in:
Jakub Jelen
2019-06-21 08:55:06 +02:00
committed by Andreas Schneider
parent ebfe46f6ad
commit ec486d13db

View File

@@ -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;
}