From 213e565ffaaa420441d7a8d25f995358c5f9f30f Mon Sep 17 00:00:00 2001 From: mdw Date: Tue, 27 Sep 2005 17:52:53 +0000 Subject: [PATCH] Eliminate buggy clone-and-hack keyreport functions. --- catcrypt.c | 21 ++------------------- catsign.c | 23 ++--------------------- dsig.c | 21 ++------------------- 3 files changed, 6 insertions(+), 59 deletions(-) diff --git a/catcrypt.c b/catcrypt.c index 4c343a4..bbe4660 100644 --- a/catcrypt.c +++ b/catcrypt.c @@ -55,23 +55,6 @@ /*----- Utilities ---------------------------------------------------------*/ -/* --- @keyreport@ --- * - * - * Arguments: @const char *file@ = filename containing the error - * @int line@ = line number in file - * @const char *err@ = error text message - * @void *p@ = unimportant pointer - * - * Returns: --- - * - * Use: Reports errors during the opening of a key file. - */ - -static void keyreport(const char *file, int line, const char *err, void *p) -{ - moan("error in keyring `%s' at line `%s': %s", file, line, err); -} - /*----- Static variables --------------------------------------------------*/ static const char *keyring = "keyring"; @@ -195,7 +178,7 @@ static int encrypt(int argc, char *argv[]) if (argc - optind > 1 || (f & f_bogus)) die(EXIT_FAILURE, "Usage: encrypt [-OPTIONS] [FILE]"); - if (key_open(&kf, keyring, KOPEN_READ, keyreport, 0)) + if (key_open(&kf, keyring, KOPEN_READ, key_moan, 0)) die(EXIT_FAILURE, "can't open keyring `%s'", keyring); if ((k = key_bytag(&kf, kn)) == 0) die(EXIT_FAILURE, "key `%s' not found", kn); @@ -395,7 +378,7 @@ static int decrypt(int argc, char *argv[]) } else optind++; - if (key_open(&kf, keyring, KOPEN_READ, keyreport, 0)) + if (key_open(&kf, keyring, KOPEN_READ, key_moan, 0)) die(EXIT_FAILURE, "can't open keyring `%s'", keyring); e = initdec(eo, fp, checkbdry, "CATCRYPT ENCRYPTED MESSAGE"); diff --git a/catsign.c b/catsign.c index 3cea053..ce05618 100644 --- a/catsign.c +++ b/catsign.c @@ -56,25 +56,6 @@ #include "ectab.h" #include "ptab.h" -/*----- Utilities ---------------------------------------------------------*/ - -/* --- @keyreport@ --- * - * - * Arguments: @const char *file@ = filename containing the error - * @int line@ = line number in file - * @const char *err@ = error text message - * @void *p@ = unimportant pointer - * - * Returns: --- - * - * Use: Reports errors during the opening of a key file. - */ - -static void keyreport(const char *file, int line, const char *err, void *p) -{ - moan("error in keyring `%s' at line `%s': %s", file, line, err); -} - /*----- Static variables --------------------------------------------------*/ static const char *keyring = "keyring"; @@ -490,7 +471,7 @@ static int sign(int argc, char *argv[]) if (argc - optind > 1 || (f & F_BOGUS)) die(EXIT_FAILURE, "Usage: sign [-OPTIONS] [FILE]"); - if (key_open(&kf, keyring, KOPEN_READ, keyreport, 0)) + if (key_open(&kf, keyring, KOPEN_READ, key_moan, 0)) die(EXIT_FAILURE, "can't open keyring `%s'", keyring); if ((k = key_bytag(&kf, kn)) == 0) die(EXIT_FAILURE, "key `%s' not found", kn); @@ -657,7 +638,7 @@ static int verify(int argc, char *argv[]) } else optind++; - if (key_open(&kf, keyring, KOPEN_READ, keyreport, 0)) + if (key_open(&kf, keyring, KOPEN_READ, key_moan, 0)) die(EXIT_FAILURE, "can't open keyring `%s'", keyring); if (kn && (kk = key_bytag(&kf, kn)) == 0) die(EXIT_FAILURE, "key `%s' not found", kn); diff --git a/dsig.c b/dsig.c index c45d204..a8fc2f9 100644 --- a/dsig.c +++ b/dsig.c @@ -592,23 +592,6 @@ static const char *keyring = "keyring"; /*----- Other shared functions --------------------------------------------*/ -/* --- @keyreport@ --- * - * - * Arguments: @const char *file@ = filename containing the error - * @int line@ = line number in file - * @const char *err@ = error text message - * @void *p@ = unimportant pointer - * - * Returns: --- - * - * Use: Reports errors during the opening of a key file. - */ - -static void keyreport(const char *file, int line, const char *err, void *p) -{ - moan("error in keyring `%s' at line `%s': %s", file, line, err); -} - /* --- @fhash@ --- * * * Arguments: @const gchash *c@ = pointer to hash class @@ -746,7 +729,7 @@ static int sign(int argc, char *argv[]) /* --- Locate the signing key --- */ - if (key_open(&kf, keyring, KOPEN_WRITE, keyreport, 0)) + if (key_open(&kf, keyring, KOPEN_WRITE, key_moan, 0)) die(EXIT_FAILURE, "couldn't open keyring `%s'", keyring); if ((k = key_bytag(&kf, ki)) == 0) die(EXIT_FAILURE, "couldn't find key `%s'", ki); @@ -933,7 +916,7 @@ static int verify(int argc, char *argv[]) /* --- Open the key file, and start reading the input file --- */ - if (key_open(&kf, keyring, KOPEN_READ, keyreport, 0)) + if (key_open(&kf, keyring, KOPEN_READ, key_moan, 0)) die(EXIT_FAILURE, "couldn't open keyring `%s'\n", keyring); if (argc < 1) fp = stdin; -- 2.11.0