~mdw
/
udpkey
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 1.0.1.
[udpkey]
/
udpkey.c
diff --git
a/udpkey.c
b/udpkey.c
index
3341ff5
..
4d72079
100644
(file)
--- a/
udpkey.c
+++ b/
udpkey.c
@@
-59,6
+59,7
@@
#include <mLib/tv.h>
#include <catacomb/buf.h>
#include <mLib/tv.h>
#include <catacomb/buf.h>
+#include <catacomb/ct.h>
#include <catacomb/dh.h>
#include <catacomb/ec.h>
#include <catacomb/ec-keys.h>
#include <catacomb/dh.h>
#include <catacomb/ec.h>
#include <catacomb/ec-keys.h>
@@
-149,7
+150,7
@@
static int snarf(const char *name, void **p, size_t *sz)
* otherwise write to stderr. Don't use `%m' because that won't work when
* writing to stderr.
*/
* otherwise write to stderr. Don't use `%m' because that won't work when
* writing to stderr.
*/
-static void complain(int sev, const char *msg, ...)
+static void
PRINTF_LIKE(2, 3)
complain(int sev, const char *msg, ...)
{
va_list ap;
{
va_list ap;
@@
-364,7
+365,7
@@
found:
else {
tsz = atoi(q);
if (tsz <= 0 || tsz%8 || tsz/8 > k->mc->hashsz) {
else {
tsz = atoi(q);
if (tsz <= 0 || tsz%8 || tsz/8 > k->mc->hashsz) {
- complain(LOG_ERR, "bad tag size for mac `%s' in key %s",
+ complain(LOG_ERR, "bad tag size
`%s'
for mac `%s' in key %s",
q, k->mc->name, d.buf);
goto fail;
}
q, k->mc->name, d.buf);
goto fail;
}
@@
-1044,7
+1045,7
@@
static int doquery(int argc, char *argv[])
h = GM_INIT(m);
GH_HASH(h, p, n);
tt = GH_DONE(h, 0);
h = GM_INIT(m);
GH_HASH(h, p, n);
tt = GH_DONE(h, 0);
- if (
memcmp(t, tt, s->k.tagsz) != 0
) {
+ if (
!ct_memeq(t, tt, s->k.tagsz)
) {
moan("incorrect tag from %s:%d",
inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
goto again;
moan("incorrect tag from %s:%d",
inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
goto again;
@@
-1110,7
+1111,7
@@
static void usage(FILE *fp)
}
static void version(FILE *fp)
}
static void version(FILE *fp)
- { pquis(fp, "$, version " VERSION); }
+ { pquis(fp, "$, version " VERSION
"\n"
); }
static void help(FILE *fp)
{
static void help(FILE *fp)
{