go.crypto/ssh: support rekeying in both directions.
Adds a largely symmetrical handshakeTransport, which can send
and process kexInit messages. Automatically rekey on every on
1G of data transmitted.
this goes on top of CL 14641044. We must submit this one before the mux ...
11 years, 8 months ago
(2013-10-14 21:59:18 UTC)
#2
this goes on top of CL 14641044.
We must submit this one before the mux change, since we'd break rekeying
otherwise.
Beyond mechanism, this also implements a policy (rekey based on amount of data
passed through the connection.) suggested by the RFC
questions:
* should we implement the other policy (rekey after every hour)
* should we expose the rekeying functionality (OpenSSH apparently has a ~R
shortcut that issues a rekey.) ?
So for "rekey after N bytes", I think it's important to do that at a ...
11 years, 8 months ago
(2013-10-14 22:27:31 UTC)
#3
So for "rekey after N bytes", I think it's important to do that at a low level
to avoid races where significantly more than N bytes might go through before the
channel is blocked for a rekey.
For other policies, I prefer the idea of exporting a Rekey() method and allowing
the user to implement them, possibly with helpers.
I tried eating newkeys (and managed to make it work), but decided against it. It ...
11 years, 8 months ago
(2013-10-21 00:46:50 UTC)
#7
I tried eating newkeys (and managed to make it work), but decided against it. It
also serves to synchronize things in the initial handshake, in particular to
ensure that sessionID is set before we start authentication.
https://codereview.appspot.com/14494058/diff/180001/ssh/handshake.go File ssh/handshake.go (right): https://codereview.appspot.com/14494058/diff/180001/ssh/handshake.go#newcode221 ssh/handshake.go:221: // TODO(hanwen): add random bits to kexInit.Cookie. On 2013/10/21 ...
11 years, 8 months ago
(2013-10-21 20:00:20 UTC)
#10
https://codereview.appspot.com/14494058/diff/180001/ssh/handshake.go
File ssh/handshake.go (right):
https://codereview.appspot.com/14494058/diff/180001/ssh/handshake.go#newcode221
ssh/handshake.go:221: // TODO(hanwen): add random bits to kexInit.Cookie.
On 2013/10/21 17:03:51, jpsugar wrote:
> Um, this is pretty serious. No random bits is a security issue.
go.crypto only support DH and ECDH key exchanges, both of which have randomness
of both sides. Maybe this is for GSS/Kerberos?
I wanted to address this in another CL (currently, the Cookie is not init'd
either.) to simplify review.
On Tue, Oct 22, 2013 at 3:07 PM, <dave@cheney.net> wrote: > I would really like ...
11 years, 8 months ago
(2013-10-23 00:56:29 UTC)
#17
On Tue, Oct 22, 2013 at 3:07 PM, <dave@cheney.net> wrote:
> I would really like to see this CL broken into smaller chunks. 1000
> lines changed is too many for me to review with confidence.
>
> I suggest breaking out all the sections I have noted into a separate CL.
>
> Then breaking out adding handshake{_test}.go into a separate CL.
>
> Then a final one to hook them all up.
I can do that, although I don't think it the step makes the change less
complex.
I've sent the small bits separately, and I'll have another round to
check if I can separate out more things.
--
Han-Wen Nienhuys
Google Munich
hanwen@google.com
I suspect I can factor out the sshConn{} change. On Tue, Oct 22, 2013 at ...
11 years, 8 months ago
(2013-10-23 01:22:48 UTC)
#18
I suspect I can factor out the sshConn{} change.
On Tue, Oct 22, 2013 at 5:56 PM, Han-Wen Nienhuys <hanwen@google.com> wrote:
> On Tue, Oct 22, 2013 at 3:07 PM, <dave@cheney.net> wrote:
>> I would really like to see this CL broken into smaller chunks. 1000
>> lines changed is too many for me to review with confidence.
>>
>> I suggest breaking out all the sections I have noted into a separate CL.
>>
>> Then breaking out adding handshake{_test}.go into a separate CL.
>>
>> Then a final one to hook them all up.
>
> I can do that, although I don't think it the step makes the change less
complex.
>
> I've sent the small bits separately, and I'll have another round to
> check if I can separate out more things.
>
> --
> Han-Wen Nienhuys
> Google Munich
> hanwen@google.com
--
Han-Wen Nienhuys
Google Munich
hanwen@google.com
11 years, 8 months ago
(2013-10-25 23:40:45 UTC)
#20
On 2013/10/25 20:02:57, hanwen-google wrote:
> Hello mailto:agl@golang.org, mailto:dave@cheney.net, mailto:jpsugar@google.com
(cc:
> mailto:golang-dev@googlegroups.com),
>
> Please take another look.
Does this include the changes we landed to void Server/ClientConn implmenting
io.ReadWriter ? There is some sshConn stuff in this CL.
On 2013/10/25 23:40:45, dfc wrote: > On 2013/10/25 20:02:57, hanwen-google wrote: > > Hello mailto:agl@golang.org, ...
11 years, 8 months ago
(2013-10-25 23:51:40 UTC)
#21
On 2013/10/25 23:40:45, dfc wrote:
> On 2013/10/25 20:02:57, hanwen-google wrote:
> > Hello mailto:agl@golang.org, mailto:dave@cheney.net,
mailto:jpsugar@google.com
> (cc:
> > mailto:golang-dev@googlegroups.com),
> >
> > Please take another look.
>
> Does this include the changes we landed to void Server/ClientConn implmenting
> io.ReadWriter ? There is some sshConn stuff in this CL.
It includes them. Now that the transport moves down one level, we don't have
access to the RWC anymore, so I reintroduced to hold net.Conn. On top of that,
it gets rid of the RemoteAddr/LocalAddr/Close implementation duplicated between
server and client.
I'm not attached to how we do this, but this was the simplest I could think of.
Suggestions?
LGTM for the diffs. (Note: If I've said LGTM, but have included a few comments, ...
11 years, 8 months ago
(2013-10-31 14:36:34 UTC)
#26
LGTM for the diffs.
(Note: If I've said LGTM, but have included a few comments, you don't need to
wait for another review if you've just fixed the comments.)
LGTM with minor comments. https://codereview.appspot.com/14494058/diff/580001/ssh/common.go File ssh/common.go (right): https://codereview.appspot.com/14494058/diff/580001/ssh/common.go#newcode154 ssh/common.go:154: // new key is negotiated. ...
11 years, 8 months ago
(2013-11-03 08:23:03 UTC)
#27
Issue 14494058: code review 14494058: go.crypto/ssh: support rekeying in both directions.
(Closed)
Created 11 years, 8 months ago by hanwen-google
Modified 11 years, 8 months ago
Reviewers: agl1, dave_cheney.net, jpsugar
Base URL:
Comments: 80