Skip to content

Commit

Permalink
misc: Compare return value constant-time
Browse files Browse the repository at this point in the history
  • Loading branch information
xhanulik committed Jan 31, 2024
1 parent 306dc92 commit aa6bf2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pkcs11/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>

#include "common/constant-time.h"
#include "sc-pkcs11.h"

#define DUMP_TEMPLATE_MAX 32
Expand Down Expand Up @@ -174,7 +175,7 @@ CK_RV reset_login_state(struct sc_pkcs11_slot *slot, CK_RV rv)
slot->p11card->framework->logout(slot);
}

if (rv == CKR_USER_NOT_LOGGED_IN) {
if (constant_time_eq_s(rv, CKR_USER_NOT_LOGGED_IN)) {
slot->login_user = -1;
pop_all_login_states(slot);
}
Expand Down

0 comments on commit aa6bf2b

Please sign in to comment.