The AES code from the OpenSSL project (files aes.h and aes_core.cpp and ) when used in conjunction with the OpenSSL library cause a violation of the ODR rule in C++ which in turn may cause undefined behavior in the program.
The problem occurs because the AES_KEY struct is defined both in the aes.h file and in the OpenSSL library.
This causes the rk buffer (the buffer holding the key) to be also double defined. In case the program uses also the OpenSSL AES code, undefined behavior will occur.
For example, the program will use either one of these buffer so the two different implementations of the AES algorithm will access the same buffer.
A simple solution is to remove these files and to use the code from the OpenSSL library.
The AES code from the OpenSSL project (files aes.h and aes_core.cpp and ) when used in conjunction with the OpenSSL library cause a violation of the ODR rule in C++ which in turn may cause undefined behavior in the program.
The problem occurs because the AES_KEY struct is defined both in the aes.h file and in the OpenSSL library.
This causes the rk buffer (the buffer holding the key) to be also double defined. In case the program uses also the OpenSSL AES code, undefined behavior will occur. For example, the program will use either one of these buffer so the two different implementations of the AES algorithm will access the same buffer.
A simple solution is to remove these files and to use the code from the OpenSSL library.