mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-15 23:06:52 +01:00
handshake: Let a payload's certificate alias the decrypted message rather than copying it
This commit is contained in:
1 parent
7c2dcd7ba1
commit
35b3d92bdd
1 file changed
+3
-2
@@ -72,7 +72,8 @@ func MarshalPayload(out []byte, p Payload) []byte {
|
|||||||
return append(out, rest...)
|
return append(out, rest...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalPayload decodes a protobuf-encoded NebulaHandshake message.
|
// UnmarshalPayload decodes a protobuf-encoded NebulaHandshake message. The
|
||||||
|
// returned Cert aliases b.
|
||||||
func UnmarshalPayload(b []byte) (Payload, error) {
|
func UnmarshalPayload(b []byte) (Payload, error) {
|
||||||
var p Payload
|
var p Payload
|
||||||
|
|
||||||
@@ -127,7 +128,7 @@ func unmarshalPayloadDetails(p *Payload, b []byte) error {
|
|||||||
if n < 0 {
|
if n < 0 {
|
||||||
return errInvalidHandshakeDetails
|
return errInvalidHandshakeDetails
|
||||||
}
|
}
|
||||||
p.Cert = append([]byte(nil), v...)
|
p.Cert = v
|
||||||
b = b[n:]
|
b = b[n:]
|
||||||
case fieldInitiatorIndex:
|
case fieldInitiatorIndex:
|
||||||
if typ != protowire.VarintType {
|
if typ != protowire.VarintType {
|
||||||
|
|||||||
Reference in new issue
Block a user