don't set P11_LOGIN_DONE before we're logged in

fixes crash on subsequent logins

From: Guido Günther.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23858 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-09-22 06:32:15 +00:00
parent f31067f2fc
commit 8d59ecffe5

View File

@@ -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,9 @@ 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) {