Attention is currently required from: Arne Schwabe, Răzvan Cojocaru.

Hello Arne Schwabe,

I'd like you to reexamine a change. Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2363?usp=email

to look at the new patch set (#2).


Change subject: xkey_provider: free the signing context when sign init fails
......................................................................

xkey_provider: free the signing context when sign init fails

xkey_native_sign() returned without EVP_PKEY_CTX_free() when
EVP_PKEY_sign_init_ex() failed.

Also drop the unused initialisation of ret.

Change-Id: I8a1b576401313f826a188dc40f226726f378066b
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/xkey_provider.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/63/2363/2

diff --git a/src/openvpn/xkey_provider.c b/src/openvpn/xkey_provider.c
index 9211c11..5693418 100644
--- a/src/openvpn/xkey_provider.c
+++ b/src/openvpn/xkey_provider.c
@@ -1094,7 +1094,6 @@
     ASSERT(key);

     EVP_PKEY *pkey = key->handle;
-    int ret = 0;

     ASSERT(sig);

@@ -1140,11 +1139,12 @@
     if (EVP_PKEY_sign_init_ex(ectx, NULL) != 1)
     {
         msg(M_WARN, "WARN: xkey test_sign: call to EVP_PKEY_sign_init failed");
+        EVP_PKEY_CTX_free(ectx);
         return 0;
     }
     EVP_PKEY_CTX_set_params(ectx, params);

-    ret = EVP_PKEY_sign(ectx, sig, siglen, tbs, tbslen);
+    int ret = EVP_PKEY_sign(ectx, sig, siglen, tbs, tbslen);
     EVP_PKEY_CTX_free(ectx);

     return ret;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2363?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8a1b576401313f826a188dc40f226726f378066b
Gerrit-Change-Number: 2363
Gerrit-PatchSet: 2
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Răzvan Cojocaru <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to