Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(339)

Unified Diff: ssh/kex.go

Issue 86190043: code review 86190043: go.crypto/ssh: import gosshnew. (Closed)
Patch Set: diff -r 2990fc550b9f https://code.google.com/p/go.crypto Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ssh/handshake_test.go ('k') | ssh/kex_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ssh/kex.go
===================================================================
--- a/ssh/kex.go
+++ b/ssh/kex.go
@@ -30,10 +30,10 @@
// Shared secret. See also RFC 4253, section 8.
K []byte
- // Host key as hashed into H
+ // Host key as hashed into H.
HostKey []byte
- // Signature of H
+ // Signature of H.
Signature []byte
// A cryptographic hash function that matches the security
@@ -94,7 +94,7 @@
kexDHInit := kexDHInitMsg{
X: X,
}
- if err := c.writePacket(marshal(msgKexDHInit, kexDHInit)); err != nil {
+ if err := c.writePacket(Marshal(&kexDHInit)); err != nil {
return nil, err
}
@@ -104,7 +104,7 @@
}
var kexDHReply kexDHReplyMsg
- if err = unmarshal(&kexDHReply, packet, msgKexDHReply); err != nil {
+ if err = Unmarshal(packet, &kexDHReply); err != nil {
return nil, err
}
@@ -138,7 +138,7 @@
return
}
var kexDHInit kexDHInitMsg
- if err = unmarshal(&kexDHInit, packet, msgKexDHInit); err != nil {
+ if err = Unmarshal(packet, &kexDHInit); err != nil {
return
}
@@ -153,7 +153,7 @@
return nil, err
}
- hostKeyBytes := MarshalPublicKey(priv.PublicKey())
+ hostKeyBytes := priv.PublicKey().Marshal()
h := hashFunc.New()
magics.write(h)
@@ -179,7 +179,7 @@
Y: Y,
Signature: sig,
}
- packet = marshal(msgKexDHReply, kexDHReply)
+ packet = Marshal(&kexDHReply)
err = c.writePacket(packet)
return &kexResult{
@@ -207,7 +207,7 @@
ClientPubKey: elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y),
}
- serialized := marshal(msgKexECDHInit, kexInit)
+ serialized := Marshal(&kexInit)
if err := c.writePacket(serialized); err != nil {
return nil, err
}
@@ -218,7 +218,7 @@
}
var reply kexECDHReplyMsg
- if err = unmarshal(&reply, packet, msgKexECDHReply); err != nil {
+ if err = Unmarshal(packet, &reply); err != nil {
return nil, err
}
@@ -297,7 +297,7 @@
}
var kexECDHInit kexECDHInitMsg
- if err = unmarshal(&kexECDHInit, packet, msgKexECDHInit); err != nil {
+ if err = Unmarshal(packet, &kexECDHInit); err != nil {
return nil, err
}
@@ -314,7 +314,7 @@
return nil, err
}
- hostKeyBytes := MarshalPublicKey(priv.PublicKey())
+ hostKeyBytes := priv.PublicKey().Marshal()
serializedEphKey := elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y)
@@ -346,7 +346,7 @@
Signature: sig,
}
- serialized := marshal(msgKexECDHReply, reply)
+ serialized := Marshal(&reply)
if err := c.writePacket(serialized); err != nil {
return nil, err
}
« no previous file with comments | « ssh/handshake_test.go ('k') | ssh/kex_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b