Commit Graph

129 Commits

Author SHA1 Message Date
Andy Wang 4a81683e44 Code cleanup and move stuff around 2020-04-14 14:14:51 +01:00
Andy Wang 5d4e8b8d8d Refactor udp piping and add tests 2020-04-11 22:37:15 +01:00
Andy Wang 93cf6dec6e Export fields for testing 2020-04-10 14:09:48 +01:00
Andy Wang d53b80208f Refactor for easier testing 2020-04-10 11:07:38 +01:00
Andy Wang e5bda61587 Close connections properly 2020-04-09 23:52:08 +01:00
Andy Wang 254b7152b6 Fix tests 2020-04-09 22:21:02 +01:00
Andy Wang 444182f5bb Purge impurity 2020-04-09 22:11:12 +01:00
Andy Wang e41394c83c Set frame size limit through multiplexer 2020-04-09 16:37:46 +01:00
Andy Wang 97858197cd Move common types to its own package 2020-04-09 00:39:40 +01:00
Andy Wang 86095ba5e6 Refactor out Dialer 2020-04-09 00:34:02 +01:00
Andy Wang 2400a33818 Remove extra imports 2020-04-08 22:17:08 +01:00
Andy Wang 7e9fe952aa Move code around for clarity 2020-04-08 22:07:11 +01:00
Andy Wang 7bfae8accd Refactor client side transport (breaks server) 2020-04-08 20:53:09 +01:00
Andy Wang dc2b1124cb move function out of util 2020-04-08 16:34:20 +01:00
Andy Wang 545164a300 Make send/receive buffer sizes configurable 2020-04-08 15:07:35 +01:00
Andy Wang 01e5d15d20 Code cleanup 2020-04-08 12:18:20 +01:00
Andy Wang 963dae829d Fix tests 2020-04-07 21:19:40 +01:00
Andy Wang c1f3408c2c Make key lengths explicit 2020-04-07 21:15:28 +01:00
Andy Wang 903a413afc Update test 2020-04-06 13:14:11 +01:00
Andy Wang 25e41d0941 Allow UDP option to be set in both commandline and json 2020-04-06 13:11:19 +01:00
Andy Wang a163f066a6 Refactor client config 2020-04-06 13:07:16 +01:00
Andy Wang 8d84ebd145 Code styles 2020-04-05 00:56:43 +01:00
notsure2 2de034ec92 Make keepalive optional on client -> server and server -> proxy connections. Use KeepAlive value in config (seconds). 2020-04-04 15:32:19 +01:00
Andy Wang 2327420f75 Allow remote host to be set in the client config file 2020-04-04 00:43:06 +01:00
beans 23082aff4f Allow RemotePort to be optionally set in JSON. If it's not set in JSON, Cloak falls back to SS_REMOTE_PORT in SS mode, or the -p argument in standalone 2020-02-14 21:57:57 +00:00
Andy Wang 517a6d6e57 Handle error and retry for Crypto.rand 2020-02-01 23:46:46 +00:00
Andy Wang bc5ce842a0 Refactor makeAuthenticationPayload to allow easier tests 2020-01-25 10:19:45 +00:00
Andy Wang abc39e4e90 Refactor authentication data representations 2020-01-24 16:44:29 +00:00
Andy Wang f90ad52455 Add default stream timeout value to client 2020-01-23 20:31:08 +00:00
Andy Wang 65553f4ec4 Remove redundant base64 decoding 2019-12-29 16:55:21 +00:00
Andy Wang eec295a00e Remove unnecessary pointer value 2019-09-15 21:33:35 +01:00
Andy Wang 98b77afb91 websocket over TLS 2019-09-02 14:03:10 +01:00
Andy Wang 339b324946 Working direct WebSocket transport 2019-09-01 20:23:45 +01:00
Andy Wang f47f57a59f Direct WebSocket 2019-09-01 01:33:34 +01:00
Andy Wang a3c3c5dc07 Client side plain websocket 2019-08-31 18:01:39 +01:00
Andy Wang 46c02d17f4 Refactor InitState 2019-08-20 22:48:01 +01:00
Andy Wang 87a7684e10 More comments 2019-08-20 22:43:04 +01:00
Andy Wang eabe113547 Add Stream Timeout 2019-08-19 23:23:41 +01:00
Andy Wang 812ca1af99 Unexport some client.State fields 2019-08-17 00:18:19 +01:00
Andy Wang b98a74f49b Refactor client ClientHello composition 2019-08-17 00:16:31 +01:00
Andy Wang e28df86a55 Move Unordered field around 2019-08-16 23:20:24 +01:00
Andy Wang c36ec04ce5 Add unordered mode 2019-08-14 11:56:55 +01:00
Qian Wang f65a46f4a9 Remove unnecessary state variable IsAdmin 2019-08-12 14:25:24 +01:00
Qian Wang ae4fc917b6 Let the server send a mock encrypted certificate after ChangeCipherSuite to imitate real behaviour more closely 2019-08-07 00:28:08 +01:00
Qian Wang 1d878b3adb Use AEAD to encrypt session key in ServerHello to provide authentication of the identity of the server 2019-08-06 23:59:29 +01:00
Qian Wang e15536d7c7 Refactor TLS handshake 2019-08-06 15:50:33 +01:00
Qian Wang e0e33e12d6 Fix non random GREASE generation 2019-08-02 20:06:41 +01:00
Qian Wang 05972863b5 Add tests 2019-08-02 20:06:28 +01:00
Qian Wang 53b6b96262 Remove stupid code 2019-08-02 18:03:08 +01:00
Qian Wang 429da0e0d9 Add unit tests 2019-08-02 18:00:27 +01:00
Qian Wang e75c713385 Refactor session struct's obfs fields 2019-08-02 16:37:48 +01:00
Qian Wang 1a628cb524 Refactor client TLS 2019-08-02 16:02:25 +01:00
Qian Wang 726a405a26 TLS1.3 2019-08-02 01:01:19 +01:00
Qian Wang 0684f5df40 Refactor payload cipher 2019-08-01 00:43:33 +01:00
Qian Wang 0fbb6011fc Remove psudorandom padding 2019-07-31 23:58:15 +01:00
Qian Wang 059a222394 Use defer to unlock mutexes 2019-07-28 12:52:57 +01:00
Qian Wang 1099b558f1 Fix admin mode 2019-07-27 19:55:53 +01:00
Qian Wang 38f3a4a522 Only start a session after a local connection has been made 2019-07-26 23:12:38 +01:00
Qian Wang 75fecacd20 Change the protocol to solve sessionTicket inconsistency 2019-07-26 17:05:46 +01:00
Qian Wang 710fa6835a Reduce the size of UID to 16 bytes 2019-06-16 11:08:51 +10:00
Qian Wang d781c7b1be Use a sessional ephemeral key as the main key instead of UID for forward security 2019-06-16 00:20:55 +10:00
Qian Wang 589900fe52 I just did a joint and I need to commit before things go wrong 2019-06-14 23:08:28 +10:00
Qian Wang 00069b7a69 Support Chaha20-Poly1305 2019-06-14 20:26:26 +10:00
Qian Wang 8168b9e2e7 Use AES-GCM instead of CTR 2019-06-10 00:03:28 +10:00
Qian Wang 0dd52d8570 Add optional encryption 2019-06-09 21:05:41 +10:00
Qian Wang 3e9855191b Cloak 2: generalising cloak as a universal pluggable transport for arbitary proxies 2019-06-09 16:10:22 +10:00
Qian Wang 99afb1a58b Remove ECDH as an external dependancy and include it as a internal package 2019-01-25 00:24:47 +00:00
Qian Wang c44b202c27 Regenerate SessionID on reconnection 2019-01-22 21:51:57 +00:00
Qian Wang 8a10949846 Add unit tests 2019-01-20 23:47:10 +00:00
Qian Wang 59c18437e4 Fix a race regarding client keyPairs caching 2019-01-01 14:37:47 +00:00
Qian Wang 6fbd39ea10 Integrate keygen util into ck-server 2018-12-17 22:12:38 +00:00
Qian Wang 304f7f38a7 Redo config format 2018-12-03 20:30:06 +00:00
Qian Wang 239647c5b2 Fix a race, some cleanup 2018-11-24 00:55:26 +00:00
Qian Wang 3534d05055 QOS and user managing, bug fixes 2018-11-07 21:16:13 +00:00
Qian Wang 0db52a8a26 General improvements 2018-10-23 20:47:58 +01:00
Qian Wang a8786a5576 Use ECDH instead of ECIES 2018-10-14 20:32:54 +01:00
Qian Wang b9f2aa4ed0 Barely working 2018-10-09 21:53:55 +01:00
Qian Wang ae30ed6ba4 Untested server 2018-10-09 16:07:54 +01:00
Qian Wang 3fd7e01566 Untested client 2018-10-07 18:09:45 +01:00