diff options
Diffstat (limited to 'lib/x509/common.c')
-rw-r--r-- | lib/x509/common.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c index d94761517a..c2585ee3fd 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2003-2014 Free Software Foundation, Inc. + * Copyright (C) 2015-2016 Red Hat, Inc. * * Author: Nikos Mavrogiannopoulos * @@ -32,7 +33,6 @@ #include "x509_int.h" #include "extras/hex.h" #include <common.h> -#include <c-ctype.h> static int data2hex(const void *data, size_t data_size, @@ -284,7 +284,6 @@ make_printable_string(unsigned etype, const gnutls_datum_t * input, { int printable = 0; int ret; - unsigned int i; if (etype == ASN1_ETYPE_BMP_STRING) { ret = _gnutls_ucs2_to_utf8(input->data, input->size, out, 1); @@ -294,15 +293,10 @@ make_printable_string(unsigned etype, const gnutls_datum_t * input, } else printable = 1; } else if (etype == ASN1_ETYPE_TELETEX_STRING) { - int ascii = 0; /* HACK: if the teletex string contains only ascii * characters then treat it as printable. */ - for (i = 0; i < input->size; i++) - if (!c_isprint(input->data[i])) - ascii = 1; - - if (ascii == 0) { + if (_gnutls_str_is_print((char*)input->data, input->size)) { out->data = gnutls_malloc(input->size + 1); if (out->data == NULL) return |