X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgpmicalg.c;h=6d2df9e7af551bf47ce0ddb92896bd4d80a71575;hp=e178bfac842f755aecb4c906c2d7792fc70d3e1b;hb=bad8211c28d4b229878e0264012009493db48da5;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/pgpmicalg.c b/pgpmicalg.c index e178bfa..6d2df9e 100644 --- a/pgpmicalg.c +++ b/pgpmicalg.c @@ -1,20 +1,10 @@ /* + * Copyright notice from original mutt: * Copyright (C) 2001 Thomas Roessler - * - * 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. */ /* This module peeks at a PGP signature and figures out the hash @@ -36,6 +26,8 @@ #include #include +#include "lib/debug.h" + static struct { short id; const char *name; @@ -83,8 +75,7 @@ static void pgp_dearmor (FILE * in, FILE * out) break; } if (r == NULL) { - dprint (1, - (debugfile, "pgp_dearmor: Can't find begin of ASCII armor.\n")); + debug_print (1, ("Can't find begin of ASCII armor.\n")); return; } @@ -96,7 +87,7 @@ static void pgp_dearmor (FILE * in, FILE * out) break; } if (r == NULL) { - dprint (1, (debugfile, "pgp_dearmor: Armor header doesn't end.\n")); + debug_print (1, ("Armor header doesn't end.\n")); return; } @@ -110,17 +101,17 @@ static void pgp_dearmor (FILE * in, FILE * out) break; } if (r == NULL) { - dprint (1, (debugfile, "pgp_dearmor: Can't find end of ASCII armor.\n")); + debug_print (1, ("Can't find end of ASCII armor.\n")); return; } - if ((end = ftell (in) - strlen (line)) < start) { - dprint (1, (debugfile, "pgp_dearmor: end < start???\n")); + if ((end = ftell (in) - mutt_strlen (line)) < start) { + debug_print (1, ("end < start???\n")); return; } if (fseek (in, start, SEEK_SET) == -1) { - dprint (1, (debugfile, "pgp_dearmor: Can't seekto start.\n")); + debug_print (1, ("Can't seekto start.\n")); return; } @@ -131,8 +122,7 @@ static short pgp_mic_from_packet (unsigned char *p, size_t len) { /* is signature? */ if ((p[0] & 0x3f) != PT_SIG) { - dprint (1, (debugfile, "pgp_mic_from_packet: tag = %d, want %d.\n", - p[0] & 0x3f, PT_SIG)); + debug_print (1, ("tag = %d, want %d.\n", p[0] & 0x3f, PT_SIG)); return -1; } @@ -143,7 +133,7 @@ static short pgp_mic_from_packet (unsigned char *p, size_t len) /* version 4 signature */ return (short) p[4]; else { - dprint (1, (debugfile, "pgp_mic_from_packet: Bad signature packet.\n")); + debug_print (1, ("Bad signature packet.\n")); return -1; } } @@ -179,7 +169,7 @@ static short pgp_find_hash (const char *fname) rv = pgp_mic_from_packet (p, l); } else { - dprint (1, (debugfile, "pgp_find_hash: No packet.\n")); + debug_print (1, ("No packet.\n")); } bye: