Skip to content

Commit

Permalink
Allow len < 16 for aes256-gcm encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
James-ZHANG committed Oct 14, 2024
1 parent 5c7ed8f commit 280486c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/aes256.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ aes256_gcm(const fido_blob_t *key, const fido_blob_t *nonce,
nonce->len, key->len, aad->len);
goto fail;
}
if (in->len > UINT_MAX || in->len > SIZE_MAX - 16 || in->len < 16) {
if (in->len > UINT_MAX || in->len > SIZE_MAX - 16) {
fido_log_debug("%s: invalid input len %zu", __func__, in->len);
goto fail;
}
if (!encrypt && in->len < 16) {
fido_log_debug("%s: invalid input len %zu", __func__, in->len);
goto fail;
}
Expand Down

0 comments on commit 280486c

Please sign in to comment.