diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_print.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_print.c | 56 |
1 files changed, 11 insertions, 45 deletions
diff --git a/src/lib/libcrypto/asn1/a_print.c b/src/lib/libcrypto/asn1/a_print.c index 3023361dee..8035513f04 100644 --- a/src/lib/libcrypto/asn1/a_print.c +++ b/src/lib/libcrypto/asn1/a_print.c | |||
@@ -58,49 +58,9 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "asn1.h" | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | /* ASN1err(ASN1_F_D2I_ASN1_PRINT_TYPE,ASN1_R_WRONG_PRINTABLE_TYPE); | 63 | int ASN1_PRINTABLE_type(unsigned char *s, int len) |
64 | * ASN1err(ASN1_F_D2I_ASN1_PRINT_TYPE,ASN1_R_TAG_VALUE_TOO_HIGH); | ||
65 | */ | ||
66 | |||
67 | int i2d_ASN1_IA5STRING(a,pp) | ||
68 | ASN1_IA5STRING *a; | ||
69 | unsigned char **pp; | ||
70 | { return(M_i2d_ASN1_IA5STRING(a,pp)); } | ||
71 | |||
72 | ASN1_IA5STRING *d2i_ASN1_IA5STRING(a,pp,l) | ||
73 | ASN1_IA5STRING **a; | ||
74 | unsigned char **pp; | ||
75 | long l; | ||
76 | { return(M_d2i_ASN1_IA5STRING(a,pp,l)); } | ||
77 | |||
78 | ASN1_T61STRING *d2i_ASN1_T61STRING(a,pp,l) | ||
79 | ASN1_T61STRING **a; | ||
80 | unsigned char **pp; | ||
81 | long l; | ||
82 | { return(M_d2i_ASN1_T61STRING(a,pp,l)); } | ||
83 | |||
84 | ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(a,pp,l) | ||
85 | ASN1_PRINTABLESTRING **a; | ||
86 | unsigned char **pp; | ||
87 | long l; | ||
88 | { return(M_d2i_ASN1_PRINTABLESTRING(a,pp,l)); } | ||
89 | |||
90 | int i2d_ASN1_PRINTABLE(a,pp) | ||
91 | ASN1_STRING *a; | ||
92 | unsigned char **pp; | ||
93 | { return(M_i2d_ASN1_PRINTABLE(a,pp)); } | ||
94 | |||
95 | ASN1_STRING *d2i_ASN1_PRINTABLE(a,pp,l) | ||
96 | ASN1_STRING **a; | ||
97 | unsigned char **pp; | ||
98 | long l; | ||
99 | { return(M_d2i_ASN1_PRINTABLE(a,pp,l)); } | ||
100 | |||
101 | int ASN1_PRINTABLE_type(s,len) | ||
102 | unsigned char *s; | ||
103 | int len; | ||
104 | { | 64 | { |
105 | int c; | 65 | int c; |
106 | int ia5=0; | 66 | int ia5=0; |
@@ -112,6 +72,7 @@ int len; | |||
112 | while ((*s) && (len-- != 0)) | 72 | while ((*s) && (len-- != 0)) |
113 | { | 73 | { |
114 | c= *(s++); | 74 | c= *(s++); |
75 | #ifndef CHARSET_EBCDIC | ||
115 | if (!( ((c >= 'a') && (c <= 'z')) || | 76 | if (!( ((c >= 'a') && (c <= 'z')) || |
116 | ((c >= 'A') && (c <= 'Z')) || | 77 | ((c >= 'A') && (c <= 'Z')) || |
117 | (c == ' ') || | 78 | (c == ' ') || |
@@ -125,14 +86,20 @@ int len; | |||
125 | ia5=1; | 86 | ia5=1; |
126 | if (c&0x80) | 87 | if (c&0x80) |
127 | t61=1; | 88 | t61=1; |
89 | #else | ||
90 | if (!isalnum(c) && (c != ' ') && | ||
91 | strchr("'()+,-./:=?", c) == NULL) | ||
92 | ia5=1; | ||
93 | if (os_toascii[c] & 0x80) | ||
94 | t61=1; | ||
95 | #endif | ||
128 | } | 96 | } |
129 | if (t61) return(V_ASN1_T61STRING); | 97 | if (t61) return(V_ASN1_T61STRING); |
130 | if (ia5) return(V_ASN1_IA5STRING); | 98 | if (ia5) return(V_ASN1_IA5STRING); |
131 | return(V_ASN1_PRINTABLESTRING); | 99 | return(V_ASN1_PRINTABLESTRING); |
132 | } | 100 | } |
133 | 101 | ||
134 | int ASN1_UNIVERSALSTRING_to_string(s) | 102 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) |
135 | ASN1_UNIVERSALSTRING *s; | ||
136 | { | 103 | { |
137 | int i; | 104 | int i; |
138 | unsigned char *p; | 105 | unsigned char *p; |
@@ -158,4 +125,3 @@ ASN1_UNIVERSALSTRING *s; | |||
158 | s->type=ASN1_PRINTABLE_type(s->data,s->length); | 125 | s->type=ASN1_PRINTABLE_type(s->data,s->length); |
159 | return(1); | 126 | return(1); |
160 | } | 127 | } |
161 | |||