Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant time RSA PKCS#1 v1.5 depadding #2948

Merged
merged 8 commits into from
Feb 5, 2024
Prev Previous commit
misc: Compare return value constant-time
  • Loading branch information
xhanulik committed Jan 31, 2024
commit aa6bf2b65fe432e8f234a132268b79ea54d5d74b
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)) {
xhanulik marked this conversation as resolved.
Show resolved Hide resolved
slot->login_user = -1;
pop_all_login_states(slot);
}
Expand Down
Loading