summaryrefslogtreecommitdiffstats
path: root/engines/e_ossltest.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-11-29 23:27:27 +0000
committerMatt Caswell <matt@openssl.org>2016-11-29 23:31:10 +0000
commit6606d600545b28dbcfb391f3c5adf03dd6ad0ca7 (patch)
tree6489656ecf5d47e59aba59f97832883d29d78dd9 /engines/e_ossltest.c
parentd3ab93e9c372c98c4ee3bcf8bc3c406a19e62f95 (diff)
Fix some style issues in the TLSv1.3 nonce construction code
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'engines/e_ossltest.c')
-rw-r--r--engines/e_ossltest.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/engines/e_ossltest.c b/engines/e_ossltest.c
index 32d3118e70..3c9f08c8ef 100644
--- a/engines/e_ossltest.c
+++ b/engines/e_ossltest.c
@@ -619,6 +619,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 +629,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 +639,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;