X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=engines%2Fe_ossltest.c;h=ea752d5e9c5db557d4909252da93ef95c71475ef;hb=e90fc053c33a2241004451cfdeecfbf3cbdeb728;hp=32d3118e7027ff248a304eb3fba175595f104175;hpb=bebc0c7d85a7484f1c5d0123f24cdc3c6b150243;p=openssl.git diff --git a/engines/e_ossltest.c b/engines/e_ossltest.c index 32d3118e70..ea752d5e9c 100644 --- a/engines/e_ossltest.c +++ b/engines/e_ossltest.c @@ -25,7 +25,6 @@ #include #include -#define OSSLTEST_LIB_NAME "OSSLTEST" #include "e_ossltest_err.c" /* Engine Id and Name */ @@ -619,6 +618,7 @@ int ossltest_aes128_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { unsigned char *tmpbuf = OPENSSL_malloc(inl); + /* OPENSSL_malloc will return NULL if inl == 0 */ if (tmpbuf == NULL && inl > 0) return -1; @@ -628,9 +628,7 @@ int ossltest_aes128_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, /* 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); @@ -640,10 +638,8 @@ int ossltest_aes128_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, 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;