diff options
author | Wim <wim@42.be> | 2022-03-19 22:04:13 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2022-03-20 14:57:48 +0100 |
commit | 2623a412c42a81104b97ae8c81a5f66760fee4b6 (patch) | |
tree | 502c6d4473baac3792d14fda51dbb56179f19424 /vendor/golang.org/x/crypto/ssh/transport.go | |
parent | d64eed49bc6f2e8a01f922727795eea158cbc56d (diff) | |
download | matterbridge-msglm-2623a412c42a81104b97ae8c81a5f66760fee4b6.tar.gz matterbridge-msglm-2623a412c42a81104b97ae8c81a5f66760fee4b6.tar.bz2 matterbridge-msglm-2623a412c42a81104b97ae8c81a5f66760fee4b6.zip |
Update vendor (whatsapp)
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/transport.go')
-rw-r--r-- | vendor/golang.org/x/crypto/ssh/transport.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/transport.go b/vendor/golang.org/x/crypto/ssh/transport.go index 49ddc2e7..acf5a21b 100644 --- a/vendor/golang.org/x/crypto/ssh/transport.go +++ b/vendor/golang.org/x/crypto/ssh/transport.go @@ -238,15 +238,19 @@ var ( // (to setup server->client keys) or clientKeys (for client->server keys). func newPacketCipher(d direction, algs directionAlgorithms, kex *kexResult) (packetCipher, error) { cipherMode := cipherModes[algs.Cipher] - macMode := macModes[algs.MAC] iv := make([]byte, cipherMode.ivSize) key := make([]byte, cipherMode.keySize) - macKey := make([]byte, macMode.keySize) generateKeyMaterial(iv, d.ivTag, kex) generateKeyMaterial(key, d.keyTag, kex) - generateKeyMaterial(macKey, d.macKeyTag, kex) + + var macKey []byte + if !aeadCiphers[algs.Cipher] { + macMode := macModes[algs.MAC] + macKey = make([]byte, macMode.keySize) + generateKeyMaterial(macKey, d.macKeyTag, kex) + } return cipherModes[algs.Cipher].create(key, iv, macKey, algs) } |