read certificate chain from SHLO

This commit is contained in:
Marten Seemann
2016-11-10 22:18:11 +07:00
parent c5f88e01f5
commit 0b8c883b71
2 changed files with 15 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ type cryptoSetupClient struct {
stk []byte
sno []byte
diversificationNonce []byte
certManager *crypto.CertManager
}
var _ crypto.AEAD = &cryptoSetupClient{}
@@ -45,6 +46,7 @@ func NewCryptoSetupClient(
connID: connID,
version: version,
cryptoStream: cryptoStream,
certManager: &crypto.CertManager{},
}, nil
}
@@ -100,6 +102,13 @@ func (h *cryptoSetupClient) handleREJMessage(cryptoData map[Tag][]byte) error {
}
}
if crt, ok := cryptoData[TagCERT]; ok {
err := h.certManager.SetData(crt)
if err != nil {
return err
}
}
return nil
}