summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_ameth.c
diff options
context:
space:
mode:
authorNicola Tuveri <nic.tuv@gmail.com>2020-01-07 01:19:13 +0200
committerNicola Tuveri <nic.tuv@gmail.com>2020-02-18 19:11:10 +0200
commitcd701de96a147260c2290d85af8a0656120a8ff8 (patch)
treeda961d9a56d36a608f25c9f1747d6d674167552e /crypto/ec/ec_ameth.c
parentafa2b389bc0b81a976bf79381ecc553932a090b3 (diff)
[EC] Constify internal EC_KEY pointer usage
A pair of internal functions related to EC_KEY handling could benefit from declaring `EC_KEY *` variables as `const`, providing clarity for callers and readers of the code, in addition to enlisting the compiler in preventing some mistakes. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10631)
Diffstat (limited to 'crypto/ec/ec_ameth.c')
-rw-r--r--crypto/ec/ec_ameth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index d2c8c399de..602ff7c557 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -29,7 +29,7 @@ static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
static int ecdh_cms_encrypt(CMS_RecipientInfo *ri);
#endif
-static int eckey_param2type(int *pptype, void **ppval, EC_KEY *ec_key)
+static int eckey_param2type(int *pptype, void **ppval, const EC_KEY *ec_key)
{
const EC_GROUP *group;
int nid;
@@ -63,7 +63,7 @@ static int eckey_param2type(int *pptype, void **ppval, EC_KEY *ec_key)
static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
{
- EC_KEY *ec_key = pkey->pkey.ec;
+ const EC_KEY *ec_key = pkey->pkey.ec;
void *pval = NULL;
int ptype;
unsigned char *penc = NULL, *p;