diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-01-09 08:29:56 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2003-01-09 08:29:56 +0000 |
commit | 1fe97a36ba1d398433c2a7f3f0eb2648295da3f6 (patch) | |
tree | 34eecc1d5fb77d1541d0962e805788b96450ed71 | |
parent | b307fcfd95068d4cca32ef8cbcc94582c4c2c426 (diff) | |
download | gnutls-1fe97a36ba1d398433c2a7f3f0eb2648295da3f6.tar.gz |
If the certificate does not contain the basicConstraints extension GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned by gnutls_x509_extract_certificate_ca_status().
-rw-r--r-- | lib/gnutls_x509.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index b6e1e8934f..921ca3ac85 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -697,6 +697,8 @@ int gnutls_x509_extract_certificate_subject_alt_name(const gnutls_datum * cert, * CA flag set. * * A negative value may be returned in case of parsing error. + * If the certificate does not contain the basicConstraints extension + * GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned. * **/ int gnutls_x509_extract_certificate_ca_status(const gnutls_datum * cert) @@ -710,17 +712,13 @@ int gnutls_x509_extract_certificate_ca_status(const gnutls_datum * cert) if ((result = _gnutls_get_extension(cert, "2 5 29 19", &basicConstraints)) < 0) { - if (result == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { - /* The extension does not exist so it's not a CA */ - return 0; - } gnutls_assert(); return result; } if (basicConstraints.size == 0 || basicConstraints.data==NULL) { gnutls_assert(); - return 0; + return GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE; } if ((result=_gnutls_asn1_create_element |