mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-06-18 20:35:57 +02:00
Fix SM verification for long messages.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -229,7 +229,7 @@ void sm_update_iv() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int sm_verify() {
|
int sm_verify() {
|
||||||
uint8_t input[1024];
|
uint8_t input[4096];
|
||||||
memset(input, 0, sizeof(input));
|
memset(input, 0, sizeof(input));
|
||||||
uint16_t input_len = 0;
|
uint16_t input_len = 0;
|
||||||
int r = 0;
|
int r = 0;
|
||||||
@@ -238,7 +238,7 @@ int sm_verify() {
|
|||||||
if (data_len % sm_blocksize) {
|
if (data_len % sm_blocksize) {
|
||||||
data_len += sm_blocksize;
|
data_len += sm_blocksize;
|
||||||
}
|
}
|
||||||
if (data_len + (add_header ? sm_blocksize : 0) > 1024) {
|
if (data_len + (add_header ? sm_blocksize : 0) > 4096) {
|
||||||
return CCID_WRONG_LENGTH;
|
return CCID_WRONG_LENGTH;
|
||||||
}
|
}
|
||||||
mbedtls_mpi ssc;
|
mbedtls_mpi ssc;
|
||||||
|
|||||||
Reference in New Issue
Block a user