summaryrefslogtreecommitdiffstats
path: root/crypto/ts/ts_rsp_sign.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-06-15 15:32:38 +0100
committerMatt Caswell <matt@openssl.org>2016-06-18 15:34:03 +0100
commitac94c8fdb9e8a36e616c80fa8c4aadb455144019 (patch)
treea5e35dbd815cabd2a3cf9b18e49e59be3c7dfbf3 /crypto/ts/ts_rsp_sign.c
parent98370c2dd7dc32cecd7bb7d940383846fa435f25 (diff)
Improve const correctness for stacks of EVP_MD
EVP_MDs are always const, so stacks of them should be too. This silences a warning about type punning on OpenBSD. RT4378 Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ts/ts_rsp_sign.c')
-rw-r--r--crypto/ts/ts_rsp_sign.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c
index a4acc9e837..8619cb5c90 100644
--- a/crypto/ts/ts_rsp_sign.c
+++ b/crypto/ts/ts_rsp_sign.c
@@ -223,7 +223,7 @@ int TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md)
if (ctx->mds == NULL
&& (ctx->mds = sk_EVP_MD_new_null()) == NULL)
goto err;
- if (!sk_EVP_MD_push(ctx->mds, (EVP_MD *)md))
+ if (!sk_EVP_MD_push(ctx->mds, md))
goto err;
return 1;
@@ -446,7 +446,7 @@ static int ts_RESP_check_request(TS_RESP_CTX *ctx)
X509_ALGOR *md_alg;
int md_alg_id;
const ASN1_OCTET_STRING *digest;
- EVP_MD *md = NULL;
+ const EVP_MD *md = NULL;
int i;
if (TS_REQ_get_version(request) != 1) {
@@ -460,7 +460,7 @@ static int ts_RESP_check_request(TS_RESP_CTX *ctx)
md_alg = msg_imprint->hash_algo;
md_alg_id = OBJ_obj2nid(md_alg->algorithm);
for (i = 0; !md && i < sk_EVP_MD_num(ctx->mds); ++i) {
- EVP_MD *current_md = sk_EVP_MD_value(ctx->mds, i);
+ const EVP_MD *current_md = sk_EVP_MD_value(ctx->mds, i);
if (md_alg_id == EVP_MD_type(current_md))
md = current_md;
}