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:
1 parent
d0ed107910
commit
ef31254d34
1 file changed
+4
@@ -53,6 +53,10 @@ METHOD(iv_gen_t, get_iv, bool,
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (size < sizeof(u_int64_t))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (this->prev != SEQ_IV_INIT_STATE && seq <= this->prev)
|
||||
{
|
||||
return FALSE;
|
||||
|
||||
Reference in new issue
Block a user