Skip to contentSkip to conversation

Use RSA_meth_free instead of free

PATCH In review [email protected]... 4 participants 4 messages Jan 13, 2018 – Jan 14, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use RSA_meth_free instead of free

From: Selva Nair <[email protected]...>

- RSA_meth_new allocates memory for the name string and must be released using RSA_meth_free

---
 src/openvpn/ssl_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl_openssl.c +1 -1
index 34c31b9..d6d9acf 100644
@@ -1144,7 +1144,7 @@ err:
     {
         if (rsa_meth)
         {
-            free(rsa_meth);
+            RSA_meth_free(rsa_meth);
         }
     }
     crypto_msg(M_FATAL, "Cannot enable SSL external private key capability");
Signature · 1 line
2.1.4
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 23 lines · On Sun, Jan 14, 2018 at 12:00 AM, <[email protected]...> wrote:

From: Selva Nair <[email protected]...>

- RSA_meth_new allocates memory for the name string and must be released using RSA_meth_free

---
 src/openvpn/ssl_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl_openssl.c +1 -1
index 34c31b9..d6d9acf 100644
@@ -1144,7 +1144,7 @@ err:
     {
         if (rsa_meth)
         {
-            free(rsa_meth);
+            RSA_meth_free(rsa_meth);
         }
     }
     crypto_msg(M_FATAL, "Cannot enable SSL external private key
Quoted 5 lines

capability");
--
2.1.4

​Good catch.

For what it's worth:

​BR,

-- Emmanuel Deloget​

Acked-by on v1 1/1
#2 lore raw
In reply to [email protected]...

Hi,

Quoted 16 lines · On 14-01-18 00:00, [email protected]... wrote:

From: Selva Nair <[email protected]...>

- RSA_meth_new allocates memory for the name string and must be released using RSA_meth_free

---
 src/openvpn/ssl_openssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/ssl_openssl.c +0 -0
index 34c31b9..d6d9acf 100644

src/openvpn/ssl_openssl.c err: · line 1150

Quoted 8 lines
src/openvpn/ssl_openssl.c +1 -1
@@ -1144,7 +1144,7 @@ err:
     {
         if (rsa_meth)
         {
-            free(rsa_meth);
+            RSA_meth_free(rsa_meth);
         }
     }
     crypto_msg(M_FATAL, "Cannot enable SSL external private key capability");

Good find, seems we missed that in the transition to OpenSSL 1.1.

(I see we have the same pattern in cryptapi.c, but you fix that as part of your cryptoapi.c patches.)

-Steffan

#3 lore raw
In reply to [email protected]...

Your patch has been applied to the master and release/2.4 branch.

commit 508741c1cf99b8a24205601800fa5056c6d0192b (master) commit 73bb2a7d32069343b8bfd211bd5783482c8a490d (release/2.4)

Author: Selva Nair
Date:   Sat Jan 13 18:00:46 2018 -0500
     Use RSA_meth_free instead of free

     Signed-off-by: Selva Nair <[email protected]...>
     Acked-by: Emmanuel Deloget <[email protected]...>
     Acked-by: Steffan Karger <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg16207.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering