ocb3: check the length of the nonce
This commit is contained in:
parent
b2448c593a
commit
1aaa5abb33
@ -56,6 +56,12 @@ int ocb3_init(ocb3_state *ocb, int cipher,
|
|||||||
}
|
}
|
||||||
ocb->cipher = cipher;
|
ocb->cipher = cipher;
|
||||||
|
|
||||||
|
/* Valid Nonce?
|
||||||
|
* As of RFC7253: "string of no more than 120 bits" */
|
||||||
|
if (noncelen > (120/8)) {
|
||||||
|
return CRYPT_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
/* determine which polys to use */
|
/* determine which polys to use */
|
||||||
ocb->block_len = cipher_descriptor[cipher].block_length;
|
ocb->block_len = cipher_descriptor[cipher].block_length;
|
||||||
x = (int)(sizeof(polys)/sizeof(polys[0]));
|
x = (int)(sizeof(polys)/sizeof(polys[0]));
|
||||||
|
Loading…
Reference in New Issue
Block a user