Commit Graph

31 Commits

Author SHA1 Message Date
Luca Deri
80bd0a41f4
Merge pull request #236 from Logan007/staticErrOut
transform_aes.c -- make openssl_err_as_string() static
2020-05-09 00:22:05 +02:00
Logan007
0ff7eac6fc made openssl_err_as_string static to avoid conflicts with other ciphers that would also use their own function - those can't rely on the AES module being there 2020-04-26 20:41:28 +02:00
Logan007
453489b1e8 fixed typo 2020-04-25 23:55:14 +02:00
Logan007
20847c0063 fixed typo 2020-04-25 23:46:50 +02:00
Luca Deri
8b8e3ed3ee Updated OpenSSL checks 2020-04-24 08:45:33 +02:00
Luca Deri
1cc4996ef3 Added comparibility with OpenSSL 1.0 2020-04-24 08:21:12 +02:00
Luca Deri
97c8948113 MacOS fixes 2020-04-24 00:36:32 +02:00
Logan007
fb1dfdbdf2 reused evp context 2020-03-30 11:48:48 +02:00
Logan007
7712279a8a fixed one more typo 2020-03-26 10:12:30 +01:00
Logan007
e0741a5912 added additional length check after evp-en/decryption 2020-03-26 09:44:03 +01:00
Logan007
8649de7a16 made use of openssl's evp interface to achieve better hardware acceleration for AESed payload 2020-03-20 16:24:51 +01:00
emanuele-f
bf0ad28b4b Update openwrt readme 2019-07-07 00:46:25 +02:00
emanuele-f
7cc73aec62 Add support for libcrypto headers 2019-07-06 23:38:49 +02:00
Logan008
47a298cb4d AES: remove obsolete fields sa and nonce (#152)
* removed obsolete fields for nonce and sa
2019-06-30 21:32:40 +00:00
Logan008
bc260c2312 optimization to flexible AES keysize depending on input key size 2019-06-30 17:03:03 +02:00
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