#include <openssl/aes.h>
#include <openssl/crypto.h>
-#define OSSLTEST_LIB_NAME "OSSLTEST"
#include "e_ossltest_err.c"
/* Engine Id and Name */
{
unsigned char *tmpbuf = OPENSSL_malloc(inl);
+ /* OPENSSL_malloc will return NULL if inl == 0 */
if (tmpbuf == NULL && inl > 0)
return -1;
/* Go through the motions of encrypting it */
EVP_CIPHER_meth_get_do_cipher(EVP_aes_128_gcm())(ctx, out, in, inl);
- /*
- * Throw it all away and just use the plaintext as the output
- */
+ /* Throw it all away and just use the plaintext as the output */
memcpy(out, tmpbuf, inl);
OPENSSL_free(tmpbuf);
static int ossltest_aes128_gcm_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg,
void *ptr)
{
- int ret;
-
/* Pass the ctrl down */
- ret = EVP_CIPHER_meth_get_ctrl(EVP_aes_128_gcm())(ctx, type, arg, ptr);
+ int ret = EVP_CIPHER_meth_get_ctrl(EVP_aes_128_gcm())(ctx, type, arg, ptr);
if (ret <= 0)
return ret;