Constification.
diff --git a/crypto/asn1/a_mbstr.c b/crypto/asn1/a_mbstr.c index 260c1af..ce413ec 100644 --- a/crypto/asn1/a_mbstr.c +++ b/crypto/asn1/a_mbstr.c
@@ -60,7 +60,7 @@ #include "cryptlib.h" #include <openssl/asn1.h> -static int traverse_string(unsigned char *p, int len, int inform, +static int traverse_string(const unsigned char *p, int len, int inform, int (*rfunc)(unsigned long value, void *in), void *arg); static int in_utf8(unsigned long value, void *arg); static int out_utf8(unsigned long value, void *arg); @@ -78,8 +78,8 @@ * Yes this is horrible: it has to be :-( */ -int ASN1_mbstring_copy(ASN1_STRING **out, unsigned char *in, int len, - int inform, unsigned long mask) +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask) { int str_type; int ret; @@ -206,7 +206,7 @@ * to an optional function along with a void * argument. */ -static int traverse_string(unsigned char *p, int len, int inform, +static int traverse_string(const unsigned char *p, int len, int inform, int (*rfunc)(unsigned long value, void *in), void *arg) { unsigned long value;
diff --git a/crypto/asn1/a_utf8.c b/crypto/asn1/a_utf8.c index 45434be..b5125af 100644 --- a/crypto/asn1/a_utf8.c +++ b/crypto/asn1/a_utf8.c
@@ -100,9 +100,9 @@ * -4 = character encoded incorrectly (not minimal length). */ -int UTF8_getc(unsigned char *str, int len, unsigned long *val) +int UTF8_getc(const unsigned char *str, int len, unsigned long *val) { - unsigned char *p; + const unsigned char *p; unsigned long value; int ret; if(len <= 0) return 0;
diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index 832611b..fb20073 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h
@@ -563,7 +563,7 @@ long length); -int UTF8_getc(unsigned char *str, int len, unsigned long *val); +int UTF8_getc(const unsigned char *str, int len, unsigned long *val); int UTF8_putc(unsigned char *str, int len, unsigned long value); int i2d_ASN1_PRINTABLE(ASN1_STRING *a,unsigned char **pp); @@ -718,7 +718,7 @@ int *len ); void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)()); ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct); -int ASN1_mbstring_copy(ASN1_STRING **out, unsigned char *in, int len, +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask); /* BEGIN ERROR CODES */