constify some print and ts functions
authorNils Larsch <nils@openssl.org>
Sun, 5 Mar 2006 20:19:05 +0000 (20:19 +0000)
committerNils Larsch <nils@openssl.org>
Sun, 5 Mar 2006 20:19:05 +0000 (20:19 +0000)
crypto/asn1/asn1.h
crypto/asn1/t_x509.c
crypto/ts/ts.h
crypto/ts/ts_lib.c
crypto/ts/ts_req_print.c
crypto/ts/ts_req_utils.c
crypto/ts/ts_rsp_print.c
crypto/ts/ts_rsp_sign.c
crypto/ts/ts_rsp_utils.c
crypto/ts/ts_rsp_verify.c
crypto/ts/ts_verify_ctx.c

index 9f6e1b99b3f5640df90a648ed84edc2ec7db53a6..24fa4362c32c723ec5df7579dfd0b44004e4bc6e 100644 (file)
@@ -940,10 +940,10 @@ int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x);
 #define ASN1_i2d_bio_of_const(type,i2d,out,x) \
        ((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
 int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
 #define ASN1_i2d_bio_of_const(type,i2d,out,x) \
        ((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
 int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
-int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
-int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
-int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
-int ASN1_STRING_print(BIO *bp,ASN1_STRING *v);
+int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
+int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
+int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
+int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
 int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
 int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent);
 int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump);
 int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
 int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent);
 int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump);
index 3d25335e547117008c92ce59e3676c691284abbc..7256866edab35eb74aae896f198c319c2a7a5c64 100644 (file)
@@ -329,14 +329,15 @@ int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig)
        return 1;
 }
 
        return 1;
 }
 
-int ASN1_STRING_print(BIO *bp, ASN1_STRING *v)
+int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v)
        {
        int i,n;
        {
        int i,n;
-       char buf[80],*p;;
+       char buf[80];
+       const char *p;
 
        if (v == NULL) return(0);
        n=0;
 
        if (v == NULL) return(0);
        n=0;
-       p=(char *)v->data;
+       p=(const char *)v->data;
        for (i=0; i<v->length; i++)
                {
                if ((p[i] > '~') || ((p[i] < ' ') &&
        for (i=0; i<v->length; i++)
                {
                if ((p[i] > '~') || ((p[i] < ' ') &&
@@ -358,7 +359,7 @@ int ASN1_STRING_print(BIO *bp, ASN1_STRING *v)
        return(1);
        }
 
        return(1);
        }
 
-int ASN1_TIME_print(BIO *bp, ASN1_TIME *tm)
+int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
 {
        if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);
        if(tm->type == V_ASN1_GENERALIZEDTIME)
 {
        if(tm->type == V_ASN1_UTCTIME) return ASN1_UTCTIME_print(bp, tm);
        if(tm->type == V_ASN1_GENERALIZEDTIME)
@@ -373,7 +374,7 @@ static const char *mon[12]=
     "Jul","Aug","Sep","Oct","Nov","Dec"
     };
 
     "Jul","Aug","Sep","Oct","Nov","Dec"
     };
 
-int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
+int ASN1_GENERALIZEDTIME_print(BIO *bp, const ASN1_GENERALIZEDTIME *tm)
        {
        char *v;
        int gmt=0;
        {
        char *v;
        int gmt=0;
@@ -420,15 +421,15 @@ err:
        return(0);
        }
 
        return(0);
        }
 
-int ASN1_UTCTIME_print(BIO *bp, ASN1_UTCTIME *tm)
+int ASN1_UTCTIME_print(BIO *bp, const ASN1_UTCTIME *tm)
        {
        {
-       char *v;
+       const char *v;
        int gmt=0;
        int i;
        int y=0,M=0,d=0,h=0,m=0,s=0;
 
        i=tm->length;
        int gmt=0;
        int i;
        int y=0,M=0,d=0,h=0,m=0,s=0;
 
        i=tm->length;
-       v=(char *)tm->data;
+       v=(const char *)tm->data;
 
        if (i < 10) goto err;
        if (v[i-1] == 'Z') gmt=1;
 
        if (i < 10) goto err;
        if (v[i-1] == 'Z') gmt=1;
index befdf4191d7d022b6f5272c29f0a58fc9ed393ea..d080f98ea922b6c090fb253e27f824e792c3cb06 100644 (file)
@@ -372,7 +372,7 @@ ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);
 void ERR_load_TS_strings(void);
 
 int TS_REQ_set_version(TS_REQ *a, long version);
 void ERR_load_TS_strings(void);
 
 int TS_REQ_set_version(TS_REQ *a, long version);
-long TS_REQ_get_version(TS_REQ *a);
+long TS_REQ_get_version(const TS_REQ *a);
 
 int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);
 TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);
 
 int TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);
 TS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);
@@ -386,11 +386,11 @@ ASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a);
 int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy);
 ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);
 
 int TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy);
 ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);
 
-int TS_REQ_set_nonce(TS_REQ *a, ASN1_INTEGER *nonce);
-ASN1_INTEGER *TS_REQ_get_nonce(TS_REQ *a);
+int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce);
+const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);
 
 int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
 
 int TS_REQ_set_cert_req(TS_REQ *a, int cert_req);
-int TS_REQ_get_cert_req(TS_REQ *a);
+int TS_REQ_get_cert_req(const TS_REQ *a);
 
 STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a);
 void TS_REQ_ext_free(TS_REQ *a);
 
 STACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a);
 void TS_REQ_ext_free(TS_REQ *a);
@@ -418,7 +418,7 @@ PKCS7 *TS_RESP_get_token(TS_RESP *a);
 TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a);
 
 int TS_TST_INFO_set_version(TS_TST_INFO *a, long version);
 TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a);
 
 int TS_TST_INFO_set_version(TS_TST_INFO *a, long version);
-long TS_TST_INFO_get_version(TS_TST_INFO *a);
+long TS_TST_INFO_get_version(const TS_TST_INFO *a);
 
 int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id);
 ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);
 
 int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id);
 ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);
@@ -426,29 +426,29 @@ ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);
 int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint);
 TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a);
 
 int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint);
 TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a);
 
-int TS_TST_INFO_set_serial(TS_TST_INFO *a, ASN1_INTEGER *serial);
-ASN1_INTEGER *TS_TST_INFO_get_serial(TS_TST_INFO *a);
+int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial);
+const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a);
 
 
-int TS_TST_INFO_set_time(TS_TST_INFO *a, ASN1_GENERALIZEDTIME *gtime);
-ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(TS_TST_INFO *a);
+int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime);
+const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a);
 
 int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy);
 TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a);
 
 
 int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy);
 TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a);
 
-int TS_ACCURACY_set_seconds(TS_ACCURACY *a, ASN1_INTEGER *seconds);
-ASN1_INTEGER *TS_ACCURACY_get_seconds(TS_ACCURACY *a);
+int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds);
+const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a);
 
 
-int TS_ACCURACY_set_millis(TS_ACCURACY *a, ASN1_INTEGER *millis);
-ASN1_INTEGER *TS_ACCURACY_get_millis(TS_ACCURACY *a);
+int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis);
+const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a);
 
 
-int TS_ACCURACY_set_micros(TS_ACCURACY *a, ASN1_INTEGER *micros);
-ASN1_INTEGER *TS_ACCURACY_get_micros(TS_ACCURACY *a);
+int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros);
+const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a);
 
 int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering);
 
 int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering);
-int TS_TST_INFO_get_ordering(TS_TST_INFO *a);
+int TS_TST_INFO_get_ordering(const TS_TST_INFO *a);
 
 
-int TS_TST_INFO_set_nonce(TS_TST_INFO *a, ASN1_INTEGER *nonce);
-ASN1_INTEGER *TS_TST_INFO_get_nonce(TS_TST_INFO *a);
+int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce);
+const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a);
 
 int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
 GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);
 
 int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);
 GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);
@@ -719,10 +719,10 @@ int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a);
 
 /* Common utility functions defined in ts/ts_lib.c */
 
 
 /* Common utility functions defined in ts/ts_lib.c */
 
-int TS_ASN1_INTEGER_print_bio(BIO *bio, ASN1_INTEGER *num);
-int TS_OBJ_print_bio(BIO *bio, ASN1_OBJECT *obj);
-int TS_ext_print_bio(BIO *bio, STACK_OF(X509_EXTENSION) *extensions);
-int TS_X509_ALGOR_print_bio(BIO *bio, X509_ALGOR *alg);
+int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num);
+int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj);
+int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions);
+int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg);
 int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg);
 
 /* Function declarations for handling configuration options,
 int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg);
 
 /* Function declarations for handling configuration options,
index a2ef4a4d9a29e064a3e284198f68191bf3b9ab3b..e8608dbf711e1611f4a7fbb2b3954c681782e792 100644 (file)
@@ -67,7 +67,7 @@
 
 /* Function definitions. */
 
 
 /* Function definitions. */
 
-int TS_ASN1_INTEGER_print_bio(BIO *bio, ASN1_INTEGER *num)
+int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num)
        {
        BIGNUM num_bn;
        int result = 0;
        {
        BIGNUM num_bn;
        int result = 0;
@@ -86,7 +86,7 @@ int TS_ASN1_INTEGER_print_bio(BIO *bio, ASN1_INTEGER *num)
        return result;
        }
 
        return result;
        }
 
-int TS_OBJ_print_bio(BIO *bio, ASN1_OBJECT *obj)
+int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj)
        {
        char obj_txt[128];
 
        {
        char obj_txt[128];
 
@@ -97,7 +97,7 @@ int TS_OBJ_print_bio(BIO *bio, ASN1_OBJECT *obj)
        return 1;
        }
 
        return 1;
        }
 
-int TS_ext_print_bio(BIO *bio, STACK_OF(X509_EXTENSION) *extensions)
+int TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions)
        {
        int i, critical, n;
        X509_EXTENSION *ex;
        {
        int i, critical, n;
        X509_EXTENSION *ex;
@@ -123,7 +123,7 @@ int TS_ext_print_bio(BIO *bio, STACK_OF(X509_EXTENSION) *extensions)
        return 1;
        }
 
        return 1;
        }
 
-int TS_X509_ALGOR_print_bio(BIO *bio, X509_ALGOR *alg)
+int TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg)
        {
        int i = OBJ_obj2nid(alg->algorithm);
        return BIO_printf(bio, "Hash Algorithm: %s\n",
        {
        int i = OBJ_obj2nid(alg->algorithm);
        return BIO_printf(bio, "Hash Algorithm: %s\n",
@@ -132,7 +132,7 @@ int TS_X509_ALGOR_print_bio(BIO *bio, X509_ALGOR *alg)
 
 int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *a)
        {
 
 int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *a)
        {
-       ASN1_OCTET_STRING *msg;
+       const ASN1_OCTET_STRING *msg;
 
        TS_X509_ALGOR_print_bio(bio, TS_MSG_IMPRINT_get_algo(a));
 
 
        TS_X509_ALGOR_print_bio(bio, TS_MSG_IMPRINT_get_algo(a));
 
index 8827f20d6599168cfa43e91b12ae4568f51ce258..eba12c38240821358d1dc5c01950657d4870e14b 100644 (file)
@@ -69,7 +69,7 @@ int TS_REQ_print_bio(BIO *bio, TS_REQ *a)
        {
        int v;
        ASN1_OBJECT *policy_id;
        {
        int v;
        ASN1_OBJECT *policy_id;
-       ASN1_INTEGER *nonce;
+       const ASN1_INTEGER *nonce;
 
        if (a == NULL) return 0;
 
 
        if (a == NULL) return 0;
 
index bf2ddfbd302076b4df6893785f12d9dbfccc2d7c..43280c15874e0f775e2f2977917ff78919901359 100644 (file)
@@ -67,7 +67,7 @@ int TS_REQ_set_version(TS_REQ *a, long version)
        return ASN1_INTEGER_set(a->version, version);
        }
 
        return ASN1_INTEGER_set(a->version, version);
        }
 
-long TS_REQ_get_version(TS_REQ *a)
+long TS_REQ_get_version(const TS_REQ *a)
        {
        return ASN1_INTEGER_get(a->version);
        }
        {
        return ASN1_INTEGER_get(a->version);
        }
@@ -148,7 +148,7 @@ ASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a)
        return a->policy_id;
        }
 
        return a->policy_id;
        }
 
-int TS_REQ_set_nonce(TS_REQ *a, ASN1_INTEGER *nonce)
+int TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce)
        {
        ASN1_INTEGER *new_nonce;
 
        {
        ASN1_INTEGER *new_nonce;
 
@@ -165,7 +165,7 @@ int TS_REQ_set_nonce(TS_REQ *a, ASN1_INTEGER *nonce)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_INTEGER *TS_REQ_get_nonce(TS_REQ *a)
+const ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a)
        {
        return a->nonce;
        }
        {
        return a->nonce;
        }
@@ -176,7 +176,7 @@ int TS_REQ_set_cert_req(TS_REQ *a, int cert_req)
        return 1;
        }
 
        return 1;
        }
 
-int TS_REQ_get_cert_req(TS_REQ *a)
+int TS_REQ_get_cert_req(const TS_REQ *a)
        {
        return a->cert_req ? 1 : 0;
        }
        {
        return a->cert_req ? 1 : 0;
        }
index 6421315e41b30b04aefd95d814ac48858b9c5213..21062517ba988ef5e538caa323aa662745d6b26f 100644 (file)
@@ -73,7 +73,7 @@ struct status_map_st
 
 static int TS_status_map_print(BIO *bio, struct status_map_st *a,
                               ASN1_BIT_STRING *v);
 
 static int TS_status_map_print(BIO *bio, struct status_map_st *a,
                               ASN1_BIT_STRING *v);
-static int TS_ACCURACY_print_bio(BIO *bio, TS_ACCURACY *accuracy);
+static int TS_ACCURACY_print_bio(BIO *bio, const TS_ACCURACY *accuracy);
 
 /* Function definitions. */
 
 
 /* Function definitions. */
 
@@ -184,10 +184,10 @@ int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a)
        {
        int v;
        ASN1_OBJECT *policy_id;
        {
        int v;
        ASN1_OBJECT *policy_id;
-       ASN1_INTEGER *serial;
-       ASN1_GENERALIZEDTIME *gtime;
+       const ASN1_INTEGER *serial;
+       const ASN1_GENERALIZEDTIME *gtime;
        TS_ACCURACY *accuracy;
        TS_ACCURACY *accuracy;
-       ASN1_INTEGER *nonce;
+       const ASN1_INTEGER *nonce;
        GENERAL_NAME *tsa_name;
 
        if (a == NULL) return 0;
        GENERAL_NAME *tsa_name;
 
        if (a == NULL) return 0;
@@ -261,11 +261,11 @@ int TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a)
        return 1;
        }
 
        return 1;
        }
 
-static int TS_ACCURACY_print_bio(BIO *bio, TS_ACCURACY *accuracy)
+static int TS_ACCURACY_print_bio(BIO *bio, const TS_ACCURACY *accuracy)
        {
        {
-       ASN1_INTEGER *seconds = TS_ACCURACY_get_seconds(accuracy);
-       ASN1_INTEGER *millis = TS_ACCURACY_get_millis(accuracy);
-       ASN1_INTEGER *micros = TS_ACCURACY_get_micros(accuracy);
+       const ASN1_INTEGER *seconds = TS_ACCURACY_get_seconds(accuracy);
+       const ASN1_INTEGER *millis = TS_ACCURACY_get_millis(accuracy);
+       const ASN1_INTEGER *micros = TS_ACCURACY_get_micros(accuracy);
 
        if (seconds != NULL)
                TS_ASN1_INTEGER_print_bio(bio, seconds);
 
        if (seconds != NULL)
                TS_ASN1_INTEGER_print_bio(bio, seconds);
index aa1b6370d9d4476cd1cb5711ed83ba77951e5c10..30b64984561378448ac2a06a354b2b6e4b70b260 100644 (file)
@@ -512,7 +512,7 @@ static int TS_RESP_check_request(TS_RESP_CTX *ctx)
        TS_MSG_IMPRINT *msg_imprint;
        X509_ALGOR *md_alg;
        int md_alg_id;
        TS_MSG_IMPRINT *msg_imprint;
        X509_ALGOR *md_alg;
        int md_alg_id;
-       ASN1_OCTET_STRING *digest;
+       const ASN1_OCTET_STRING *digest;
        EVP_MD *md = NULL;
        int i;
 
        EVP_MD *md = NULL;
        int i;
 
@@ -607,7 +607,7 @@ static TS_TST_INFO *TS_RESP_create_tst_info(TS_RESP_CTX *ctx,
        ASN1_GENERALIZEDTIME *asn1_time = NULL;
        long sec, usec;
        TS_ACCURACY *accuracy = NULL;
        ASN1_GENERALIZEDTIME *asn1_time = NULL;
        long sec, usec;
        TS_ACCURACY *accuracy = NULL;
-       ASN1_INTEGER *nonce;
+       const ASN1_INTEGER *nonce;
        GENERAL_NAME *tsa_name = NULL;
 
        if (!(tst_info = TS_TST_INFO_new())) goto end;
        GENERAL_NAME *tsa_name = NULL;
 
        if (!(tst_info = TS_TST_INFO_new())) goto end;
index 0c6c504a17e6d7de2acde03fa6878877516be72c..401c1fdc51d0d93e8a89ae23029f886f05150d3a 100644 (file)
@@ -112,7 +112,7 @@ int TS_TST_INFO_set_version(TS_TST_INFO *a, long version)
        return ASN1_INTEGER_set(a->version, version);
        }
 
        return ASN1_INTEGER_set(a->version, version);
        }
 
-long TS_TST_INFO_get_version(TS_TST_INFO *a)
+long TS_TST_INFO_get_version(const TS_TST_INFO *a)
        {
        return ASN1_INTEGER_get(a->version);
        }
        {
        return ASN1_INTEGER_get(a->version);
        }
@@ -161,7 +161,7 @@ TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a)
        return a->msg_imprint;
        }
 
        return a->msg_imprint;
        }
 
-int TS_TST_INFO_set_serial(TS_TST_INFO *a, ASN1_INTEGER *serial)
+int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial)
        {
        ASN1_INTEGER *new_serial;
 
        {
        ASN1_INTEGER *new_serial;
 
@@ -178,12 +178,12 @@ int TS_TST_INFO_set_serial(TS_TST_INFO *a, ASN1_INTEGER *serial)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_INTEGER *TS_TST_INFO_get_serial(TS_TST_INFO *a)
+const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a)
        {
        return a->serial;
        }
 
        {
        return a->serial;
        }
 
-int TS_TST_INFO_set_time(TS_TST_INFO *a, ASN1_GENERALIZEDTIME *gtime)
+int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime)
        {
        ASN1_GENERALIZEDTIME *new_time;
 
        {
        ASN1_GENERALIZEDTIME *new_time;
 
@@ -200,7 +200,7 @@ int TS_TST_INFO_set_time(TS_TST_INFO *a, ASN1_GENERALIZEDTIME *gtime)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(TS_TST_INFO *a)
+const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a)
        {
        return a->time;
        }
        {
        return a->time;
        }
@@ -227,7 +227,7 @@ TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a)
        return a->accuracy;
        }
 
        return a->accuracy;
        }
 
-int TS_ACCURACY_set_seconds(TS_ACCURACY *a, ASN1_INTEGER *seconds)
+int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds)
        {
        ASN1_INTEGER *new_seconds;
 
        {
        ASN1_INTEGER *new_seconds;
 
@@ -244,12 +244,12 @@ int TS_ACCURACY_set_seconds(TS_ACCURACY *a, ASN1_INTEGER *seconds)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_INTEGER *TS_ACCURACY_get_seconds(TS_ACCURACY *a)
+const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a)
        {
        return a->seconds;
        }
 
        {
        return a->seconds;
        }
 
-int TS_ACCURACY_set_millis(TS_ACCURACY *a, ASN1_INTEGER *millis)
+int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis)
        {
        ASN1_INTEGER *new_millis = NULL;
 
        {
        ASN1_INTEGER *new_millis = NULL;
 
@@ -270,12 +270,12 @@ int TS_ACCURACY_set_millis(TS_ACCURACY *a, ASN1_INTEGER *millis)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_INTEGER *TS_ACCURACY_get_millis(TS_ACCURACY *a)
+const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a)
        {
        return a->millis;
        }
 
        {
        return a->millis;
        }
 
-int TS_ACCURACY_set_micros(TS_ACCURACY *a, ASN1_INTEGER *micros)
+int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros)
        {
        ASN1_INTEGER *new_micros = NULL;
 
        {
        ASN1_INTEGER *new_micros = NULL;
 
@@ -296,7 +296,7 @@ int TS_ACCURACY_set_micros(TS_ACCURACY *a, ASN1_INTEGER *micros)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_INTEGER *TS_ACCURACY_get_micros(TS_ACCURACY *a)
+const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a)
        {
        return a->micros;
        }
        {
        return a->micros;
        }
@@ -307,12 +307,12 @@ int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering)
        return 1;
        }
 
        return 1;
        }
 
-int TS_TST_INFO_get_ordering(TS_TST_INFO *a)
+int TS_TST_INFO_get_ordering(const TS_TST_INFO *a)
        {
        return a->ordering ? 1 : 0;
        }
 
        {
        return a->ordering ? 1 : 0;
        }
 
-int TS_TST_INFO_set_nonce(TS_TST_INFO *a, ASN1_INTEGER *nonce)
+int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce)
        {
        ASN1_INTEGER *new_nonce;
 
        {
        ASN1_INTEGER *new_nonce;
 
@@ -329,7 +329,7 @@ int TS_TST_INFO_set_nonce(TS_TST_INFO *a, ASN1_INTEGER *nonce)
        return 1;
        }
 
        return 1;
        }
 
-ASN1_INTEGER *TS_TST_INFO_get_nonce(TS_TST_INFO *a)
+const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a)
        {
        return a->nonce;
        }
        {
        return a->nonce;
        }
index 8b57513b9482d77f92f8099e84cc45352c387752..dcc09bc16a4369dfbccf467d9ad208fbc34e83f2 100644 (file)
@@ -81,7 +81,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,
                             TS_TST_INFO *tst_info);
 static int TS_check_imprints(X509_ALGOR *algor_a, 
                             unsigned char *imprint_a, unsigned len_a,
                             TS_TST_INFO *tst_info);
-static int TS_check_nonces(ASN1_INTEGER *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);
 static int TS_find_name(STACK_OF(GENERAL_NAME) *gen_names, GENERAL_NAME *name);
 
 static int TS_check_signer_name(GENERAL_NAME *tsa_name, X509 *signer);
 static int TS_find_name(STACK_OF(GENERAL_NAME) *gen_names, GENERAL_NAME *name);
 
@@ -657,9 +657,9 @@ static int TS_check_imprints(X509_ALGOR *algor_a,
        return ret;
        }
 
        return ret;
        }
 
-static int TS_check_nonces(ASN1_INTEGER *a, TS_TST_INFO *tst_info)
+static int TS_check_nonces(const ASN1_INTEGER *a, TS_TST_INFO *tst_info)
        {
        {
-       ASN1_INTEGER *b = TS_TST_INFO_get_nonce(tst_info);
+       const ASN1_INTEGER *b = TS_TST_INFO_get_nonce(tst_info);
 
        /* Error if nonce is missing. */
        if (!b)
 
        /* Error if nonce is missing. */
        if (!b)
index ed0f819402be2708b6f74a92374af0494a910d69..b079b50fc3730b50cda783b17fff80b926979b10 100644 (file)
@@ -114,7 +114,7 @@ TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
        TS_MSG_IMPRINT *imprint;
        X509_ALGOR *md_alg;
        ASN1_OCTET_STRING *msg;
        TS_MSG_IMPRINT *imprint;
        X509_ALGOR *md_alg;
        ASN1_OCTET_STRING *msg;
-       ASN1_INTEGER *nonce;
+       const ASN1_INTEGER *nonce;
 
        assert(req != NULL);
        if (ret)
 
        assert(req != NULL);
        if (ret)