~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/f25519.c: Fix spelling of `weird'.
[catacomb]
/
progs
/
catsign.c
diff --git
a/progs/catsign.c
b/progs/catsign.c
index
48f8fcb
..
3cce9c9
100644
(file)
--- a/
progs/catsign.c
+++ b/
progs/catsign.c
@@
-40,6
+40,7
@@
#include <mLib/base64.h>
#include <mLib/dstr.h>
#include <mLib/base64.h>
#include <mLib/dstr.h>
+#include <mLib/macros.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
#include <mLib/mdwopt.h>
#include <mLib/quis.h>
#include <mLib/report.h>
@@
-394,7
+395,6
@@
static void sigtobuffer(sigmsg *s, buf *b, int hashp)
static void dohash(ghash *h, const void *p, size_t n)
{
static void dohash(ghash *h, const void *p, size_t n)
{
-/* trace_block(1, "hashing", p, n); */
GH_HASH(h, p, n);
}
GH_HASH(h, p, n);
}
@@
-436,11
+436,12
@@
static void sig_writeheader(enc *e, sigmsg *s)
static void sig_writesig(enc *e, sigmsg *s)
{ chunk_write(e, s->sig.buf, s->sig.len); }
static void sig_writesig(enc *e, sigmsg *s)
{ chunk_write(e, s->sig.buf, s->sig.len); }
-static void diechoke(const char *m, void *p)
- { die(EXIT_FAILURE, "%s%s%s", p, p ? ": " : "", m); }
+static void
NORETURN
diechoke(const char *m, void *p)
+ { die(EXIT_FAILURE, "%s%s%s",
(const char *)
p, p ? ": " : "", m); }
static void sig_readheader(enc *e, sigmsg *s,
static void sig_readheader(enc *e, sigmsg *s,
- void (*choke)(const char *, void *), void *p)
+ void NORETURN (*choke)(const char *, void *),
+ void *p)
{
uint16 f;
octet bb[MSGBUFSZ];
{
uint16 f;
octet bb[MSGBUFSZ];
@@
-536,7
+537,7
@@
static int sign(int argc, char *argv[])
ofp = stdout;
else if ((ofp = fopen(of, eo->wmode)) == 0) {
die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
ofp = stdout;
else if ((ofp = fopen(of, eo->wmode)) == 0) {
die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
- of
p
, strerror(errno));
+ of, strerror(errno));
}
/* --- Start the work --- */
}
/* --- Start the work --- */
@@
-613,7
+614,7
@@
static int vrfbdry(const char *b, void *p)
return (0);
}
return (0);
}
-static void vrfchoke(const char *m, void *p)
+static void
NORETURN
vrfchoke(const char *m, void *p)
{
vrfctx *v = p;
if (v->verb) printf("FAIL %s: %s\n", v->what, m);
{
vrfctx *v = p;
if (v->verb) printf("FAIL %s: %s\n", v->what, m);
@@
-714,7
+715,7
@@
static int verify(int argc, char *argv[])
(unsigned long)s.keyid);
exit(EXIT_FAILURE);
}
(unsigned long)s.keyid);
exit(EXIT_FAILURE);
}
- if (kk && k
->id != kk->id
) {
+ if (kk && k
!= kk
) {
if (v.verb) {
dstr_reset(&d); key_fulltag(k, &d);
dstr_reset(&dd); key_fulltag(kk, &dd);
if (v.verb) {
dstr_reset(&d); key_fulltag(k, &d);
dstr_reset(&dd); key_fulltag(kk, &dd);
@@
-748,14
+749,14
@@
static int verify(int argc, char *argv[])
} else if (!of || strcmp(of, "-") == 0) {
v.f |= F_BUFFER;
ofp = stdout;
} else if (!of || strcmp(of, "-") == 0) {
v.f |= F_BUFFER;
ofp = stdout;
- }
- if (of && !(v.f & F_BUFFER)) {
+ } else if (of && !(v.f & F_BUFFER)) {
if ((ofp = fopen(of, (v.f & F_BINARY) ? "wb" : "w")) == 0) {
die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
of, strerror(errno));
}
rfp = ofp;
if ((ofp = fopen(of, (v.f & F_BINARY) ? "wb" : "w")) == 0) {
die(EXIT_FAILURE, "couldn't open file `%s' for output: %s",
of, strerror(errno));
}
rfp = ofp;
- } else if ((rfp = tmpfile()) == 0)
+ }
+ if ((v.f & F_BUFFER) && (rfp = tmpfile()) == 0)
die(EXIT_FAILURE, "couldn't create temporary file: %s", strerror(errno));
/* --- Read the message and verify the signature --- */
die(EXIT_FAILURE, "couldn't create temporary file: %s", strerror(errno));
/* --- Read the message and verify the signature --- */
@@
-984,7
+985,7
@@
static int format(int argc, char *argv[])
return (0);
}
return (0);
}
-static void infochoke(const char *m, void *p)
+static void
NORETURN
infochoke(const char *m, void *p)
{
vrfctx *v = p;
printf("BAD %s: %s\n", v->what, m);
{
vrfctx *v = p;
printf("BAD %s: %s\n", v->what, m);
@@
-1220,7
+1221,6
@@
int main(int argc, char *argv[])
sub_init();
rand_noisesrc(RAND_GLOBAL, &noise_source);
rand_seed(RAND_GLOBAL, 160);
sub_init();
rand_noisesrc(RAND_GLOBAL, &noise_source);
rand_seed(RAND_GLOBAL, 160);
-/* trace_on(stderr, 1); */
/* --- Parse options --- */
/* --- Parse options --- */