From 12eaf3b8496f5e3578414202f7d26dc5cec2ee9a Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sat, 14 May 2016 22:23:55 +0200 Subject: [PATCH] Constify ASN1_generate_v3 Reviewed-by: Matt Caswell Reviewed-by: Kurt Roeckx Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1074) --- crypto/asn1/asn1_gen.c | 6 +++--- doc/crypto/ASN1_generate_nconf.pod | 2 +- include/openssl/asn1.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index 0ad886c499..2c7eb6a08e 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -62,7 +62,7 @@ typedef struct { int exp_count; } tag_exp_arg; -static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, +static ASN1_TYPE *generate_v3(const char *str, X509V3_CTX *cnf, int depth, int *perr); static int bitstr_cb(const char *elem, int len, void *bitstr); static int asn1_cb(const char *elem, int len, void *bitstr); @@ -86,7 +86,7 @@ ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf) return ASN1_generate_v3(str, &cnf); } -ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf) +ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf) { int err = 0; ASN1_TYPE *ret = generate_v3(str, cnf, 0, &err); @@ -95,7 +95,7 @@ ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf) return ret; } -static ASN1_TYPE *generate_v3(char *str, X509V3_CTX *cnf, int depth, +static ASN1_TYPE *generate_v3(const char *str, X509V3_CTX *cnf, int depth, int *perr) { ASN1_TYPE *ret; diff --git a/doc/crypto/ASN1_generate_nconf.pod b/doc/crypto/ASN1_generate_nconf.pod index d2e8a173a1..9ae98acf42 100644 --- a/doc/crypto/ASN1_generate_nconf.pod +++ b/doc/crypto/ASN1_generate_nconf.pod @@ -9,7 +9,7 @@ ASN1_generate_nconf, ASN1_generate_v3 - ASN1 generation functions #include ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); - ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); + ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); =head1 DESCRIPTION diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index a5961264a7..8f833a1aa4 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -799,7 +799,7 @@ void ASN1_add_oid_module(void); void ASN1_add_stable_module(void); ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); -ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); +ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); int ASN1_str2mask(const char *str, unsigned long *pmask); /* ASN1 Print flags */ -- 2.25.1