[pkg-opensc-commit] [libp11] 33/86: Fixed a few obvious EC bugs

Eric Dorland eric at moszumanska.debian.org
Sun Jul 24 21:40:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit 8f15775a673394333de399cbe93f3e87b252ef4a
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Tue Feb 2 18:47:19 2016 +0100

    Fixed a few obvious EC bugs
---
 src/p11_ec.c  | 4 ++--
 src/p11_ops.c | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/p11_ec.c b/src/p11_ec.c
index 872b120..ae22b90 100644
--- a/src/p11_ec.c
+++ b/src/p11_ec.c
@@ -251,7 +251,7 @@ static int pkcs11_ec_ckey(void *out,
 	key = (PKCS11_KEY *) EC_KEY_get_ex_data(ecdh, ec_key_ex_index);
 
 	if (key == NULL) {
-	    ret -1;
+	    ret = -1;
 	    goto err;
 	}
 
@@ -283,7 +283,7 @@ static int pkcs11_ec_ckey(void *out,
 
 	if (KDF != 0) {
 		if (KDF(buf, buflen, out, &outlen) == NULL) {
-			ret -1;
+			ret = -1;
 			goto err;
 		}
 		ret = outlen;
diff --git a/src/p11_ops.c b/src/p11_ops.c
index df6908d..fa8e4d2 100644
--- a/src/p11_ops.c
+++ b/src/p11_ops.c
@@ -83,7 +83,6 @@ int pkcs11_ecdh_derive_internal(unsigned char **out, size_t *outlen,
 		    goto err;
 	}
 
-	CRYPTO_w_lock(PRIVSLOT(slot)->lockid);
 	rv = CRYPTOKI_call(ctx, C_DeriveKey(spriv->session, &mechanism, kpriv->object, newkey_template, 5, &newkey));
 	if (rv) {
 	    PKCS11err(PKCS11_F_PKCS11_EC_KEY_COMPUTE_KEY, pkcs11_map_err(rv));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list