aboutsummaryrefslogtreecommitdiff
path: root/crypto/ts
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-07-31 19:38:09 +0200
committerRichard Levitte <levitte@openssl.org>2016-08-04 17:02:48 +0200
commitc47ba4e96c7aa9c2f741f8c89b6440ed2c13b91c (patch)
tree0057bcd12bc5ef5437bdfde700d573f6ff2b56d7 /crypto/ts
parentcfc5e0aa739abeb8861d2127ca31addcc1149a3e (diff)
downloadopenssl-c47ba4e96c7aa9c2f741f8c89b6440ed2c13b91c.zip
openssl-c47ba4e96c7aa9c2f741f8c89b6440ed2c13b91c.tar.gz
openssl-c47ba4e96c7aa9c2f741f8c89b6440ed2c13b91c.tar.bz2
Constify some ASN1_OBJECT *obj input parameters
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/ts')
-rw-r--r--crypto/ts/ts_req_utils.c4
-rw-r--r--crypto/ts/ts_rsp_sign.c4
-rw-r--r--crypto/ts/ts_rsp_utils.c2
-rw-r--r--crypto/ts/ts_rsp_verify.c12
4 files changed, 12 insertions, 10 deletions
diff --git a/crypto/ts/ts_req_utils.c b/crypto/ts/ts_req_utils.c
index a37cf84..2073d33 100644
--- a/crypto/ts/ts_req_utils.c
+++ b/crypto/ts/ts_req_utils.c
@@ -76,7 +76,7 @@ ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a)
return a->hashed_msg;
}
-int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy)
+int TS_REQ_set_policy_id(TS_REQ *a, const ASN1_OBJECT *policy)
{
ASN1_OBJECT *new_policy;
@@ -152,7 +152,7 @@ int TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos)
return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
}
-int TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos)
+int TS_REQ_get_ext_by_OBJ(TS_REQ *a, const ASN1_OBJECT *obj, int lastpos)
{
return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos);
}
diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c
index 8619cb5..aea7b92 100644
--- a/crypto/ts/ts_rsp_sign.c
+++ b/crypto/ts/ts_rsp_sign.c
@@ -173,7 +173,7 @@ int TS_RESP_CTX_set_signer_digest(TS_RESP_CTX *ctx, const EVP_MD *md)
return 1;
}
-int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy)
+int TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *def_policy)
{
ASN1_OBJECT_free(ctx->default_policy);
if ((ctx->default_policy = OBJ_dup(def_policy)) == NULL)
@@ -199,7 +199,7 @@ int TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs)
return 1;
}
-int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy)
+int TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, const ASN1_OBJECT *policy)
{
ASN1_OBJECT *copy = NULL;
diff --git a/crypto/ts/ts_rsp_utils.c b/crypto/ts/ts_rsp_utils.c
index 3747b5c..3ee9dae 100644
--- a/crypto/ts/ts_rsp_utils.c
+++ b/crypto/ts/ts_rsp_utils.c
@@ -313,7 +313,7 @@ int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos)
return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
}
-int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos)
+int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, const ASN1_OBJECT *obj, int lastpos)
{
return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos);
}
diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c
index 0916636..8ed973b 100644
--- a/crypto/ts/ts_rsp_verify.c
+++ b/crypto/ts/ts_rsp_verify.c
@@ -25,12 +25,13 @@ static int int_ts_RESP_verify_token(TS_VERIFY_CTX *ctx,
PKCS7 *token, TS_TST_INFO *tst_info);
static int ts_check_status_info(TS_RESP *response);
static char *ts_get_status_text(STACK_OF(ASN1_UTF8STRING) *text);
-static int ts_check_policy(ASN1_OBJECT *req_oid, TS_TST_INFO *tst_info);
+static int ts_check_policy(const ASN1_OBJECT *req_oid,
+ const TS_TST_INFO *tst_info);
static int ts_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
X509_ALGOR **md_alg,
unsigned char **imprint, unsigned *imprint_len);
static int ts_check_imprints(X509_ALGOR *algor_a,
- unsigned char *imprint_a, unsigned len_a,
+ const unsigned char *imprint_a, unsigned len_a,
TS_TST_INFO *tst_info);
static int ts_check_nonces(const ASN1_INTEGER *a, TS_TST_INFO *tst_info);
static int ts_check_signer_name(GENERAL_NAME *tsa_name, X509 *signer);
@@ -477,9 +478,10 @@ static char *ts_get_status_text(STACK_OF(ASN1_UTF8STRING) *text)
return result;
}
-static int ts_check_policy(ASN1_OBJECT *req_oid, TS_TST_INFO *tst_info)
+static int ts_check_policy(const ASN1_OBJECT *req_oid,
+ const TS_TST_INFO *tst_info)
{
- ASN1_OBJECT *resp_oid = tst_info->policy_id;
+ const ASN1_OBJECT *resp_oid = tst_info->policy_id;
if (OBJ_cmp(req_oid, resp_oid) != 0) {
TSerr(TS_F_TS_CHECK_POLICY, TS_R_POLICY_MISMATCH);
@@ -544,7 +546,7 @@ static int ts_compute_imprint(BIO *data, TS_TST_INFO *tst_info,
}
static int ts_check_imprints(X509_ALGOR *algor_a,
- unsigned char *imprint_a, unsigned len_a,
+ const unsigned char *imprint_a, unsigned len_a,
TS_TST_INFO *tst_info)
{
TS_MSG_IMPRINT *b = tst_info->msg_imprint;