diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-02-19 14:45:24 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2014-02-19 14:45:24 +0100 |
commit | 21f5e9b4e016d070888a947803d3ad598728b469 (patch) | |
tree | 725c19869380b05f152d954569969e57ec3400f4 /lib | |
parent | a54c484db5cf78797b8db11472b636b95b1055d8 (diff) | |
download | gnutls-21f5e9b4e016d070888a947803d3ad598728b469.tar.gz |
_gnutls_x509_read_value() can now read empty values.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/x509/common.c | 6 | ||||
-rw-r--r-- | lib/x509/name_constraints.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c index 8bde558708..3c6f4221ad 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -1016,6 +1016,12 @@ _gnutls_x509_read_value(ASN1_TYPE c, const char *root, unsigned int etype; result = asn1_read_value_type(c, root, NULL, &len, &etype); + if (result == 0 && len == 0) { + ret->data = NULL; + ret->size = 0; + return 0; + } + if (result != ASN1_MEM_ERROR) { gnutls_assert(); result = _gnutls_asn2err(result); diff --git a/lib/x509/name_constraints.c b/lib/x509/name_constraints.c index b76e5e9552..d7f59cb9eb 100644 --- a/lib/x509/name_constraints.c +++ b/lib/x509/name_constraints.c @@ -70,8 +70,10 @@ static int extract_name_constraints(ASN1_TYPE c2, const char *vstr, ret = _gnutls_parse_general_name2(c2, tmpstr, -1, &tmp, &type, 0); - if (ret < 0) + if (ret < 0) { + gnutls_assert(); break; + } if (type != GNUTLS_SAN_DNSNAME && type != GNUTLS_SAN_RFC822NAME && type != GNUTLS_SAN_DN && type != GNUTLS_SAN_URI) { |