summaryrefslogtreecommitdiff
path: root/lib/x509/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/x509/common.c')
-rw-r--r--lib/x509/common.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c
index 13144ac175..f992b5e07b 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -219,7 +219,7 @@ int _gnutls_x509_oid_data2string(const char *oid, void *value,
*res_size = len;
} else { /* CHOICE */
str[len] = 0;
- int non_printable = 0;
+ int non_printable = 0, teletex = 0;
/* Note that we do not support strings other than
* UTF-8 (thus ASCII as well).
@@ -228,6 +228,9 @@ int _gnutls_x509_oid_data2string(const char *oid, void *value,
strcmp( str, "utf8String")!=0 ) {
non_printable = 1;
}
+ if (strcmp( str, "teletexString")==0)
+ teletex = 1;
+
_gnutls_str_cpy(tmpname, sizeof(tmpname), str);
@@ -241,6 +244,17 @@ int _gnutls_x509_oid_data2string(const char *oid, void *value,
asn1_delete_structure(&tmpasn);
+ if (teletex != 0) {
+ int ascii = 0, i;
+ /* HACK: if the teletex string contains only ascii
+ * characters then treat it as printable.
+ */
+ for(i=0;i<len;i++)
+ if(!isascii(str[i])) ascii=1;
+
+ if (ascii==0) non_printable = 0;
+ }
+
if (res) {
if (non_printable==0) {
str[len] = 0;
@@ -563,7 +577,7 @@ time_t _gnutls_x509_utcTime2gtime(const char *ttime)
/* returns a time value that contains the given time.
* The given time is expressed as:
- * YEAR(2)|MONTH(2)|DAY(2)|HOUR(2)|MIN(2)
+ * YEAR(2)|MONTH(2)|DAY(2)|HOUR(2)|MIN(2)|SEC(2)
*/
int _gnutls_x509_gtime2utcTime(time_t gtime, char *str_time,
int str_time_size)