|
@ -345,14 +345,14 @@ static int setup_aes_key(transop_aes_t *priv, const uint8_t *key, ssize_t key_si |
|
|
|
|
|
|
|
|
if(key_size >= 65) { |
|
|
if(key_size >= 65) { |
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
priv->cipher = EVP_chacha20(); |
|
|
priv->cipher = EVP_aes_256_cbc(); |
|
|
#endif |
|
|
#endif |
|
|
aes_key_size_bytes = AES256_KEY_BYTES; |
|
|
aes_key_size_bytes = AES256_KEY_BYTES; |
|
|
SHA512(key, key_size, key_mat_buf); |
|
|
SHA512(key, key_size, key_mat_buf); |
|
|
key_mat_buf_length = SHA512_DIGEST_LENGTH; |
|
|
key_mat_buf_length = SHA512_DIGEST_LENGTH; |
|
|
} else if(key_size >= 44) { |
|
|
} else if(key_size >= 44) { |
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
priv->cipher = EVP_chacha20(); |
|
|
priv->cipher = EVP_aes_192_cbc(); |
|
|
#endif |
|
|
#endif |
|
|
aes_key_size_bytes = AES192_KEY_BYTES; |
|
|
aes_key_size_bytes = AES192_KEY_BYTES; |
|
|
SHA384(key, key_size, key_mat_buf); |
|
|
SHA384(key, key_size, key_mat_buf); |
|
@ -361,7 +361,7 @@ static int setup_aes_key(transop_aes_t *priv, const uint8_t *key, ssize_t key_si |
|
|
key_mat_buf_length = SHA384_DIGEST_LENGTH + SHA256_DIGEST_LENGTH; |
|
|
key_mat_buf_length = SHA384_DIGEST_LENGTH + SHA256_DIGEST_LENGTH; |
|
|
} else { |
|
|
} else { |
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
#ifdef HAVE_OPENSSL_1_1 |
|
|
priv->cipher = EVP_chacha20(); |
|
|
priv->cipher = EVP_aes_128_cbc(); |
|
|
#endif |
|
|
#endif |
|
|
aes_key_size_bytes = AES128_KEY_BYTES; |
|
|
aes_key_size_bytes = AES128_KEY_BYTES; |
|
|
SHA256(key, key_size, key_mat_buf); |
|
|
SHA256(key, key_size, key_mat_buf); |
|
|