Skip to content

fix: migrate from deprecated OpenSSL AES API to EVP API#523

Open
TomasULR wants to merge 1 commit intokavishdevar:mainfrom
TomasULR:fix/openssl-deprecation
Open

fix: migrate from deprecated OpenSSL AES API to EVP API#523
TomasULR wants to merge 1 commit intokavishdevar:mainfrom
TomasULR:fix/openssl-deprecation

Conversation

@TomasULR
Copy link
Copy Markdown

Summary

  • Replaces deprecated AES_set_encrypt_key, AES_encrypt, AES_set_decrypt_key, and AES_cbc_encrypt with the modern OpenSSL 3.0 EVP API
  • These functions have been deprecated since OpenSSL 3.0 and produce compiler warnings on newer systems (as reported in the issue)

Changes

  • linux/ble/bleutils.cpp:
    • e() function: replaced with EVP_aes_128_ecb() (matches the original single-block AES-ECB behavior)
    • decryptLastBytes() function: replaced with EVP_aes_128_cbc() with zero IV (matches the original AES-CBC behavior)
    • Padding explicitly disabled via EVP_CIPHER_CTX_set_padding(ctx, 0) to match the old API behavior
    • Changed #include <openssl/aes.h> to #include <openssl/evp.h>

Fixes #459

Replace deprecated AES_set_encrypt_key, AES_encrypt, AES_set_decrypt_key,
and AES_cbc_encrypt with the modern EVP_* API (EVP_aes_128_ecb for
single-block encryption, EVP_aes_128_cbc for CBC decryption).

These functions have been deprecated since OpenSSL 3.0 and produce
compiler warnings on newer systems.

Fixes kavishdevar#459
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiling warnings

1 participant