mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-20 02:09:24 +01:00
Merge branch 'maint-0.3.3' into maint-0.3.4
This commit is contained in:
commit
42be1c668b
4
changes/bug28413
Normal file
4
changes/bug28413
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
o Minor bugfixes (compilation):
|
||||||
|
- Initialize a variable in aes_new_cipher(), since some compilers
|
||||||
|
cannot tell that we always initialize it before use. Fixes bug 28413;
|
||||||
|
bugfix on 0.2.9.3-alpha.
|
@ -101,12 +101,12 @@ aes_cnt_cipher_t *
|
|||||||
aes_new_cipher(const uint8_t *key, const uint8_t *iv, int key_bits)
|
aes_new_cipher(const uint8_t *key, const uint8_t *iv, int key_bits)
|
||||||
{
|
{
|
||||||
EVP_CIPHER_CTX *cipher = EVP_CIPHER_CTX_new();
|
EVP_CIPHER_CTX *cipher = EVP_CIPHER_CTX_new();
|
||||||
const EVP_CIPHER *c;
|
const EVP_CIPHER *c = NULL;
|
||||||
switch (key_bits) {
|
switch (key_bits) {
|
||||||
case 128: c = EVP_aes_128_ctr(); break;
|
case 128: c = EVP_aes_128_ctr(); break;
|
||||||
case 192: c = EVP_aes_192_ctr(); break;
|
case 192: c = EVP_aes_192_ctr(); break;
|
||||||
case 256: c = EVP_aes_256_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);
|
EVP_EncryptInit(cipher, c, key, iv);
|
||||||
return (aes_cnt_cipher_t *) cipher;
|
return (aes_cnt_cipher_t *) cipher;
|
||||||
|
Loading…
Reference in New Issue
Block a user