Subject: [PATCH 2/4] openssl: do not ignore failure of EVP_CipherInit()

[PATCH 2/4] openssl: do not ignore failure of EVP_CipherInit()

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Tue, 11 Sep 2012 09:55:23 +0200

---
 src/openssl.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/openssl.c b/src/openssl.c
index 481982c..c61cb0e 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -175,8 +175,7 @@ _libssh2_cipher_init(_libssh2_cipher_ctx * h,
                      unsigned char *iv, unsigned char *secret, int encrypt)
 {
     EVP_CIPHER_CTX_init(h);
-    EVP_CipherInit(h, algo(), secret, iv, encrypt);
-    return 0;
+    return !EVP_CipherInit(h, algo(), secret, iv, encrypt);
 }
 
 int
-- 
1.7.1
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-09-11