Commit 0e8df275 authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos Committed by Niels Möller
Browse files

_aes_set_key: ensure with assert() that nk is non-zero


Signed-off-by: default avatarNikos Mavrogiannopoulos <nmav@redhat.com>
parent 6b94fa83
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#endif #endif
#include "aes-internal.h" #include "aes-internal.h"
#include <assert.h>
#include "macros.h" #include "macros.h"
void void
...@@ -52,6 +53,7 @@ _aes_set_key(unsigned nr, unsigned nk, ...@@ -52,6 +53,7 @@ _aes_set_key(unsigned nr, unsigned nk,
unsigned lastkey, i; unsigned lastkey, i;
uint32_t t; uint32_t t;
assert(nk != 0);
lastkey = (AES_BLOCK_SIZE/4) * (nr + 1); lastkey = (AES_BLOCK_SIZE/4) * (nr + 1);
for (i=0, rp = rcon; i<nk; i++) for (i=0, rp = rcon; i<nk; i++)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment