iv-gen: Fail getting shorter IV values than the used counter size
While no algorithm actually uses such short IVs, we add a check here to ensure we won't return just the lower bits of the counter.
This commit is contained in:
committed by
Andreas Steffen
parent
d0ed107910
commit
ef31254d34
@@ -53,6 +53,10 @@ METHOD(iv_gen_t, get_iv, bool,
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
if (size < sizeof(u_int64_t))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
if (this->prev != SEQ_IV_INIT_STATE && seq <= this->prev)
|
if (this->prev != SEQ_IV_INIT_STATE && seq <= this->prev)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
Reference in New Issue
Block a user