8000 aes/openssl: remove obsolete version check by alfredh · Pull Request #572 · baresip/re · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

aes/openssl: remove obsolete version check #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
8000
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/aes/openssl/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,8 @@ static void destructor(void *arg)
{
struct aes *st = arg;

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
if (st->ctx)
EVP_CIPHER_CTX_free(st->ctx);
#else
if (st->ctx)
EVP_CIPHER_CTX_cleanup(st->ctx);
mem_deref(st->ctx);
#endif
}


Expand All @@ -104,24 +98,13 @@ int aes_alloc(struct aes **aesp, enum aes_mode mode,
st->mode = mode;
st->encr = true;

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
st->ctx = EVP_CIPHER_CTX_new();
if (!st->ctx) {
ERR_clear_error();
err = ENOMEM;
goto out;
}

#else
st->ctx = mem_zalloc(sizeof(*st->ctx), NULL);
if (!st->ctx) {
err = ENOMEM;
goto out;
}

EVP_CIPHER_CTX_init(st->ctx);
#endif

r = EVP_EncryptInit_ex(st->ctx, cipher, NULL, key, iv);
if (!r) {
ERR_clear_error();
Expand Down
0