/* -*-c-*-
*
- * $Id: dsig.c,v 1.2 2000/07/01 11:27:22 mdw Exp $
+ * $Id: dsig.c,v 1.3 2000/07/15 20:53:23 mdw Exp $
*
* Verify signatures on distribuitions of files
*
/*----- Revision history --------------------------------------------------*
*
* $Log: dsig.c,v $
+ * Revision 1.3 2000/07/15 20:53:23 mdw
+ * More hash functions. Bug fix in getstring.
+ *
* Revision 1.2 2000/07/01 11:27:22 mdw
* Use new PKCS#1 padding functions rather than rolling by hand.
*
#include <mLib/report.h>
#include <mLib/sub.h>
-#include "dsa.h"
#include "getdate.h"
#include "grand.h"
#include "ghash.h"
#include "key.h"
#include "key-data.h"
-#include "md5.h"
#include "noise.h"
+
+#include "dsa.h"
+#include "rsa.h"
#include "pkcs1.h"
+
+#include "md4.h"
+#include "md5.h"
+#include "rmd128.h"
#include "rmd160.h"
-#include "rsa.h"
+#include "rmd256.h"
+#include "rmd320.h"
#include "sha.h"
+#include "tiger.h"
/*----- Digital signature algorithm ---------------------------------------*/
return (e);
}
sz = mp_octets(dp.dp.q);
+ if (sz < msz)
+ die(EXIT_FAILURE, "hash function too wide for this signing key");
DENSURE(d, sz * 2);
p = d->buf + d->len;
rand_get(RAND_GLOBAL, p, sz);
const void */*s*/, size_t /*ssz*/);
} sig;
-static const gchash *hashtab[] = { &rmd160, &sha, &md5, 0 };
+static const gchash *hashtab[] = {
+ &rmd160, &tiger, &sha, &rmd128, &rmd256, &rmd320, &md5, &md4, 0 };
static sig sigtab[] = {
{ "dsa", "dsig-dsa", dsasign, dsaverify },
{ "rsa", "dsig-rsa", rsasign, rsaverify },
if (ch == EOF)
break;
switch (ch) {
- case 'a': ch = '\n'; break;
+ case 'a': ch = '\a'; break;
case 'b': ch = '\b'; break;
case 'f': ch = '\f'; break;
case 'n': ch = '\n'; break;
case 'v': ch = '\v'; break;
}
DPUTC(d, ch);
+ ch = getc(fp);
continue;
}