Skip to content

Commit

Permalink
Merge branch 'PHP-7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bukka committed Aug 14, 2016
2 parents 42906d3 + 427c8c8 commit f13fd9e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions ext/openssl/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4059,11 +4059,8 @@ zend_bool php_openssl_pkey_init_dsa(DSA *dsa, zval *data)

OPENSSL_PKEY_SET_BN(data, pub_key);
OPENSSL_PKEY_SET_BN(data, priv_key);
if (priv_key || pub_key) {
return 1;
}
if (!DSA_set0_key(dsa, pub_key, priv_key)) {
return 0;
if (pub_key) {
return DSA_set0_key(dsa, pub_key, priv_key);
}

/* generate key */
Expand Down Expand Up @@ -4098,11 +4095,8 @@ zend_bool php_openssl_pkey_init_dh(DH *dh, zval *data)

OPENSSL_PKEY_SET_BN(data, priv_key);
OPENSSL_PKEY_SET_BN(data, pub_key);
if (priv_key || pub_key) {
return 1;
}
if (!DH_set0_key(dh, pub_key, priv_key)) {
return 0;
if (pub_key) {
return DH_set0_key(dh, pub_key, priv_key);
}

/* generate key */
Expand Down

0 comments on commit f13fd9e

Please sign in to comment.