- if (!(certerr_expired || certerr_notyetvalid ||
- certerr_hostname || certerr_nottrusted) && certstat == 0)
- {
- gnutls_x509_crt_deinit (cert);
+ if (*certerr == CERTERR_VALID && certstat == 0)
+ return 0;
+
+ return -1;
+}
+
+static int tls_check_one_certificate (const gnutls_datum_t *certdata,
+ gnutls_certificate_status certstat,
+ const char* hostname, int idx, int len)
+{
+ int certerr, savedcert;
+ gnutls_x509_crt cert;
+ char buf[SHORT_STRING];
+ char fpbuf[SHORT_STRING];
+ size_t buflen;
+ char dn_common_name[SHORT_STRING];
+ char dn_email[SHORT_STRING];
+ char dn_organization[SHORT_STRING];
+ char dn_organizational_unit[SHORT_STRING];
+ char dn_locality[SHORT_STRING];
+ char dn_province[SHORT_STRING];
+ char dn_country[SHORT_STRING];
+ time_t t;
+ char datestr[30];
+ MUTTMENU *menu;
+ char helpstr[LONG_STRING];
+ char title[STRING];
+ FILE *fp;
+ gnutls_datum pemdata;
+ int i, row, done, ret;
+
+ if (!tls_check_preauth (certdata, certstat, hostname, idx, &certerr,
+ &savedcert))