OCBv3: better taglen limitation
This commit is contained in:
parent
3b4d39ea45
commit
3ecd18763b
@ -51,8 +51,11 @@ int ocb3_decrypt_verify_memory(int cipher,
|
||||
/* default to zero */
|
||||
*stat = 0;
|
||||
|
||||
/* limit taglen */
|
||||
taglen = MIN(taglen, MAXBLOCKSIZE);
|
||||
|
||||
/* allocate memory */
|
||||
buf = XMALLOC(MIN(taglen, MAXBLOCKSIZE));
|
||||
buf = XMALLOC(taglen);
|
||||
ocb = XMALLOC(sizeof(ocb3_state));
|
||||
if (ocb == NULL || buf == NULL) {
|
||||
if (ocb != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user