X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_ssl_gnutls.c;h=2b44e2611567026e0551d58caa0c4cf132415312;hp=a6e2cf46978405f774ad6126f1e7af2c960e99d0;hb=ae0ce4dfcafa0c3820f107c5bfa8bd06e5272b57;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index a6e2cf4..2b44e26 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -21,6 +21,9 @@ #endif #include +#include +#include +#include #include "mutt.h" #include "mutt_socket.h" @@ -28,9 +31,6 @@ #include "mutt_menu.h" #include "mutt_ssl.h" -#include "lib/mem.h" -#include "lib/str.h" -#include "lib/intl.h" #include "lib/rx.h" typedef struct _tlssockdata { @@ -159,7 +159,7 @@ static int tls_negotiate (CONNECTION * conn) tlssockdata *data; int err; - data = (tlssockdata *) mem_calloc (1, sizeof (tlssockdata)); + data = p_new(tlssockdata, 1); conn->sockdata = data; err = gnutls_certificate_allocate_credentials (&data->xcred); if (err < 0) { @@ -308,7 +308,7 @@ static int tls_compare_certificates (const gnutls_datum * peercert) return 0; b64_data.size = filestat.st_size + 1; - b64_data_data = (unsigned char *) mem_calloc (1, b64_data.size); + b64_data_data = p_new(unsigned char, b64_data.size); b64_data_data[b64_data.size - 1] = '\0'; b64_data.data = b64_data_data; @@ -416,8 +416,8 @@ 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 (str_cmp (linestr + pmatch[1].rm_so, hostname) == 0 && - str_cmp (linestr + pmatch[2].rm_so, buf) == 0) { + if (m_strcmp(linestr + pmatch[1].rm_so, hostname) == 0 && + m_strcmp(linestr + pmatch[2].rm_so, buf) == 0) { regfree (&preg); p_delete(&linestr); fclose (fp); @@ -587,9 +587,9 @@ static int tls_check_certificate (CONNECTION * conn) /* interactive check from user */ menu = mutt_new_menu (); menu->max = 25; - menu->dialog = (char **) mem_calloc (1, menu->max * sizeof (char *)); + menu->dialog = p_new(char*, menu->max); for (i = 0; i < menu->max; i++) - menu->dialog[i] = (char *) mem_calloc (1, SHORT_STRING * sizeof (char)); + menu->dialog[i] = p_new(char, SHORT_STRING); row = 0; strfcpy (menu->dialog[row], _("This certificate belongs to:"),