reassign libhx509-3-heimdal
thanks

On Fri, Sep 19, 2008 at 12:12:37AM +0200, Guido Günther wrote:
> abort is being called due to P11_SESSION_IN_USE not being set but
> p11_put_session wants to clear it. The real fix probably simply wants to
> remove the p11_put_session calls but with the attached version it's
> clearer what's going wrong.
I'll attach two patches that superseed the previous one. Together they
fix the described bug plus on more crash on subsequent card logins.
 -- Guido
>From 3dfedeab21596c9a3b3695f7966b1f4a94ac15d3 Mon Sep 17 00:00:00 2001
From: Guido Guenther <[EMAIL PROTECTED]>
Date: Fri, 19 Sep 2008 00:07:56 +0200
Subject: [PATCH] don't try to clean unset P11_SESSION_IN_USE

fixes abort()
---
 lib/hx509/ks_p11.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/lib/hx509/ks_p11.c b/lib/hx509/ks_p11.c
index d92e23c..563e43c 100644
--- a/lib/hx509/ks_p11.c
+++ b/lib/hx509/ks_p11.c
@@ -454,7 +454,6 @@ p11_get_session(hx509_context context,
 				       "Failed to login on slot id %d "
 				       "with error: 0x%08x",
 				       (int)slot->id, ret);
-	    p11_put_session(p, slot, slot->session);
 	    return HX509_PKCS11_LOGIN;
 	}
 	if (slot->pin == NULL) {
@@ -463,7 +462,6 @@ p11_get_session(hx509_context context,
 		if (context)
 		    hx509_set_error_string(context, 0, ENOMEM,
 					   "out of memory");
-		p11_put_session(p, slot, slot->session);
 		return ENOMEM;
 	    }
 	}
-- 
1.5.6.5

>From 74a283fa5253c107e746d088d355a190164a4979 Mon Sep 17 00:00:00 2001
From: Guido Guenther <[EMAIL PROTECTED]>
Date: Fri, 19 Sep 2008 09:08:09 +0200
Subject: [PATCH] don't set P11_LOGIN_DONE before we're logged in

fixes crash on subsequent logins
---
 lib/hx509/ks_p11.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/hx509/ks_p11.c b/lib/hx509/ks_p11.c
index 563e43c..a3e1382 100644
--- a/lib/hx509/ks_p11.c
+++ b/lib/hx509/ks_p11.c
@@ -419,8 +419,6 @@ p11_get_session(hx509_context context,
 	char pin[20];
 	char *str;
 
-	slot->flags |= P11_LOGIN_DONE;
-
 	if (slot->pin == NULL) {
 
 	    memset(&prompt, 0, sizeof(prompt));
@@ -455,7 +453,8 @@ p11_get_session(hx509_context context,
 				       "with error: 0x%08x",
 				       (int)slot->id, ret);
 	    return HX509_PKCS11_LOGIN;
-	}
+	} else
+	    slot->flags |= P11_LOGIN_DONE;
 	if (slot->pin == NULL) {
 	    slot->pin = strdup(pin);
 	    if (slot->pin == NULL) {
-- 
1.5.6.5

Reply via email to