Skip to content

Commit

Permalink
lib-dcrypt: Fixed dcrypt_openssl_generate_keypair()
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed May 31, 2016
1 parent 0f56c2a commit 4372103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib-dcrypt/dcrypt-openssl.c
Expand Up @@ -699,7 +699,7 @@ bool dcrypt_openssl_generate_keypair(struct dcrypt_keypair *pair_r, enum dcrypt_
{
EVP_PKEY *pkey = NULL;
if (kind == DCRYPT_KEY_RSA) {
if (dcrypt_openssl_generate_rsa_key(bits, &pkey, error_r) == 0) {
if (dcrypt_openssl_generate_rsa_key(bits, &pkey, error_r)) {
pair_r->priv = (struct dcrypt_private_key*)pkey;
return dcrypt_openssl_private_to_public_key(pair_r->priv, &(pair_r->pub), error_r);
} else return dcrypt_openssl_error(error_r);
Expand All @@ -710,7 +710,7 @@ bool dcrypt_openssl_generate_keypair(struct dcrypt_keypair *pair_r, enum dcrypt_
*error_r = t_strdup_printf("Unknown EC curve %s", curve);
return FALSE;
}
if (dcrypt_openssl_generate_ec_key(nid, &pkey, error_r) == 0) {
if (dcrypt_openssl_generate_ec_key(nid, &pkey, error_r)) {
pair_r->priv = (struct dcrypt_private_key*)pkey;
return dcrypt_openssl_private_to_public_key(pair_r->priv, &(pair_r->pub), error_r);
} else return dcrypt_openssl_error(error_r);
Expand Down

0 comments on commit 4372103

Please sign in to comment.