diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_print.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_print.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/a_print.c b/src/lib/libcrypto/asn1/a_print.c index 9eec5034e1..cfd0452f13 100644 --- a/src/lib/libcrypto/asn1/a_print.c +++ b/src/lib/libcrypto/asn1/a_print.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | int ASN1_PRINTABLE_type(const unsigned char *s, int len) | 63 | int ASN1_PRINTABLE_type(const unsigned char *s, int len) |
64 | { | 64 | { |
65 | int c; | 65 | int c; |
66 | int ia5=0; | 66 | int ia5=0; |
67 | int t61=0; | 67 | int t61=0; |
@@ -70,7 +70,7 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len) | |||
70 | if (s == NULL) return(V_ASN1_PRINTABLESTRING); | 70 | if (s == NULL) return(V_ASN1_PRINTABLESTRING); |
71 | 71 | ||
72 | while ((*s) && (len-- != 0)) | 72 | while ((*s) && (len-- != 0)) |
73 | { | 73 | { |
74 | c= *(s++); | 74 | c= *(s++); |
75 | if (!( ((c >= 'a') && (c <= 'z')) || | 75 | if (!( ((c >= 'a') && (c <= 'z')) || |
76 | ((c >= 'A') && (c <= 'Z')) || | 76 | ((c >= 'A') && (c <= 'Z')) || |
@@ -85,14 +85,14 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int len) | |||
85 | ia5=1; | 85 | ia5=1; |
86 | if (c&0x80) | 86 | if (c&0x80) |
87 | t61=1; | 87 | t61=1; |
88 | } | 88 | } |
89 | if (t61) return(V_ASN1_T61STRING); | 89 | if (t61) return(V_ASN1_T61STRING); |
90 | if (ia5) return(V_ASN1_IA5STRING); | 90 | if (ia5) return(V_ASN1_IA5STRING); |
91 | return(V_ASN1_PRINTABLESTRING); | 91 | return(V_ASN1_PRINTABLESTRING); |
92 | } | 92 | } |
93 | 93 | ||
94 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) | 94 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) |
95 | { | 95 | { |
96 | int i; | 96 | int i; |
97 | unsigned char *p; | 97 | unsigned char *p; |
98 | 98 | ||
@@ -100,20 +100,20 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) | |||
100 | if ((s->length%4) != 0) return(0); | 100 | if ((s->length%4) != 0) return(0); |
101 | p=s->data; | 101 | p=s->data; |
102 | for (i=0; i<s->length; i+=4) | 102 | for (i=0; i<s->length; i+=4) |
103 | { | 103 | { |
104 | if ((p[0] != '\0') || (p[1] != '\0') || (p[2] != '\0')) | 104 | if ((p[0] != '\0') || (p[1] != '\0') || (p[2] != '\0')) |
105 | break; | 105 | break; |
106 | else | 106 | else |
107 | p+=4; | 107 | p+=4; |
108 | } | 108 | } |
109 | if (i < s->length) return(0); | 109 | if (i < s->length) return(0); |
110 | p=s->data; | 110 | p=s->data; |
111 | for (i=3; i<s->length; i+=4) | 111 | for (i=3; i<s->length; i+=4) |
112 | { | 112 | { |
113 | *(p++)=s->data[i]; | 113 | *(p++)=s->data[i]; |
114 | } | 114 | } |
115 | *(p)='\0'; | 115 | *(p)='\0'; |
116 | s->length/=4; | 116 | s->length/=4; |
117 | s->type=ASN1_PRINTABLE_type(s->data,s->length); | 117 | s->type=ASN1_PRINTABLE_type(s->data,s->length); |
118 | return(1); | 118 | return(1); |
119 | } | 119 | } |