Commit Graph

25 Commits

Author SHA1 Message Date
bac2c33aee First attempt at implementing remote TCP port binding. 2021-12-20 20:40:25 -08:00
3737d0739d Get TCP forwarding working with itself and an external client.
As it happens, this is a pretty major change, because I misunderstood
how the protocol actually works. Rather than having a single core
command channel and then a series of offshoots, SOCKSv5 does a separate
handshake for each individual command, and then uses the command stream
as a data stream. So ... whoops. So now the `SOCKSv5Server` sits on a
listener, instead, and farms each of the connections out to a task.
2021-11-21 21:18:55 -08:00
74f66ef747 Add a separate trait for converting errors into server responses. 2021-11-21 21:18:44 -08:00
774591cb54 Whoops! Missed a reserved byte in client requests. 2021-11-21 21:18:39 -08:00
c05b0f2b74 Wire up, and add a test for, connecting via a client through a proxy server. 2021-11-21 21:18:28 -08:00
abff1a4ec1 Remove a duplicated firewall check. 2021-11-21 21:18:21 -08:00
ac11ae64a8 Add a test that our little mini-firewall works as intended. 2021-11-21 21:18:07 -08:00
67b2acab25 Add support for knowing when the write end of a testing stream drops the reference, and then triggering errors on the read side. 2021-11-21 21:17:59 -08:00
58c04adeb7 Merge pull request #1 from acw/feature/github-actions
Integrate some CI into this project, to see how it works on GitHub.
2021-10-29 20:56:22 -07:00
71637f6d37 Integrate some CI into this project, to see how it works on GitHub. 2021-10-29 20:49:56 -07:00
fe630bb29d Clean up some clippy warnings. 2021-10-14 20:36:19 -07:00
e319dda2a8 Further testing, especially of username/password checks. 2021-10-09 18:55:24 -07:00
fbd98a5f9b A significant clean-up of the server authentication phase, with a basic test.
The prior implementation involved some (moderately awkward) layered
`match` expressions; this version skips those in favor of `?`. The cost
is a little less detail about (for example) when serialization errors
happen. On the bright side, it gains us some huge improvements in code
clarity. We might be able to get back the tracing later, with other
library support.

In addition, we know have a couple tests: one to make sure we choose the
authentication method appropriately, and a very basic handshake test for
when we're not actually negotiation a username and password.
2021-10-09 18:40:00 -07:00
3364031c18 Whoops! TCP streams are dual-buffered!
This adjusts the way that TestingStream is implemented to allow for
two, separate buffers for each of the two directions. In the prior
implementation, if you called `write` and then `read`, you would
`read` the data you just wrote. Which is not what you want; you want
to block until you get data back from the other side.
2021-10-09 18:31:48 -07:00
748dc33a36 Rid ourselves of the old Network trait. 2021-10-09 15:24:51 -07:00
0d35f1cdb3 Remove a bunch of (hopefully) unnecessary Pins.
I believe these were introduced previously to solve a problem that we're
no longer dealing with; specifically, if I remember correctly, we
introduced these to deal with how we were going to implement a trait.
However, they don't appear to be necessary any more, so we're going to
get rid of them, so we won't need to deal with them any longer.
2021-10-09 15:22:10 -07:00
a2c57e4c76 Add a prototype testing network stack, that requires no actual network connection. 2021-10-04 15:01:56 -07:00
75d11c1ea6 Address some minor Clippy complaints. 2021-10-04 15:01:26 -07:00
82d36d6fca Clean up formatting. 2021-07-26 20:55:36 -07:00
6bddd878fb Use GenericStream::from once, just to make sure it works. 2021-07-26 20:39:52 -07:00
58cb384afd Add HasLocalAddress for querying a socket's address, and a test. 2021-07-25 17:18:29 -07:00
1436b02323 Switch to a Mutex-based approach in Streamlike. 2021-07-25 17:17:38 -07:00
ca2eddf515 Ditch ToSocksAddress for the standard From/TryFrom.
This induces an added `Send` in the Network trait and its
implementations, but provides us the ability to use standard functions
with obvious extensions. So that's nice. I've also added some additional
testing to sanity check the conversions.
2021-07-05 20:35:56 -07:00
d1143a414c Split out the messages into individual files,, and add negative tests, so we can aspire towards good coverage. 2021-06-27 16:53:57 -07:00
Adam Wick
1bf6f62d4e checkpoint 2021-06-24 19:18:16 -07:00