/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2006 Hiroyuki Yamamoto
+ * This file Copyright (C) 2002-2005 Colin Leroy <colin@colino.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
cert->host, ".", port, ".cert", NULL);
g_free(port);
- fp = fopen(file, "wb");
+ fp = g_fopen(file, "wb");
if (fp == NULL) {
g_free(file);
debug_print("Can't save certificate !\n");
fingerprint,
(sig_status==NULL ? "correct":sig_status));
- if (issuer_commonname)
- g_free(issuer_commonname);
- if (issuer_location)
- g_free(issuer_location);
- if (issuer_organization)
- g_free(issuer_organization);
- if (subject_commonname)
- g_free(subject_commonname);
- if (subject_location)
- g_free(subject_location);
- if (subject_organization)
- g_free(subject_organization);
- if (fingerprint)
- g_free(fingerprint);
- if (sig_status)
- g_free(sig_status);
+ g_free(issuer_commonname);
+ g_free(issuer_location);
+ g_free(issuer_organization);
+ g_free(subject_commonname);
+ g_free(subject_location);
+ g_free(subject_organization);
+ g_free(fingerprint);
+ g_free(sig_status);
return ret;
}
if (cert->x509_cert)
X509_free(cert->x509_cert);
- if (cert->host)
- g_free(cert->host);
+ g_free(cert->host);
g_free(cert);
cert = NULL;
}
file = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
"certs", G_DIR_SEPARATOR_S,
cert->host, ".", buf, ".cert", NULL);
- unlink (file);
+ g_unlink (file);
g_free(buf);
g_free(file);
}
fqdn_host, ".", buf, ".cert", NULL);
g_free(buf);
- fp = fopen(file, "rb");
+ fp = g_fopen(file, "rb");
if (fp == NULL) {
g_free(file);
g_free(fqdn_host);
sig_status = ssl_certificate_check_signer(x509_cert);
-#if 0 /* disabled pref for now */
- if (sig_status == NULL && !prefs_common.ssl_ask_unknown_valid) {
- /* trust and accept silently if hostnames match */
- char *buf; /* don't free buf ! */
- if (X509_NAME_get_text_by_NID(X509_get_subject_name(x509_cert),
- NID_commonName, buf, 100) >= 0)
- if (!strcmp(buf, current_cert->host)) {
- g_free(sig_status);
- ssl_certificate_save(current_cert);
- ssl_certificate_destroy(current_cert);
- return TRUE;
- }
- }
-#endif
g_free(sig_status);
cur_cert_str = ssl_certificate_to_string(current_cert);
cur_cert_str);
g_free (cur_cert_str);
-#if 0 /* disabled for now */
- if (prefs_common.no_recv_err_panel) {
- log_error(_("%s\n\nMail won't be retrieved on this account until you save the certificate.\n(Uncheck the \"%s\" preference).\n"),
- err_msg,
- _("Don't popup error dialog on receive error"));
- g_free(err_msg);
- return FALSE;
- }
-#endif
cert_hook_data.cert = current_cert;
cert_hook_data.old_cert = NULL;
cert_hook_data.accept = FALSE;
g_free (cur_cert_str);
g_free (known_cert_str);
-#if 0
- if (prefs_common.no_recv_err_panel) {
- log_error(_("%s\n\nMail won't be retrieved on this account until you save the certificate.\n(Uncheck the \"%s\" preference).\n"),
- err_msg,
- _("Don't popup error dialog on receive error"));
- g_free(err_msg);
- return FALSE;
- }
-#endif
cert_hook_data.cert = current_cert;
cert_hook_data.old_cert = known_cert;
cert_hook_data.accept = FALSE;