Skip to content

Commit 3ecd187

Browse files
committed
OCBv3: better taglen limitation
1 parent 3b4d39e commit 3ecd187

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/encauth/ocb3/ocb3_decrypt_verify_memory.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ int ocb3_decrypt_verify_memory(int cipher,
5151
/* default to zero */
5252
*stat = 0;
5353

54+
/* limit taglen */
55+
taglen = MIN(taglen, MAXBLOCKSIZE);
56+
5457
/* allocate memory */
55-
buf = XMALLOC(MIN(taglen, MAXBLOCKSIZE));
58+
buf = XMALLOC(taglen);
5659
ocb = XMALLOC(sizeof(ocb3_state));
5760
if (ocb == NULL || buf == NULL) {
5861
if (ocb != NULL) {

0 commit comments

Comments
 (0)