diff options
author | Péter Dimitrov <[email protected]> | 2019-04-02 15:50:15 +0200 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2019-04-02 16:13:47 +0200 |
commit | 7f014fd65d13575c352b178894187356b2d7d3b5 (patch) | |
tree | 3d0578c61abb693796577ba06615ea9b44fc6ee7 /lib/ssl/src/ssl_cipher.erl | |
parent | be44d6827e2374a43068b35de85ed16441c771be (diff) | |
download | otp-7f014fd65d13575c352b178894187356b2d7d3b5.tar.gz otp-7f014fd65d13575c352b178894187356b2d7d3b5.tar.bz2 otp-7f014fd65d13575c352b178894187356b2d7d3b5.zip |
ssl: Fix Chacha20 IV length and nonce calculation
This commit fixes the IV length (12 bytes) and the calculation of
the nonce for the Chacha20-Poly1305 ciphers.
Change-Id: I4c9efc0bf012bc287c84c7b62c252ecf49ffe32f
Diffstat (limited to 'lib/ssl/src/ssl_cipher.erl')
-rw-r--r-- | lib/ssl/src/ssl_cipher.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 97878431a6..850dee7d4f 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -838,8 +838,7 @@ effective_key_bits(Cipher) when Cipher == aes_256_cbc; 256. iv_size(Cipher) when Cipher == null; - Cipher == rc4_128; - Cipher == chacha20_poly1305-> + Cipher == rc4_128 -> 0; iv_size(Cipher) when Cipher == aes_128_gcm; Cipher == aes_256_gcm; @@ -848,6 +847,8 @@ iv_size(Cipher) when Cipher == aes_128_gcm; Cipher == aes_128_ccm_8; Cipher == aes_256_ccm_8 -> 4; +iv_size(chacha20_poly1305) -> + 12; iv_size(Cipher) -> block_size(Cipher). |