X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/59919ae4b1721ca271c3d3e5955c09d322573821..e9026a0a6d8fc5cbcfa8d658176bfd2776cb550e:/dsig.c?ds=sidebyside diff --git a/dsig.c b/dsig.c index c5eb5af..6a67990 100644 --- a/dsig.c +++ b/dsig.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: dsig.c,v 1.7 2001/02/23 09:04:17 mdw Exp $ + * $Id: dsig.c,v 1.8 2004/04/04 19:42:59 mdw Exp $ * * Verify signatures on distribuitions of files * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: dsig.c,v $ + * Revision 1.8 2004/04/04 19:42:59 mdw + * Add set -e. + * * Revision 1.7 2001/02/23 09:04:17 mdw * Add new hash functions. Provide full help for subcommands. Run the * hash function over parts of the header in a canonical order. @@ -83,19 +86,6 @@ #include "rsa.h" #include "pkcs1.h" -#include "md2.h" -#include "md4.h" -#include "md5.h" -#include "rmd128.h" -#include "rmd160.h" -#include "rmd256.h" -#include "rmd320.h" -#include "sha.h" -#include "sha256.h" -#include "sha384.h" -#include "sha512.h" -#include "tiger.h" - /*----- Digital signature algorithm ---------------------------------------*/ static int dsasign(key *k, const void *m, size_t msz, dstr *d) @@ -206,9 +196,6 @@ typedef struct sig { const void */*s*/, size_t /*ssz*/); } sig; -static const gchash *hashtab[] = { - &rmd160, &tiger, &sha, &sha256, &sha384, &sha512, - &rmd128, &rmd256, &rmd320, &md5, &md4, &md2, 0 }; static sig sigtab[] = { { "dsa", "dsig-dsa", dsasign, dsaverify }, { "rsa", "dsig-rsa", rsasign, rsaverify }, @@ -226,9 +213,9 @@ static sig sigtab[] = { static const gchash *gethash(const char *name) { - const gchash **g, *gg = 0; + const gchash *const *g, *gg = 0; size_t sz = strlen(name); - for (g = hashtab; *g; g++) { + for (g = ghashtab; *g; g++) { if (strncmp(name, (*g)->name, sz) == 0) { if ((*g)->name[sz] == 0) { gg = *g;