Skip to content

Commit

Permalink
minidriver set decipher flag SC_ALGORITHM_RSA_RAW
Browse files Browse the repository at this point in the history
Some cards (cardos) may not return the leading zero when deciphering
using RSA RAW. Set flag SC_ALGORITHM_RSA_RAW when calling
sc_pkcs15_decipher like other callers do.

 On branch decipher-missing-leading-00
 Changes to be committed:
	modified:   minidriver/minidriver.c
  • Loading branch information
dengert authored and frankmorgner committed Nov 17, 2023
1 parent 2c40338 commit a229082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/minidriver/minidriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4643,7 +4643,7 @@ DWORD WINAPI CardRSADecrypt(__in PCARD_DATA pCardData,

if (alg_info->flags & SC_ALGORITHM_RSA_RAW) {
logprintf(pCardData, 2, "sc_pkcs15_decipher: using RSA-RAW mechanism\n");
r = sc_pkcs15_decipher(vs->p15card, pkey, opt_crypt_flags, pbuf, pInfo->cbData, pbuf2, pInfo->cbData, NULL);
r = sc_pkcs15_decipher(vs->p15card, pkey, opt_crypt_flags | SC_ALGORITHM_RSA_RAW, pbuf, pInfo->cbData, pbuf2, pInfo->cbData, NULL);
logprintf(pCardData, 2, "sc_pkcs15_decipher returned %d\n", r);

if (r > 0) {
Expand Down

0 comments on commit a229082

Please sign in to comment.