Commit Graph

536 Commits

Author SHA1 Message Date
Hamish Coleman
949c651845 Avoid leaking memory if the buffer is uncompressable 2020-08-27 05:49:12 +10:00
Logan007
fb4a4ee2d8 replaced twofish implementation by a faster version 2020-08-26 20:36:35 +05:45
Logan007
bf6ef081e0 replaced twofish implementation by a faster version 2020-08-26 20:06:40 +05:45
Logan007
d5c1295bec replaced twofish implementation by a faster version 2020-08-26 18:07:05 +05:45
Logan007
b4f9caa00b changed aes transform to cipher text stealing mode 2020-08-25 23:15:32 +05:45
Logan007
680248d154 changed aes transform to cipher text stealing mode 2020-08-24 02:37:06 +05:45
Logan007
6d05d48878 changed aes transform to cipher text stealing mode 2020-08-23 20:02:19 +05:45
Luca Deri
f7f9c98752
Merge pull request #379 from Logan007/reSck
re-open sockets if supernode not responding
2020-08-23 14:16:20 +02:00
Luca Deri
0489c7bbe9
Merge pull request #373 from Logan007/snSd
seeded random number generator in supernode
2020-08-23 14:13:39 +02:00
Luca Deri
9ef2ee6f52
Merge pull request #372 from Logan007/aIp
let auto ip feature handle several sub-networks
2020-08-23 14:13:05 +02:00
Logan007
9554f336d2 re-open sockets if supernode not responding 2020-08-21 01:53:44 +05:45
Logan007
3d00182264 re-open sockets if supernode not responding 2020-08-21 00:53:27 +05:45
Logan007
a35675da4d internally renamed dhcp --> auto ip 2020-08-19 14:46:58 +05:45
Logan007
1dea026fdb seeded random number generator 2020-08-19 00:21:50 +05:45
Logan007
78409df1c8 let auto ip feature handle several sub-networks 2020-08-18 22:35:27 +05:45
fengdaolong
6bdfdf6be4 Enhanced edge management console function.
1. Edge can view the IP address and socket information of the connected tap adapter through the management console (127.0.0.1:5644);
2. Repair two memory leaks;
3. Fix several code errors and redundant logic;
2020-08-16 22:34:41 +08:00
Luca Deri
fbca7bed9e
Merge pull request #365 from Logan007/invldTransopErr
added IP & MAC to invalid transop error message
2020-08-16 12:37:31 +02:00
Luca Deri
ce8551fc61 Added better -A handling with config files 2020-08-16 12:15:30 +02:00
Logan007
b10a24c65a added IP & MAC to invalid transop error message 2020-08-16 15:55:15 +05:45
Luca Deri
0825bfb16b Compilation fixes 2020-08-16 10:46:11 +02:00
Luca Deri
ed5b793379
Merge pull request #363 from Logan007/edgMgmtPrt
extended edge's management port output
2020-08-16 10:37:15 +02:00
Luca Deri
8f9ccce9bf
Merge pull request #360 from Logan007/rpLzo
updated minilzo
2020-08-16 10:36:02 +02:00
Luca Deri
5354cd79d7
Merge pull request #359 from Logan007/pktFlds
split PACKET's transform field to give way for separate compression field
2020-08-16 10:35:44 +02:00
Luca Deri
3be0a009b0
Merge pull request #358 from Logan007/rmMinCryptoVersn
removed minor transform version
2020-08-16 10:35:03 +02:00
Logan007
038c5971b7 extended management port output 2020-08-16 14:02:25 +05:45
Logan007
e0266bfe5f updated minilzo 2020-08-15 23:26:21 +05:45
Logan007
9c10116d51 split PACKET's transform field to give way for seperate compression field 2020-08-15 22:48:57 +05:45
Logan007
c2cae9d02e removed minor tranform version 2020-08-15 21:14:24 +05:45
Logan007
ece0c91ef1 simplified twofish's key handling 2020-08-12 19:59:58 +05:45
Luca Deri
052127734e Merge compilation fix 2020-08-12 14:45:08 +02:00
Luca Deri
d4e9df013e
Merge branch 'dev' into prepReg 2020-08-12 14:41:09 +02:00
Logan007
1d048c59a9 polished reg exp handling and fixed bugs 2020-08-08 22:45:34 +05:45
fengdaolong
92dfa67e22 Added DHCP function embedded in sn.
1. Automatically assign IP addresses to the edge through the DHCP function that comes with sn, the default IP address pool is 172.17.12.0/24.
2. The -d parameter is added to sn, and the IP address pool of the embedded DHCP can be customized.
3. Now edge does not need to add -a and -s parameters to automatically obtain the IP address.
4. The IP automatically obtained by the cross-community edge can be the same, because the communities are isolated from each other and do not interfere with each other.
5. On the management side of sn (127.0.0.1:5645), you can now view the IP address of the tutap adapter of each edge.
6. Fix many bugs that have a certain chance of causing memory leaks.
7. Note: This version is not fully compatible with the previous version.
2020-08-08 22:40:45 +08:00
Logan007
dece8d787e freed reg exp on exit, counted reg exp, warned on empty community list file, returned early from packet handling on non-matching reg exp 2020-08-08 14:51:05 +05:45
Logan007
8ac86635e1 equalized handling of non-matching communities 2020-08-07 20:37:45 +05:45
Logan007
30e2594de9 sharpened condition guarding reg ex loop 2020-08-07 01:21:11 +05:45
Luca Deri
96c05490e9 ompilation fixes 2020-08-06 19:28:39 +02:00
Logan007
fed02348aa guarded ITERation through patterns by if-clause for it only gets performed in case of still unknown community 2020-08-06 16:06:50 +05:45
Logan007
099f178d0e adopted re_match for the sake of completeness, too 2020-08-06 15:59:35 +05:45
Logan007
f7e50e12c0 allowed full matches only 2020-08-06 01:58:09 +05:45
Logan007
e481942bf0 instantiated reg exp pattern 2020-08-06 00:34:17 +05:45
Logan007
1b3e485da6 typo in comment 2020-08-04 19:06:30 +05:45
Logan007
b5b18443af added regular expression checking 2020-08-04 18:49:12 +05:45
Logan007
7311efa35a planned regular expression preparation 2020-08-04 16:09:09 +05:45
Logan007
9fba63dfb4 added per-community locking 2020-08-04 15:46:09 +05:45
Luca Deri
2b59850b77
Merge pull request #346 from skyformat99/fix_edge_register_super
fix register supernode loop - Another way
2020-08-04 10:04:32 +02:00
ygg
e0b48f133d On Windows, the Edge node exits when the network card is disabled and opened again 2020-08-04 13:37:01 +08:00
ygg
f737390dbc fix register supernode loop - Another way 2020-08-04 10:20:43 +08:00
Luca Deri
2ea8dd53b7
Merge pull request #339 from Logan007/cmpMac
added MAC comparison for REGISTER_SUPER_ACK
2020-07-29 14:24:27 +02:00
Luca Deri
5067d22587
Merge pull request #338 from switch-iot/feature_sn_uid_gid
add set uid/gid command option to supernode
2020-07-29 14:24:02 +02:00
Luca Deri
c8bbc251e0
Merge pull request #337 from Logan007/mvDef
moved some #DEFs to central n2n_define.h
2020-07-29 14:19:14 +02:00
Logan007
d28f476b17 added MAC comparison for REGISTER_SUPER_ACK 2020-07-29 17:41:22 +05:45
switch_st
7285f2a1bc add set uid/gid command option to supernode 2020-07-29 18:30:32 +08:00
Logan007
3549936b48 moved some #DEFs to n2n_define.h 2020-07-29 15:32:04 +05:45
ygg
62b3957cfb Hide the duplicate trace message 2020-07-29 13:50:00 +08:00
ygg
64857218a5 Indicates successful connection between the edge and SN nodes 2020-07-29 13:24:36 +08:00
Luca Deri
c5fe6201c0
Merge pull request #332 from Logan007/snSortCmn
sorting encrypted communities
2020-07-28 19:29:01 +02:00
Luca Deri
f02a5c91c6
Merge pull request #331 from Logan007/rndSeedLoop
retrying syscall and calls to hardware random number generators
2020-07-28 19:28:26 +02:00
Logan007
75317acaf3 added sorting of encrypted communities 2020-07-28 00:55:07 +05:45
Logan007
dc9b1449ab retrying syscall and calls to hardware rng 2020-07-27 20:55:36 +05:45
ygg
a81f4054cd Adds a trace message to mark connection type between edges. 2020-07-27 15:01:55 +08:00
Luca Deri
4e592dd82e Minor cleanup 2020-07-27 07:02:11 +02:00
Luca Deri
e635926d2c
Merge branch 'dev' into rp 2020-07-27 06:57:36 +02:00
Luca Deri
1284e5662c
Merge pull request #325 from switch-iot/feature_sn_mgmt_port
add management port command option to supernode
2020-07-27 06:55:52 +02:00
Luca Deri
ea01c45582
Merge pull request #324 from switch-iot/fix_build_warning
fix build warning of edge_init_routes
2020-07-27 06:55:14 +02:00
Luca Deri
ceace349c6
Merge pull request #322 from switch-iot/fix_sn_purge_cmnt
Update purge logic of communities and edges for supernode
2020-07-27 06:54:53 +02:00
Luca Deri
c21d2f47c6
Merge pull request #320 from switch-iot/fix_sn_mgmt_core
fix supernode coredump when accessing management socket
2020-07-27 06:53:58 +02:00
Logan oos Even
5ceb839b63
Merge branch 'dev' into rp 2020-07-25 18:54:33 +05:45
Logan007
0776e06912 added replay protection 2020-07-25 18:13:20 +05:45
switch_st
40f39caaac change the management port command order 2020-07-24 11:52:44 +08:00
switch_st
d59b977840 add management port command option to supernode 2020-07-24 11:23:12 +08:00
Logan007
b976379125 added data structures for replay protection 2020-07-23 20:34:54 +05:45
Logan007
895bbc2844 added time stamp blending and sending 2020-07-23 16:06:54 +05:45
switch_st
ca804b3a55 fix build warning of edge_init_routes 2020-07-23 10:05:29 +08:00
Logan007
d3e823af98 removed branchless code 2020-07-23 02:17:08 +05:45
Logan007
36eb807fca added time stamp handling functions 2020-07-23 01:55:02 +05:45
Luca Deri
235f55bda5 Compilation fixes 2020-07-22 16:01:54 +02:00
Luca Deri
8d76e7e576
Merge pull request #321 from switch-iot/fix_sn_daemon
fix build error for supernode when declared N2N_HAVE_DAEMON
2020-07-22 12:13:23 +02:00
Luca Deri
4939403fec
Merge pull request #319 from switch-iot/fixlog
close syslog in function closeTraceFile
2020-07-22 12:12:02 +02:00
Luca Deri
b17719383f
Merge pull request #318 from switch-iot/hin2n_arp
add main loop callback and move android arp code to this callback
2020-07-22 12:11:30 +02:00
switch_st
4d88fef4e2 update log word in sendto_mgmt 2020-07-22 17:18:00 +08:00
switch_st
81516d8d8c Update purge logic of communities and edges for supernode 2020-07-22 15:49:45 +08:00
switch_st
37bc520db2 fix supernode coredump when accessing management socket 2020-07-22 13:41:48 +08:00
switch_st
e24ad06a24 fix build error for supernode when declared N2N_HAVE_DAEMON 2020-07-22 12:15:56 +08:00
Logan007
252ce9779a moved windows-gettimeofday() from benchmark.c to n2n.c 2020-07-21 19:11:31 +05:45
switch_st
a149fa9404 close syslog in function closeTraceFile 2020-07-21 15:37:39 +08:00
switch_st
72701a5e83 add main loop callback and move android arp code to this callback 2020-07-21 15:04:16 +08:00
ygg
07c1e40416 add -n option (route) for windows 2020-07-21 11:38:22 +08:00
Luca Deri
0ab9f3229e
Merge pull request #315 from switch-iot/hin2n_arp
delete android define and log code
2020-07-20 17:15:04 +02:00
Luca Deri
7d573823e7
Merge pull request #313 from fengdaolong/dev
Clean up redundant code in sn.c
2020-07-20 17:13:48 +02:00
switch_st
8a1bcf0fa6 close trace file if needed 2020-07-20 12:08:13 +08:00
switch_st
21122df969 delete android define and log code 2020-07-20 11:13:46 +08:00
fengdaolong
485cab2afa Fix pointer assignment error 2020-07-18 19:52:41 +08:00
fengdaolong
16b1c7c065 Clean up redundant code in sn.c
Clean up redundant code contained in both sn.c and sn_utils.c
2020-07-18 17:17:30 +08:00
ygg
e6c851d276 add sleep() for fix compile error on windows 2020-07-17 14:21:27 +08:00
switch_st
7ceaebade5 move android arp code to tuntap_android.c 2020-07-07 10:51:21 +08:00
Luca Deri
26e0f787d1
Merge pull request #304 from fengdaolong/dev
Fix read tap device failed when OS wake up from sleep.
2020-07-06 10:33:11 +02:00
Luca Deri
1125d7f368
Merge pull request #301 from Logan007/macMgmt
added MAC to management port output
2020-07-06 10:27:45 +02:00
fengdaolong
51c889ddea Fix read tap device failed when OS wake up from sleep.
Adjust the structure of the source file to the header file.
2020-07-06 13:17:01 +08:00
Logan007
6fc9890e55 added MAC to management port output 2020-07-04 18:42:20 +05:45
Logan007
65be75dbe2 enabled packet checksum 2020-07-04 15:10:58 +05:45
Luca Deri
da870876c8
Merge pull request #297 from switch-iot/hin2n_arp
Change n2n_edge_callbacks payload_size parameter to pointer.
2020-07-03 09:17:46 +02:00
switch_st
e7ac9cf129 change n2n_edge_callbacks payload_size parameter to pointer. 2020-07-03 11:50:47 +08:00
Logan007
a84d03a6a6 quick fix for header encryption, also disabling checksum check 2020-07-03 02:26:39 +05:45
Luca Deri
f7ea8eba21
Merge pull request #294 from Logan007/regPayload
no payload with REGISTER
2020-07-02 17:19:10 +02:00
Luca Deri
4a08411fe9
Merge pull request #292 from Logan007/pearsonUpdate
pearson hashing: added optional 16-bit look-up table
2020-07-02 17:18:34 +02:00
Luca Deri
edc48acb83
Merge pull request #290 from emanuele-f/protect_cleanup
Move android code to hin2n
2020-07-02 17:17:44 +02:00
Luca Deri
efa8c8a036
Merge pull request #289 from fengdaolong/dev
Fix cmake compilation errors.
2020-07-02 17:16:18 +02:00
Logan007
8fb553ab03 initialized hash in sn, too 2020-07-02 19:08:33 +05:45
Logan007
eaa1acb543 no payload with REGISTER 2020-07-02 18:02:16 +05:45
Logan007
8d0c52102c added optional 16-bit look-up table 2020-07-02 12:49:25 +05:45
emanuele-f
e42837c3fb Move android code to hin2n 2020-07-01 16:27:08 +02:00
fengdaolong
f5accc8221 Fix cmake compilation errors.
1. CMakeLists.txt added to automatically obtain the revised version number from the git repository.
2. Adjusted some header files to fix Windows platform compilation errors.
3. Eliminate some compilation warnings.
2020-07-01 18:35:22 +08:00
emanuele-f
33dd97c798 Terminate n2n as soon as the stop command is received 2020-07-01 12:05:19 +02:00
Luca Deri
a2a817b1a7
Merge pull request #286 from emanuele-f/sendto_fix
Fix invalid sendto when supernode name resolution fails
2020-07-01 11:44:19 +02:00
lucaderi
2cf63fb90d Compilation fix 2020-07-01 11:22:06 +02:00
emanuele-f
4e97023b95 Fix invalid sendto when supernode name resolution fails
Even though the supernode resolution failed, sendto was called with
and invalid socket, resulting in the following error:

ERROR: sendto failed (13) Permission denied
2020-07-01 11:16:34 +02:00
Logan007
49a5823b9c call lzo_init() only if required 2020-07-01 02:21:54 +05:45
Luca Deri
cf65d9ad98
Merge pull request #282 from emanuele-f/n2n_callbacks
Add the callbacks API
2020-06-30 16:36:11 +02:00
Luca Deri
9dd0387d36
Merge pull request #279 from Logan007/checksum
Packet Checksum
2020-06-30 16:35:28 +02:00
Disconnect3d
c2442ae486
edge.c: fix incorrect bad gateway check
It seems the previous `route.net_addr == INADDR_NONE` check was incorrect and was probably a result of copy-pasting the previous if statement and not changing the condition.
2020-06-30 14:16:54 +02:00
emanuele-f
346631ffe8 Add the callbacks API
Callbacks allow n2n API users to extend n2n without modifying the upstream code. This also allows us
to move the hin2n code, which is specific of android, out of the n2n repository.
2020-06-30 13:01:37 +02:00
Logan007
0e0d662dbb added decryption step 2020-06-29 19:20:40 +05:45
Logan007
e8d5e939a7 added encryption step 2020-06-29 16:49:54 +05:45
Logan007
033b1890f2 blended checksum into header iv 2020-06-29 16:31:44 +05:45
Logan007
a6915fd6af prepared header iv encryption handling 2020-06-29 15:50:05 +05:45
Logan007
a64cfa450e added 16-bit hashing 2020-06-29 15:44:51 +05:45
Logan007
c7a8210078 added 96 bit block size for header iv encryption 2020-06-29 15:13:36 +05:45
Luca Deri
c6b7b67a6a Minor cleanup 2020-06-28 21:30:40 +02:00
emanuele-f
f5804db2b0 Android compilation fixes 2020-06-28 19:46:12 +02:00
emanuele-f
0b4d36f7bd Merge remote-tracking branch 'origin/dev' into hin2n_android 2020-06-28 17:52:21 +02:00
Logan007
1caf3b4591 shortened help text by three lines 2020-06-24 15:15:42 +05:45
Luca Deri
1a5d753b98 Warning fix 2020-06-24 09:49:36 +02:00
Logan007
789dd90272 Header Encryption 2020-06-23 00:34:19 +05:45
Luca Deri
0bf7ae0a01 Minor code claanup 2020-06-21 22:33:28 +02:00
Luca Deri
3eb82b2a32 Code reorganization 2020-06-21 22:26:27 +02:00