$NetBSD: patch-ac,v 1.8 2013/01/17 15:55:31 joerg Exp $ --- wmbiff/tlsComm.c.orig 2004-10-11 00:29:47.000000000 +0000 +++ wmbiff/tlsComm.c @@ -385,16 +385,16 @@ int tls_check_certificate(struct connection_state *scs, const char *remote_hostname) { - int certstat; + int verify_ret, certstat; const gnutls_datum *cert_list; int cert_list_size = 0; gnutls_x509_crt cert; if (gnutls_auth_get_type(scs->tls_state) != GNUTLS_CRD_CERTIFICATE) { bad_certificate(scs, "Unable to get certificate from peer.\n"); - return; /* bad_cert will exit if -skip-certificate-check was not given */ + return 0; /* bad_cert will exit if -skip-certificate-check was not given */ } - certstat = gnutls_certificate_verify_peers(scs->tls_state); + verify_ret = gnutls_certificate_verify_peers2(scs->tls_state, &certstat); if (certstat == GNUTLS_E_NO_CERTIFICATE_FOUND) { bad_certificate(scs, "server presented no certificate.\n"); #ifdef GNUTLS_CERT_CORRUPTED @@ -412,10 +412,12 @@ tls_check_certificate(struct connection_ "server's certificate is invalid or not X.509.\n" "there may be a problem with the certificate stored in your certfile\n"); } +#ifdef GNUTLS_CERT_NOT_TRUSTED } else if (certstat & GNUTLS_CERT_NOT_TRUSTED) { TDM(DEBUG_INFO, "server's certificate is not trusted.\n"); TDM(DEBUG_INFO, "to verify that a certificate is trusted, use the certfile option.\n"); +#endif } if (gnutls_x509_crt_init(&cert) < 0) {