Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   libopensc/pkcs15-piv.c
	modified:   minidriver/minidriver.c
  • Loading branch information
dengert committed Jun 8, 2024
1 parent 01c418a commit 04826a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/libopensc/pkcs15-piv.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,6 @@ static int sc_pkcs15emu_piv_init(sc_pkcs15_card_t *p15card)
&pin_ref) == 0 &&
pin_ref == 0x00) { /* must be 80 for PIV pin, or 00 for Global PIN */
pin_info.attrs.pin.reference = pin_ref;
pin_info.attrs.pin.flags &= ~SC_PKCS15_PIN_FLAG_LOCAL;
label = "Global PIN";
}
strncpy(pin_obj.label, label, SC_PKCS15_MAX_LABEL_SIZE - 1);
Expand Down
7 changes: 5 additions & 2 deletions src/minidriver/minidriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ typedef struct _VENDOR_SPECIFIC
BYTE allocatedAgreements;

/* if any key used with the MD_ROLE_USER_SIGN has user_consent set PinCacheAlwaysPrompt */
BYTE need_pin_always;
int need_pin_always;

CRITICAL_SECTION hScard_lock;
} VENDOR_SPECIFIC;
Expand Down Expand Up @@ -1892,8 +1892,10 @@ md_set_cmapfile(PCARD_DATA pCardData, struct md_file *file)
" (default)" : "");

/* set flag that at least one key that uses the sign key needs PinCacheAlwaysPrompt */
logprintf(pCardData, 7, "key_obj->user_consent: %d\n", (int) key_obj->user_consent);
if (key_obj->user_consent)
vs->need_pin_always = 1;
logprintf(pCardData, 7, "vs->need_pin_always %d\n", (int) vs->need_pin_always);

if (pin_mode < pin_mode_n) {
pin_mode = pin_mode_n;
Expand Down Expand Up @@ -6487,9 +6489,10 @@ DWORD WINAPI CardGetProperty(__in PCARD_DATA pCardData,
p->PinPurpose = PrimaryCardPin;
}
else if (dwFlags == MD_ROLE_USER_SIGN) {
logprintf(pCardData, 7, "vs->need_pin_always %d\n", (int) vs->need_pin_always);
if (vs->need_pin_always) {
p->PinCachePolicy.PinCachePolicyType = PinCacheAlwaysPrompt;
logprintf(pCardData, 7, "Setting PinCacheAlwaysPrompt\n)";
logprintf(pCardData, 7, "Setting PinCacheAlwaysPrompt\n");
}
else
p->PinCachePolicy.PinCachePolicyType = PinCacheNormal;
Expand Down

0 comments on commit 04826a2

Please sign in to comment.