mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
libssh: Fix compile without OpenSSL deprecated APIs
Backported several patches from version 0.8 to fix this. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
committed by
Kevin Darbyshire-Bryant
parent
52575dbc10
commit
7bc5aba1df
@@ -0,0 +1,36 @@
|
||||
From c39f7578765859d7416e4140c92d034c8cae3341 Mon Sep 17 00:00:00 2001
|
||||
From: Jakub Jelen <jjelen@redhat.com>
|
||||
Date: Wed, 8 Nov 2017 15:35:08 +0100
|
||||
Subject: [PATCH] pki_crypto: Avoid potential memory leak
|
||||
|
||||
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
|
||||
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
||||
---
|
||||
src/pki_crypto.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
|
||||
index 30f49a81..d9f7753a 100644
|
||||
--- a/src/pki_crypto.c
|
||||
+++ b/src/pki_crypto.c
|
||||
@@ -453,7 +453,7 @@ int pki_key_generate_dss(ssh_key key, int parameter){
|
||||
int rc;
|
||||
#if OPENSSL_VERSION_NUMBER > 0x10100000L
|
||||
key->dsa = DSA_new();
|
||||
- if (!key->dsa) {
|
||||
+ if (key->dsa == NULL) {
|
||||
return SSH_ERROR;
|
||||
}
|
||||
rc = DSA_generate_parameters_ex(key->dsa,
|
||||
@@ -464,6 +464,8 @@ int pki_key_generate_dss(ssh_key key, int parameter){
|
||||
NULL, /* h_ret */
|
||||
NULL); /* cb */
|
||||
if (rc != 1) {
|
||||
+ DSA_free(key->dsa);
|
||||
+ key->dsa = NULL;
|
||||
return SSH_ERROR;
|
||||
}
|
||||
#else
|
||||
--
|
||||
2.19.1
|
||||
|
||||
Reference in New Issue
Block a user