forked from quic-go/quic-go
save the proof in client CryptoSetup
This commit is contained in:
@@ -25,6 +25,7 @@ type cryptoSetupClient struct {
|
|||||||
stk []byte
|
stk []byte
|
||||||
sno []byte
|
sno []byte
|
||||||
nonc []byte
|
nonc []byte
|
||||||
|
proof []byte
|
||||||
diversificationNonce []byte
|
diversificationNonce []byte
|
||||||
lastSentCHLO []byte
|
lastSentCHLO []byte
|
||||||
certManager crypto.CertManager
|
certManager crypto.CertManager
|
||||||
@@ -132,6 +133,10 @@ func (h *cryptoSetupClient) handleREJMessage(cryptoData map[Tag][]byte) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if proof, ok := cryptoData[TagPROF]; ok {
|
||||||
|
h.proof = proof
|
||||||
|
}
|
||||||
|
|
||||||
if crt, ok := cryptoData[TagCERT]; ok {
|
if crt, ok := cryptoData[TagCERT]; ok {
|
||||||
err := h.certManager.SetData(crt)
|
err := h.certManager.SetData(crt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -73,6 +73,14 @@ var _ = Describe("Crypto setup", func() {
|
|||||||
Expect(cs.stk).Should(Equal(stk))
|
Expect(cs.stk).Should(Equal(stk))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("saves the proof", func() {
|
||||||
|
proof := []byte("signature for the server config")
|
||||||
|
tagMap[TagPROF] = proof
|
||||||
|
err := cs.handleREJMessage(tagMap)
|
||||||
|
Expect(err).ToNot(HaveOccurred())
|
||||||
|
Expect(cs.proof).To(Equal(proof))
|
||||||
|
})
|
||||||
|
|
||||||
It("saves the server nonce", func() {
|
It("saves the server nonce", func() {
|
||||||
nonc := []byte("servernonce")
|
nonc := []byte("servernonce")
|
||||||
tagMap[TagSNO] = nonc
|
tagMap[TagSNO] = nonc
|
||||||
|
|||||||
Reference in New Issue
Block a user