encrypt unprotected packets with a connection-dependent key

This commit is contained in:
Marten Seemann
2017-10-25 20:24:19 +07:00
parent ddea1d83ab
commit 4f86995e48
14 changed files with 174 additions and 134 deletions

View File

@@ -76,6 +76,10 @@ func NewCryptoSetupClient(
aeadChanged chan<- protocol.EncryptionLevel,
negotiatedVersions []protocol.VersionNumber,
) (CryptoSetup, error) {
nullAEAD, err := crypto.NewNullAEAD(protocol.PerspectiveClient, connID, version)
if err != nil {
return nil, err
}
return &cryptoSetupClient{
cryptoStream: cryptoStream,
hostname: hostname,
@@ -85,7 +89,7 @@ func NewCryptoSetupClient(
params: params,
keyDerivation: crypto.DeriveQuicCryptoAESKeys,
keyExchange: getEphermalKEX,
nullAEAD: crypto.NewNullAEAD(protocol.PerspectiveClient, version),
nullAEAD: nullAEAD,
paramsChan: paramsChan,
aeadChanged: aeadChanged,
negotiatedVersions: negotiatedVersions,