Complete synchronization of aes-x86_64 with aes-586.
[openssl.git] / crypto / x509v3 / v3_utl.c
index 191cfef1a51127e855a8fc3acb84a9c07f68d10a..f1b5c94c2a2b4fdd7da336340b33094a1442cb0c 100644 (file)
@@ -71,7 +71,6 @@ static STACK *get_email(X509_NAME *name, GENERAL_NAMES *gens);
 static void str_free(void *str);
 static int append_ia5(STACK **sk, ASN1_IA5STRING *email);
 
-static int a2i_ipadd(unsigned char *ipout, const char *ipasc);
 static int ipv4_from_asc(unsigned char *v4, const char *in);
 static int ipv6_from_asc(unsigned char *v6, const char *in);
 static int ipv6_cb(const char *elem, int len, void *usr);
@@ -361,12 +360,12 @@ static char *strip_spaces(char *name)
  * @@@ (Contents of buffer are always kept in ASCII, also on EBCDIC machines)
  */
 
-char *hex_to_string(unsigned char *buffer, long len)
+char *hex_to_string(const unsigned char *buffer, long len)
 {
        char *tmp, *q;
-       unsigned char *p;
+       const unsigned char *p;
        int i;
-       static char hexdig[] = "0123456789ABCDEF";
+       const static char hexdig[] = "0123456789ABCDEF";
        if(!buffer || !len) return NULL;
        if(!(tmp = OPENSSL_malloc(len * 3 + 1))) {
                X509V3err(X509V3_F_HEX_TO_STRING,ERR_R_MALLOC_FAILURE);
@@ -390,7 +389,7 @@ char *hex_to_string(unsigned char *buffer, long len)
  * a buffer
  */
 
-unsigned char *string_to_hex(char *str, long *len)
+unsigned char *string_to_hex(const char *str, long *len)
 {
        unsigned char *hexbuf, *q;
        unsigned char ch, cl, *p;
@@ -615,7 +614,7 @@ ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc)
        }
        
 
-static int a2i_ipadd(unsigned char *ipout, const char *ipasc)
+int a2i_ipadd(unsigned char *ipout, const char *ipasc)
        {
        /* If string contains a ':' assume IPv6 */
 
@@ -826,13 +825,13 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
                                break;
                                }
 #ifndef CHARSET_EBCDIC
-                       if (*p == '+')
+               if (*type == '+')
 #else
-                       if (*p == os_toascii['+'])
+               if (*type == os_toascii['+'])
 #endif
                        {
                        mval = -1;
-                       p++;
+                       type++;
                        }
                else
                        mval = 0;