diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-12 15:39:28 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-12 15:39:28 -0500 |
commit | 1a11702a9a4d5f95c52eb55263008ce2aa8017ef (patch) | |
tree | e1e25815245dc8e2123c4cf8c71a58bc11748659 /src | |
parent | 46796623f995c5b63d5cfbda1a038d9f6158ec90 (diff) | |
download | tor-1a11702a9a4d5f95c52eb55263008ce2aa8017ef.tar.gz tor-1a11702a9a4d5f95c52eb55263008ce2aa8017ef.zip |
Fix a compiler warning in aes.c.
Apparently some freebsd compilers can't tell that 'c' will never
be used uninitialized.
Fixes bug 28413; bugfix on 0.2.9.3-alpha when we added support for
longer AES keys to this function.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/aes.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/aes.c b/src/common/aes.c index 35c2d1e3a5..8ab2d2fc6e 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -99,12 +99,12 @@ aes_cnt_cipher_t * aes_new_cipher(const uint8_t *key, const uint8_t *iv, int key_bits) { EVP_CIPHER_CTX *cipher = EVP_CIPHER_CTX_new(); - const EVP_CIPHER *c; + const EVP_CIPHER *c = NULL; switch (key_bits) { case 128: c = EVP_aes_128_ctr(); break; case 192: c = EVP_aes_192_ctr(); break; case 256: c = EVP_aes_256_ctr(); break; - default: tor_assert(0); // LCOV_EXCL_LINE + default: tor_assert_unreached(); // LCOV_EXCL_LINE } EVP_EncryptInit(cipher, c, key, iv); return (aes_cnt_cipher_t *) cipher; @@ -402,4 +402,3 @@ aes_set_iv(aes_cnt_cipher_t *cipher, const uint8_t *iv) } #endif - |