Commit Graph

16 Commits

Author SHA1 Message Date
emanuele-f
d76cb64d0f Fix seed debug print 2019-06-03 10:16:42 +02:00
lucaderi
86870a781e Removed PRIx64, a C99 feature 2019-06-03 07:43:49 +02:00
emanuele-f
f33907ebd8 Fix seed debug print on 32bit platforms 2019-06-03 00:40:35 +02:00
emanuele-f
04226c09c8 Fix compilation warnings and little leak 2019-05-21 22:53:55 +02:00
emanuele-f
c89ece71ca Code rework changes
- Remove keyschedule leftover and adapt to new API
- Fix cleanup functions
- Remove unused random_device_mac
2019-04-27 15:55:07 +02:00
emanuele-f
c702ca8686 Move AES IV out of struct sa_aes 2019-04-22 01:24:58 +02:00
emanuele-f
84593a2254 memcpy fix 2019-04-16 02:23:01 +02:00
emanuele-f
bb07f0426e Properly initialize AES IV and hash the AES key
This implements the changes discussed in #68 and #72.
This breaks compatibility with the previous AES implementation.

This also fixes two problems reported by valgrind:

==4887== Invalid write of size 2
==4887==    at 0x483E9DB: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4887==    by 0x10E37F: setup_aes_key (transform_aes.c:378)
==4887==    by 0x10E451: add_aes_key (transform_aes.c:401)
==4887==    by 0x10ED10: transop_aes_setup_psk (transform_aes.c:580)
==4887==    by 0x10A547: main (benchmark.c:92)
==4887==  Address 0x4d574a0 is 0 bytes after a block of size 16 alloc'd
==4887==    at 0x4839B65: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4887==    by 0x10E337: setup_aes_key (transform_aes.c:374)
==4887==    by 0x10E451: add_aes_key (transform_aes.c:401)
==4887==    by 0x10ED10: transop_aes_setup_psk (transform_aes.c:580)
==4887==    by 0x10A547: main (benchmark.c:92)

==13057== Use of uninitialised value of size 8
==13057==    at 0x49023B3: ??? (in /usr/lib/libcrypto.so.1.1)
==13057==    by 0x490346A: AES_cbc_encrypt (in /usr/lib/libcrypto.so.1.1)
==13057==    by 0x11270A: transop_encode_aes (transform_aes.c:230)
==13057==    by 0x10F5CD: send_packet2net (edge_utils.c:1224)
==13057==    by 0x10F813: readFromTAPSocket (edge_utils.c:1278)
==13057==    by 0x1106A8: run_edge_loop (edge_utils.c:1596)
==13057==    by 0x10B9F7: main (edge.c:701)
2019-04-16 02:09:13 +02:00
emanuele-f
50bc1492e2 Remove unnecessary structures in AES encryption
This undoes most of the changes made in 37233553a4 as the problem with the drops was only mitigated.
The actual fix for the dropped packets was in e989f475a1 and the invalid initialization was the root cause
2019-04-12 00:23:20 +02:00
emanuele-f
e989f475a1 Fix invalid initializations 2019-03-28 00:20:16 +01:00
emanuele-f
c71f629d1b Fix encryption key being zeroed by AES initialization 2019-03-26 21:56:02 +01:00
emanuele-f
37233553a4 Fixes packet drops while communicating with multiple nodes in AES PSK
Per-node AES structures must be kept as CBC cannot work with a single structure across multiple nodes
2019-02-20 01:26:18 +01:00
Luca
dcf96a0809 Added #ifdef's for AES 2019-01-28 21:56:38 +01:00
emanuele-f
e4601590aa Add -A option to enable AES CBC psk encryption 2019-01-28 00:27:54 +01:00
Luca Deri
7b07636281 Refreshed copyright and added contributors list 2018-06-06 09:57:31 +02:00
Luca Deri
b1e9ce6d2a Initial SVN import of n2n v2 2016-10-23 10:46:15 +02:00