initial server hello implementation

This commit is contained in:
Lucas Clemente
2016-04-16 00:27:30 +02:00
parent a2ef4d2dc8
commit 88f404c19e
2 changed files with 10 additions and 2 deletions

View File

@@ -58,8 +58,13 @@ func (h *CryptoSetup) HandleCryptoMessage(data []byte) ([]byte, error) {
if err != nil {
return nil, err
}
// TODO: Send SHLO
return nil, nil
var reply bytes.Buffer
WriteHandshakeMessage(&reply, TagSHLO, map[Tag][]byte{
TagPUBS: h.scfg.kex.PublicKey(),
TagVER: protocol.SupportedVersionsAsTags,
})
return reply.Bytes(), nil
}
// We have an inacholate or non-matching CHLO, we now send a rejection

View File

@@ -68,4 +68,7 @@ const (
TagEXPY Tag = 'E' + 'X'<<8 + 'P'<<16 + 'Y'<<24
// TagCERT is the CERT data
TagCERT Tag = 0xff545243
// TagSHLO is the server hello
TagSHLO Tag = 'S' + 'H'<<8 + 'L'<<16 + 'O'<<24
)