Skip to content

Commit 17d476a

Browse files
committed
Fix crash on PIN change.
Signed-off-by: Pol Henarejos <[email protected]>
1 parent 2e70af6 commit 17d476a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/openpgp/openpgp.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ static int cmd_put_data() {
10211021
if (!tf) {
10221022
return SW_REFERENCE_NOT_FOUND();
10231023
}
1024-
uint8_t def[IV_SIZE + 32 + 32 + 32];
1024+
uint8_t def[IV_SIZE + 32 + 32 + 32 + 32];
10251025
memcpy(def, file_get_data(tf), file_get_size(tf));
10261026
hash_multi(apdu.data, apdu.nc, session_rc);
10271027
memcpy(def + IV_SIZE + 32, dek + IV_SIZE, 32);
@@ -1066,7 +1066,7 @@ static int cmd_change_pin() {
10661066
if (!tf) {
10671067
return SW_REFERENCE_NOT_FOUND();
10681068
}
1069-
uint8_t def[IV_SIZE + 32 + 32 + 32];
1069+
uint8_t def[IV_SIZE + 32 + 32 + 32 + 32];
10701070
memcpy(def, file_get_data(tf), file_get_size(tf));
10711071
if (P2(apdu) == 0x81) {
10721072
hash_multi(apdu.data + pin_len, apdu.nc - pin_len, session_pw1);
@@ -1125,7 +1125,7 @@ static int cmd_reset_retry() {
11251125
if (!tf) {
11261126
return SW_REFERENCE_NOT_FOUND();
11271127
}
1128-
uint8_t def[IV_SIZE + 32 + 32 + 32];
1128+
uint8_t def[IV_SIZE + 32 + 32 + 32 + 32];
11291129
memcpy(def, file_get_data(tf), file_get_size(tf));
11301130
hash_multi(apdu.data + (apdu.nc - newpin_len), newpin_len, session_pw1);
11311131
memcpy(def + IV_SIZE, dek + IV_SIZE, 32);

0 commit comments

Comments
 (0)