diff options
author | Simon Josefsson <simon@josefsson.org> | 2005-08-24 10:07:13 +0000 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2005-08-24 10:07:13 +0000 |
commit | 185be60255b2a8b121e01d2e8fd78e51d10a1437 (patch) | |
tree | 5b547fde69c57cefe1e0a6ec735ea5dfdbc485dd /src/common.c | |
parent | e1d9b5853f24f71b600594a7f81bcf2b1169c399 (diff) | |
download | gnutls-185be60255b2a8b121e01d2e8fd78e51d10a1437.tar.gz |
Use gnutls_certificate_verify_peers2, suggested by Daniel Stenberg
<daniel@haxx.se>.
Diffstat (limited to 'src/common.c')
-rw-r--r-- | src/common.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/common.c b/src/common.c index 571aa48396..8feb8e7cb6 100644 --- a/src/common.c +++ b/src/common.c @@ -410,20 +410,21 @@ void print_openpgp_info(gnutls_session session, const char *hostname) void print_cert_vrfy(gnutls_session session) { + int status, rc; - int status; - status = gnutls_certificate_verify_peers(session); + rc = gnutls_certificate_verify_peers2(session, &status); printf("\n"); + if (rc < 0) { + printf("- Could not verify certificate (err: %s)\n", + gnutls_strerror(status)); + return; + } + if (status == GNUTLS_E_NO_CERTIFICATE_FOUND) { printf("- Peer did not send any certificate.\n"); return; } - if (status < 0) { - printf("- Could not verify certificate (err: %s)\n", - gnutls_strerror(status)); - return; - } if (gnutls_certificate_type_get(session) == GNUTLS_CRT_X509) { if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) |