diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/asn1/a_mbstr.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/a_mbstr.c b/src/lib/libcrypto/asn1/a_mbstr.c index 6528161c41..b59d84910f 100644 --- a/src/lib/libcrypto/asn1/a_mbstr.c +++ b/src/lib/libcrypto/asn1/a_mbstr.c | |||
@@ -89,8 +89,7 @@ ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, | |||
89 | 89 | ||
90 | int | 90 | int |
91 | ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, | 91 | ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, |
92 | int inform, unsigned long mask, | 92 | int inform, unsigned long mask, long minsize, long maxsize) |
93 | long minsize, long maxsize) | ||
94 | { | 93 | { |
95 | int str_type; | 94 | int str_type; |
96 | int ret; | 95 | int ret; |
@@ -109,7 +108,6 @@ ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, | |||
109 | 108 | ||
110 | /* First do a string check and work out the number of characters */ | 109 | /* First do a string check and work out the number of characters */ |
111 | switch (inform) { | 110 | switch (inform) { |
112 | |||
113 | case MBSTRING_BMP: | 111 | case MBSTRING_BMP: |
114 | if (len & 1) { | 112 | if (len & 1) { |
115 | ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, | 113 | ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, |
@@ -264,6 +262,7 @@ traverse_string(const unsigned char *p, int len, int inform, | |||
264 | { | 262 | { |
265 | unsigned long value; | 263 | unsigned long value; |
266 | int ret; | 264 | int ret; |
265 | |||
267 | while (len) { | 266 | while (len) { |
268 | if (inform == MBSTRING_ASC) { | 267 | if (inform == MBSTRING_ASC) { |
269 | value = *p++; | 268 | value = *p++; |
@@ -280,8 +279,9 @@ traverse_string(const unsigned char *p, int len, int inform, | |||
280 | len -= 4; | 279 | len -= 4; |
281 | } else { | 280 | } else { |
282 | ret = UTF8_getc(p, len, &value); | 281 | ret = UTF8_getc(p, len, &value); |
283 | if (ret < 0) return -1; | 282 | if (ret < 0) |
284 | len -= ret; | 283 | return -1; |
284 | len -= ret; | ||
285 | p += ret; | 285 | p += ret; |
286 | } | 286 | } |
287 | if (rfunc) { | 287 | if (rfunc) { |
@@ -301,6 +301,7 @@ static int | |||
301 | in_utf8(unsigned long value, void *arg) | 301 | in_utf8(unsigned long value, void *arg) |
302 | { | 302 | { |
303 | int *nchar; | 303 | int *nchar; |
304 | |||
304 | nchar = arg; | 305 | nchar = arg; |
305 | (*nchar)++; | 306 | (*nchar)++; |
306 | return 1; | 307 | return 1; |
@@ -312,6 +313,7 @@ static int | |||
312 | out_utf8(unsigned long value, void *arg) | 313 | out_utf8(unsigned long value, void *arg) |
313 | { | 314 | { |
314 | int *outlen; | 315 | int *outlen; |
316 | |||
315 | outlen = arg; | 317 | outlen = arg; |
316 | *outlen += UTF8_putc(NULL, -1, value); | 318 | *outlen += UTF8_putc(NULL, -1, value); |
317 | return 1; | 319 | return 1; |
@@ -408,8 +410,10 @@ is_printable(unsigned long value) | |||
408 | { | 410 | { |
409 | int ch; | 411 | int ch; |
410 | 412 | ||
411 | if (value > 0x7f) return 0; | 413 | if (value > 0x7f) |
412 | ch = (int)value; | 414 | return 0; |
415 | ch = (int)value; | ||
416 | |||
413 | /* Note: we can't use 'isalnum' because certain accented | 417 | /* Note: we can't use 'isalnum' because certain accented |
414 | * characters may count as alphanumeric in some environments. | 418 | * characters may count as alphanumeric in some environments. |
415 | */ | 419 | */ |