diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-03-21 19:44:35 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-03-21 19:44:35 +0000 |
commit | 38759710112896ba006f9764e275a6c98ab1cc03 (patch) | |
tree | 09dc1bb5c6dc6f92e6019a2149d81e33afe4ee2a | |
parent | 03e0b6488209cc4149c0602f183bd2f0aa3ae45f (diff) | |
download | gnutls-38759710112896ba006f9764e275a6c98ab1cc03.tar.gz |
Corrected behaviour when no certificate is got by the peer.
-rw-r--r-- | lib/gnutls_cert.c | 2 | ||||
-rw-r--r-- | lib/gnutls_x509.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c index 97c603bac0..d3093ebb88 100644 --- a/lib/gnutls_cert.c +++ b/lib/gnutls_cert.c @@ -393,7 +393,7 @@ int gnutls_certificate_verify_peers(GNUTLS_STATE state) info = _gnutls_get_auth_info(state); if (info == NULL) { gnutls_assert(); - return GNUTLS_E_INVALID_REQUEST; + return GNUTLS_E_NO_CERTIFICATE_FOUND; } if (info->raw_certificate_list == NULL || info->ncerts == 0) diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c index b0204a4e55..e6180ff16e 100644 --- a/lib/gnutls_x509.c +++ b/lib/gnutls_x509.c @@ -716,9 +716,11 @@ int _gnutls_x509_cert_verify_peers(GNUTLS_STATE state) CHECK_AUTH(GNUTLS_CRD_CERTIFICATE, GNUTLS_E_INVALID_REQUEST); info = _gnutls_get_auth_info(state); - if (info == NULL) + if (info == NULL) { + gnutls_assert(); return GNUTLS_E_INVALID_REQUEST; - + } + cred = _gnutls_get_cred(state->gnutls_key, GNUTLS_CRD_CERTIFICATE, NULL); if (cred == NULL) { gnutls_assert(); |