+ if (hfile) {
+ hfp.f = f;
+ hfp.fp = ifp;
+ hfp.ee = &encodingtab[ENC_HEX];
+ hfp.gch = GH_CLASS(s->h);
+ hfp.dline = &d;
+ hfp.dfile = &b.d;
+
+ n = 0;
+ for (;;) {
+ breset(&b);
+ DENSURE(&b.b, hfp.gch->hashsz);
+ hfp.hbuf = (octet *)b.b.buf;
+ if (ferror(ofp)) { f |= f_bogus; break; }
+ if ((hf = hfparse(&hfp)) == HF_EOF) break;
+ n++;
+
+ switch (hf) {
+ case HF_HASH:
+ if (hfp.gch != GH_CLASS(s->h)) {
+ moan("%s:%d: incorrect hash function `%s' (should be `%s')",
+ hfile, n, hfp.gch->name, GH_CLASS(s->h)->name);
+ f |= f_bogus;
+ }
+ break;
+ case HF_BAD:
+ moan("%s:%d: invalid hash-file line", hfile, n);
+ f |= f_bogus;
+ break;
+ case HF_FILE:
+ b.tag = T_FILE;
+ b.b.len += hfp.gch->hashsz;
+ bemit(&b, ofp, s->h, f & f_bin);
+ break;
+ }
+ }
+ } else {
+ for (;;) {