Commit 0d3a683a authored by Jakub Jelen's avatar Jakub Jelen Committed by Marc-André Lureau

Do not logout after every applet selection

 * This ammends the b8ebb126 , which was logging out the current user
   on every applet selection, which is more common in CACv2 than in
   the first version.
 * This change issues the logout only before the login is explicitly
   requested, which makes sure the password is properly verified
 * This might need some attention
Signed-off-by: default avatarJakub Jelen <jjelen@redhat.com>
Reviewed-by: default avatarRobert Relyea <rrelyea@redhat.com>
Message-Id: <20180731093551.10562-2-jjelen@redhat.com>
parent 2803c96e
......@@ -253,10 +253,6 @@ vcard_select_applet(VCard *card, int channel, VCardApplet *applet)
{
assert(channel < MAX_CHANNEL);
/* If using an emulated card, make sure to log out of any already logged in
* session. */
vcard_emul_logout(card);
card->current_applet[channel] = applet;
/* reset the applet */
if (applet && applet->reset_applet) {
......
......@@ -396,6 +396,10 @@ vcard_emul_login(VCard *card, unsigned char *pin, int pin_len)
pin_string[i] = 0;
}
/* If using an emulated card, make sure to log out of any already logged in
* session. */
vcard_emul_logout(card);
rv = PK11_Authenticate(slot, PR_FALSE, pin_string);
memset(pin_string, 0, pin_len); /* don't let the pin hang around in memory
to be snooped */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment