progs/cc-sig.c: Initialize hash context properly for RSA-PSS.
[catacomb] / progs / cc-sig.c
index bbc2300..14f5e10 100644 (file)
@@ -182,6 +182,7 @@ static sig *rsapss_siginit(key *k, void *kd, const gchash *hc)
 {
   rsapss_sigctx *rs = CREATE(rsapss_sigctx);
   rsa_privcreate(&rs->rp, kd, &rand_global);
+  rs->s.h = 0;
   rs->p.r = &rand_global;
   rs->p.cc = getmgf(k, hc);
   rs->p.ch = hc;
@@ -232,6 +233,7 @@ static sig *rsapss_vrfinit(key *k, void *kd, const gchash *hc)
 {
   rsapss_vrfctx *rv = CREATE(rsapss_vrfctx);
   rsa_pubcreate(&rv->rp, kd);
+  rv->s.h = 0;
   rv->p.r = &rand_global;
   rv->p.cc = getmgf(k, hc);
   rv->p.ch = hc;