From ec1e714ac146059c698417dbb5e74073bd47abaa Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 24 Nov 2010 13:14:03 +0000 Subject: [PATCH] constify EVP_PKEY_new_mac_key() --- crypto/evp/evp.h | 2 +- crypto/evp/pmeth_gn.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index b76ca79daa..cd73966fd7 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -1066,7 +1066,7 @@ int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, - unsigned char *key, int keylen); + const unsigned char *key, int keylen); void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c index 5d74161a09..4651c81370 100644 --- a/crypto/evp/pmeth_gn.c +++ b/crypto/evp/pmeth_gn.c @@ -199,7 +199,7 @@ int EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx) } EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, - unsigned char *key, int keylen) + const unsigned char *key, int keylen) { EVP_PKEY_CTX *mac_ctx = NULL; EVP_PKEY *mac_key = NULL; @@ -209,7 +209,8 @@ EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, if (EVP_PKEY_keygen_init(mac_ctx) <= 0) goto merr; if (EVP_PKEY_CTX_ctrl(mac_ctx, -1, EVP_PKEY_OP_KEYGEN, - EVP_PKEY_CTRL_SET_MAC_KEY, keylen, key) <= 0) + EVP_PKEY_CTRL_SET_MAC_KEY, + keylen, (void *)key) <= 0) goto merr; if (EVP_PKEY_keygen(mac_ctx, &mac_key) <= 0) goto merr; -- 2.40.0