aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-10-29 16:06:14 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-10-29 16:06:14 +0100
commit954da14c150771857b095f108995d41f843f950d (patch)
tree3795651411bdef99c62f13c0a5c42e151c44f818
parent7527876fad2379ae22a5b1913b1f8aff581b80d8 (diff)
downloadlibssh-954da14c150771857b095f108995d41f843f950d.tar.gz
libssh-954da14c150771857b095f108995d41f843f950d.tar.xz
libssh-954da14c150771857b095f108995d41f843f950d.zip
pki_crypto: Don't use deprecated function with newer OpenSSL
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/pki_crypto.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 53287f30..19821725 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -453,11 +453,24 @@ int pki_key_generate_rsa(ssh_key key, int parameter){
int pki_key_generate_dss(ssh_key key, int parameter){
int rc;
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
+ rc = DSA_generate_parameters_ex(key->dsa,
+ parameter,
+ NULL, /* seed */
+ 0, /* seed_len */
+ NULL, /* counter_ret */
+ NULL, /* h_ret */
+ NULL); /* cb */
+ if (rc != 1) {
+ return SSH_ERROR;
+ }
+#else
key->dsa = DSA_generate_parameters(parameter, NULL, 0, NULL, NULL,
NULL, NULL);
if(key->dsa == NULL){
return SSH_ERROR;
}
+#endif
rc = DSA_generate_key(key->dsa);
if (rc != 1){
DSA_free(key->dsa);