aboutsummaryrefslogtreecommitdiff
path: root/src/pki_crypto.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2017-11-07 09:38:40 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-11-07 15:10:32 +0100
commit16818bd0e4525ac46de7c127ddce455e06839023 (patch)
tree36f274fdd7b55a4b05e27a10bd364bfd802d0976 /src/pki_crypto.c
parentd29d199592717e215278cb28370372d3a72799eb (diff)
downloadlibssh-16818bd0e4525ac46de7c127ddce455e06839023.tar.gz
libssh-16818bd0e4525ac46de7c127ddce455e06839023.tar.xz
libssh-16818bd0e4525ac46de7c127ddce455e06839023.zip
pki_crypto: Avoid segfault with OpenSSL 1.1.0
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki_crypto.c')
-rw-r--r--src/pki_crypto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 19821725..2a8e46ec 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -454,6 +454,10 @@ 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
+ key->dsa = DSA_new();
+ if (!key->dsa) {
+ return SSH_ERROR;
+ }
rc = DSA_generate_parameters_ex(key->dsa,
parameter,
NULL, /* seed */