|
|
@@ -422,16 +422,6 @@ func (h *encHandshake) makeAuthResp() (msg *authRespV4, err error) {
|
|
|
return msg, nil
|
|
|
}
|
|
|
|
|
|
-func (msg *authMsgV4) sealPlain(h *encHandshake) ([]byte, error) {
|
|
|
- buf := make([]byte, authMsgLen)
|
|
|
- n := copy(buf, msg.Signature[:])
|
|
|
- n += copy(buf[n:], crypto.Keccak256(exportPubkey(&h.randomPrivKey.PublicKey)))
|
|
|
- n += copy(buf[n:], msg.InitiatorPubkey[:])
|
|
|
- n += copy(buf[n:], msg.Nonce[:])
|
|
|
- buf[n] = 0 // token-flag
|
|
|
- return ecies.Encrypt(rand.Reader, h.remote, buf, nil, nil)
|
|
|
-}
|
|
|
-
|
|
|
func (msg *authMsgV4) decodePlain(input []byte) {
|
|
|
n := copy(msg.Signature[:], input)
|
|
|
n += shaLen // skip sha3(initiator-ephemeral-pubk)
|