summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <de@gsmk.de>2014-10-07 00:01:30 +0200
committererdgeist <de@gsmk.de>2014-10-07 00:01:30 +0200
commit9816750420eb6ab2527cd8abd31c2b1a13f74437 (patch)
tree73bf0b2a633c566ad3df634f8474640605234134
parent954f5029dfa17734dc408336ef710c192268e8a4 (diff)
Initialise all values of aes key
-rw-r--r--ot_udp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ot_udp.c b/ot_udp.c
index bd84ebb..1d495eb 100644
--- a/ot_udp.c
+++ b/ot_udp.c
@@ -26,9 +26,12 @@ static uint32_t g_key_of_the_hour[2] = {0};
26static ot_time g_hour_of_the_key; 26static ot_time g_hour_of_the_key;
27 27
28static void udp_generate_rijndael_round_key() { 28static void udp_generate_rijndael_round_key() {
29 uint8_t key[16]; 29 uint32_t key[16];
30 key[0] = random(); key[1] = random(); key[2] = random(); key[3] = random(); 30 key[0] = random();
31 rijndaelKeySetupEnc128( g_rijndael_round_key, key ); 31 key[1] = random();
32 key[2] = random();
33 key[3] = random();
34 rijndaelKeySetupEnc128( g_rijndael_round_key, (uint8_t*)key );
32 35
33 g_key_of_the_hour[0] = random(); 36 g_key_of_the_hour[0] = random();
34 g_hour_of_the_key = g_now_minutes; 37 g_hour_of_the_key = g_now_minutes;