mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-04-26 10:52:58 +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() {
|
||||
uint8_t input[1024];
|
||||
uint8_t input[4096];
|
||||
memset(input, 0, sizeof(input));
|
||||
uint16_t input_len = 0;
|
||||
int r = 0;
|
||||
@@ -238,7 +238,7 @@ int sm_verify() {
|
||||
if (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;
|
||||
}
|
||||
mbedtls_mpi ssc;
|
||||
|
||||
Reference in New Issue
Block a user