X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_ssl_gnutls.c;h=e160bd6afe0defda7992a8e2cb21321839344756;hp=69833283d8f00cfd0cf1fa9a5f90f4c2cda81a1f;hb=021836b3da95b9243e9f8386d87d220ab4f7f7b7;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index 6983328..e160bd6 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -1,19 +1,11 @@ -/* Copyright (C) 2001 Marco d'Itri +/* + * Copyright notice from original mutt: + * Copyright (C) 2001 Marco d'Itri * Copyright (C) 2001-2004 Andrew McDonald * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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, USA. + * This file is part of mutt-ng, see http://www.muttng.org/. + * It's licensed under the GNU General Public License, + * please see the file GPL in the top level source directory. */ #if HAVE_CONFIG_H @@ -31,7 +23,11 @@ #include "mutt_curses.h" #include "mutt_menu.h" #include "mutt_ssl.h" -#include "mutt_regex.h" + +#include "lib/mem.h" +#include "lib/str.h" +#include "lib/intl.h" +#include "lib/rx.h" typedef struct _tlssockdata { gnutls_session state; @@ -273,7 +269,7 @@ static int tls_socket_close (CONNECTION * conn) gnutls_certificate_free_credentials (data->xcred); gnutls_deinit (data->state); - safe_free ((void **) &conn->sockdata); + FREE(&conn->sockdata); } return raw_socket_close (conn); @@ -416,10 +412,10 @@ static int tls_check_stored_hostname (const gnutls_datum * cert, if (regexec (&preg, linestr, 3, pmatch, 0) == 0) { linestr[pmatch[1].rm_eo] = '\0'; linestr[pmatch[2].rm_eo] = '\0'; - if (strcmp (linestr + pmatch[1].rm_so, hostname) == 0 && - strcmp (linestr + pmatch[2].rm_so, buf) == 0) { + if (safe_strcmp (linestr + pmatch[1].rm_so, hostname) == 0 && + safe_strcmp (linestr + pmatch[2].rm_so, buf) == 0) { regfree (&preg); - safe_free ((void **) &linestr); + FREE(&linestr); fclose (fp); return 1; }