Skip to content

Commit 7aeffa2

Browse files
committed
fix silabs_ecc_sign_hash buffer validation
1 parent 0b2a9d3 commit 7aeffa2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

wolfcrypt/src/port/silabs/silabs_ecc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ int silabs_ecc_sign_hash(const byte* in, word32 inlen, byte* out,
108108
return BAD_FUNC_ARG;
109109

110110
slkey = &key->key;
111-
siglen = *outlen;
111+
siglen = key->dp->size * 2;
112112

113-
if ((int)siglen >= key->dp->size * 2) {
114-
siglen = key->dp->size * 2;
113+
if (*outlen < siglen) {
114+
return BUFFER_E;
115115
}
116116

117117
#if (_SILICON_LABS_SECURITY_FEATURE == _SILICON_LABS_SECURITY_FEATURE_VAULT)

0 commit comments

Comments
 (0)