diff options
author | Benjamin Kaduk <kaduk@mit.edu> | 2019-03-14 12:55:03 -0500 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-03-19 07:19:41 +0100 |
commit | 226f2bf191ba8c2b33749ddc80c9ace051bebf80 (patch) | |
tree | e72c1438867a768b51a1f9e1b9becc923d87ac2c /engines | |
parent | 16bfe6cee0853bd340e270f2deda6000ea6eeaa9 (diff) | |
download | openssl-new-226f2bf191ba8c2b33749ddc80c9ace051bebf80.tar.gz |
Fix strict-warnings build on FreeBSD
The 'key' member of the (system-defined!) struct session op is of
type c_caddr_t, which can be (signed) char, so inter-casting with the
unsigned char* input to cipher_init() causes -Wpointer-sign errors, and we
can't change the signature of cipher_init() due to the function pointer
type required by EVP_CIPHER_meth_set_init().
As the least-bad option, introduce a void* cast to quell the following
warning:
engines/e_devcrypto.c:356:36: error: passing 'c_caddr_t' (aka 'const char *') to
parameter of type 'const unsigned char *' converts between pointers to integer
types with different sign [-Werror,-Wpointer-sign]
return cipher_init(to_ctx, cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx),
^~~~~~~~~~~~~~~~~~~~
engines/e_devcrypto.c:191:66: note: passing argument to parameter 'key' here
static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8509)
Diffstat (limited to 'engines')
-rw-r--r-- | engines/e_devcrypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/e_devcrypto.c b/engines/e_devcrypto.c index c0b0d1e8ab..b1e87096fd 100644 --- a/engines/e_devcrypto.c +++ b/engines/e_devcrypto.c @@ -353,7 +353,7 @@ static int cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int p1, void* p2) to_cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(to_ctx); memset(&to_cipher_ctx->sess, 0, sizeof(to_cipher_ctx->sess)); - return cipher_init(to_ctx, cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx), + return cipher_init(to_ctx, (void *)cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx), (cipher_ctx->op == COP_ENCRYPT)); case EVP_CTRL_INIT: |