diff options
author | Matt Caswell <matt@openssl.org> | 2016-03-07 12:36:20 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-03-07 13:36:17 +0000 |
commit | a193388811db7e842ed7d1966bbe2552095b26cc (patch) | |
tree | 9745c43d3caae4b03a63a2b6afbf9c47d51ad050 /engines | |
parent | e2524943ce669ec1f2d4dfd27652d175e48cf848 (diff) | |
download | openssl-a193388811db7e842ed7d1966bbe2552095b26cc.tar.gz |
Fix some clang warnings
The af_alg engine and associated test were creating warnings when compiled
with clang. This fixes it.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r-- | engines/afalg/e_afalg.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/engines/afalg/e_afalg.c b/engines/afalg/e_afalg.c index 30a5e388c4..d4b4f6bc58 100644 --- a/engines/afalg/e_afalg.c +++ b/engines/afalg/e_afalg.c @@ -129,7 +129,7 @@ static int afalg_chk_platform(void); static const char *engine_afalg_id = "afalg"; static const char *engine_afalg_name = "AFLAG engine support"; -int afalg_cipher_nids[] = { +static int afalg_cipher_nids[] = { NID_aes_128_cbc }; @@ -445,14 +445,11 @@ static int afalg_start_cipher_sk(afalg_ctx *actx, const unsigned char *in, # ifdef ALG_ZERO_COPY int ret; # endif + char cbuf[CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) + CMSG_SPACE(ALG_OP_LEN)]; - const ssize_t cbuf_sz = CMSG_SPACE(ALG_IV_LEN(ALG_AES_IV_LEN)) - + CMSG_SPACE(ALG_OP_LEN); - char cbuf[cbuf_sz]; - - memset(cbuf, 0, cbuf_sz); + memset(cbuf, 0, sizeof(cbuf)); msg.msg_control = cbuf; - msg.msg_controllen = cbuf_sz; + msg.msg_controllen = sizeof(cbuf); /* * cipher direction (i.e. encrypt or decrypt) and iv are sent to the |