summaryrefslogtreecommitdiffstats
path: root/providers/implementations/keymgmt
diff options
context:
space:
mode:
authorNicola Tuveri <nic.tuv@gmail.com>2020-10-21 01:38:44 +0300
committerNicola Tuveri <nic.tuv@gmail.com>2020-10-23 17:54:40 +0300
commitd1fb6b481b1d70932a1435f83eae10cc68edbe36 (patch)
tree1253a9c0cc7cccf93126fc518844e254b8cd8ed5 /providers/implementations/keymgmt
parent85209c07459b1c6007e0fc550f40c05deec78531 (diff)
Constify OSSL_FUNC_keymgmt_validate()
The keydata argument of OSSL_FUNC_keymgmt_validate() should be read-only. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13201)
Diffstat (limited to 'providers/implementations/keymgmt')
-rw-r--r--providers/implementations/keymgmt/dh_kmgmt.c8
-rw-r--r--providers/implementations/keymgmt/dsa_kmgmt.c10
-rw-r--r--providers/implementations/keymgmt/ec_kmgmt.c4
-rw-r--r--providers/implementations/keymgmt/rsa_kmgmt.c4
4 files changed, 13 insertions, 13 deletions
diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c
index b944d3cd99..d8ca4cc9dd 100644
--- a/providers/implementations/keymgmt/dh_kmgmt.c
+++ b/providers/implementations/keymgmt/dh_kmgmt.c
@@ -363,7 +363,7 @@ static int dh_set_params(void *key, const OSSL_PARAM params[])
return 1;
}
-static int dh_validate_public(DH *dh)
+static int dh_validate_public(const DH *dh)
{
const BIGNUM *pub_key = NULL;
@@ -373,7 +373,7 @@ static int dh_validate_public(DH *dh)
return DH_check_pub_key_ex(dh, pub_key);
}
-static int dh_validate_private(DH *dh)
+static int dh_validate_private(const DH *dh)
{
int status = 0;
const BIGNUM *priv_key = NULL;
@@ -384,9 +384,9 @@ static int dh_validate_private(DH *dh)
return dh_check_priv_key(dh, priv_key, &status);;
}
-static int dh_validate(void *keydata, int selection)
+static int dh_validate(const void *keydata, int selection)
{
- DH *dh = keydata;
+ const DH *dh = keydata;
int ok = 0;
if (!ossl_prov_is_running())
diff --git a/providers/implementations/keymgmt/dsa_kmgmt.c b/providers/implementations/keymgmt/dsa_kmgmt.c
index 9ade336cdf..c3f178d34c 100644
--- a/providers/implementations/keymgmt/dsa_kmgmt.c
+++ b/providers/implementations/keymgmt/dsa_kmgmt.c
@@ -305,14 +305,14 @@ static const OSSL_PARAM *dsa_gettable_params(void *provctx)
return dsa_params;
}
-static int dsa_validate_domparams(DSA *dsa)
+static int dsa_validate_domparams(const DSA *dsa)
{
int status = 0;
return dsa_check_params(dsa, &status);
}
-static int dsa_validate_public(DSA *dsa)
+static int dsa_validate_public(const DSA *dsa)
{
int status = 0;
const BIGNUM *pub_key = NULL;
@@ -323,7 +323,7 @@ static int dsa_validate_public(DSA *dsa)
return dsa_check_pub_key(dsa, pub_key, &status);
}
-static int dsa_validate_private(DSA *dsa)
+static int dsa_validate_private(const DSA *dsa)
{
int status = 0;
const BIGNUM *priv_key = NULL;
@@ -334,9 +334,9 @@ static int dsa_validate_private(DSA *dsa)
return dsa_check_priv_key(dsa, priv_key, &status);
}
-static int dsa_validate(void *keydata, int selection)
+static int dsa_validate(const void *keydata, int selection)
{
- DSA *dsa = keydata;
+ const DSA *dsa = keydata;
int ok = 0;
if (!ossl_prov_is_running())
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c
index 9d76e1ceed..7e3fadc580 100644
--- a/providers/implementations/keymgmt/ec_kmgmt.c
+++ b/providers/implementations/keymgmt/ec_kmgmt.c
@@ -785,9 +785,9 @@ const OSSL_PARAM *sm2_settable_params(ossl_unused void *provctx)
#endif
static
-int ec_validate(void *keydata, int selection)
+int ec_validate(const void *keydata, int selection)
{
- EC_KEY *eck = keydata;
+ const EC_KEY *eck = keydata;
int ok = 0;
BN_CTX *ctx = NULL;
diff --git a/providers/implementations/keymgmt/rsa_kmgmt.c b/providers/implementations/keymgmt/rsa_kmgmt.c
index a37288a8b1..feee131328 100644
--- a/providers/implementations/keymgmt/rsa_kmgmt.c
+++ b/providers/implementations/keymgmt/rsa_kmgmt.c
@@ -357,9 +357,9 @@ static const OSSL_PARAM *rsa_gettable_params(void *provctx)
return rsa_params;
}
-static int rsa_validate(void *keydata, int selection)
+static int rsa_validate(const void *keydata, int selection)
{
- RSA *rsa = keydata;
+ const RSA *rsa = keydata;
int ok = 0;
if (!ossl_prov_is_running())