drop support for v30

fixes #213
This commit is contained in:
Lucas Clemente
2016-07-21 13:50:09 +02:00
parent 8856304b65
commit 1712a7388f
6 changed files with 12 additions and 25 deletions

View File

@@ -184,8 +184,8 @@ func (h *CryptoSetup) isInchoateCHLO(cryptoData map[Tag][]byte) bool {
return false
}
func (h *CryptoSetup) handleInchoateCHLO(sni string, data []byte, cryptoData map[Tag][]byte) ([]byte, error) {
if len(data) < protocol.ClientHelloMinimumSize {
func (h *CryptoSetup) handleInchoateCHLO(sni string, chlo []byte, cryptoData map[Tag][]byte) ([]byte, error) {
if len(chlo) < protocol.ClientHelloMinimumSize {
return nil, qerr.Error(qerr.CryptoInvalidValueLength, "CHLO too small")
}
@@ -200,12 +200,7 @@ func (h *CryptoSetup) handleInchoateCHLO(sni string, data []byte, cryptoData map
}
if h.scfg.stkSource.VerifyToken(h.ip, cryptoData[TagSTK]) == nil {
var chloOrNil []byte
if h.version > protocol.Version30 {
chloOrNil = data
}
proof, err := h.scfg.Sign(sni, chloOrNil)
proof, err := h.scfg.Sign(sni, chlo)
if err != nil {
return nil, err
}

View File

@@ -228,13 +228,6 @@ var _ = Describe("Crypto setup", func() {
Expect(signer.gotCHLO).To(BeTrue())
})
It("generates REJ messages for version 30", func() {
cs.version = protocol.Version30
_, err := cs.handleInchoateCHLO("", sampleCHLO, nil)
Expect(err).ToNot(HaveOccurred())
Expect(signer.gotCHLO).To(BeFalse())
})
It("generates SHLO messages", func() {
response, err := cs.handleCHLO("", []byte("chlo-data"), map[Tag][]byte{
TagPUBS: []byte("pubs-c"),