From 2b91da968cec55de9d6db464c8c938d2930832e9 Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sat, 14 May 2016 08:59:16 +0200 Subject: [PATCH] Constify s2i_ASN1_INTEGER 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 | 4 ++-- crypto/x509v3/v3_utl.c | 2 +- include/openssl/x509v3.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/asn1/asn1_gen.c b/crypto/asn1/asn1_gen.c index a2e1c640db..0ad886c499 100644 --- a/crypto/asn1/asn1_gen.c +++ b/crypto/asn1/asn1_gen.c @@ -621,7 +621,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) goto bad_form; } if ((atmp->value.integer - = s2i_ASN1_INTEGER(NULL, (char *)str)) == NULL) { + = s2i_ASN1_INTEGER(NULL, str)) == NULL) { ASN1err(ASN1_F_ASN1_STR2TYPE, ASN1_R_ILLEGAL_INTEGER); goto bad_str; } @@ -694,7 +694,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) } if (format == ASN1_GEN_FORMAT_HEX) { - if ((rdata = OPENSSL_hexstr2buf((char *)str, &rdlen)) == NULL) { + if ((rdata = OPENSSL_hexstr2buf(str, &rdlen)) == NULL) { ASN1err(ASN1_F_ASN1_STR2TYPE, ASN1_R_ILLEGAL_HEX); goto bad_str; } diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 6fb672f89e..ad83de00ac 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -122,7 +122,7 @@ char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, ASN1_INTEGER *a) return strtmp; } -ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, char *value) +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value) { BIGNUM *bn = NULL; ASN1_INTEGER *aint; diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h index 299a114c70..a1274afe4f 100644 --- a/include/openssl/x509v3.h +++ b/include/openssl/x509v3.h @@ -610,7 +610,7 @@ int X509V3_add_value_bool(const char *name, int asn1_bool, int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, STACK_OF(CONF_VALUE) **extlist); char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); -ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); +ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value); char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); -- GitLab