~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base/regdump.c: Dump ARM VFP/NEON registers with the correct source tag.
[catacomb]
/
progs
/
cookie.c
diff --git
a/progs/cookie.c
b/progs/cookie.c
index
56849e5
..
c6912ff
100644
(file)
--- a/
progs/cookie.c
+++ b/
progs/cookie.c
@@
-45,6
+45,7
@@
#include <mLib/sub.h>
#include "cc.h"
#include <mLib/sub.h>
#include "cc.h"
+#include "ct.h"
#include "key.h"
#include "gmac.h"
#include "getdate.h"
#include "key.h"
#include "gmac.h"
#include "getdate.h"
@@
-79,7
+80,7
@@
typedef struct cookie {
octet *_p = (octet *)(p); \
const cookie *_c = (c); \
STORE32(_p + 0, _c->k); \
octet *_p = (octet *)(p); \
const cookie *_c = (c); \
STORE32(_p + 0, _c->k); \
- STORE32(_p + 4, ((_c->exp & ~
MASK32) >> 16) >> 16);
\
+ STORE32(_p + 4, ((_c->exp & ~
(unsigned long)MASK32) >> 16) >> 16);
\
STORE32(_p + 8, _c->exp); \
} while (0)
STORE32(_p + 8, _c->exp); \
} while (0)
@@
-96,7
+97,8
@@
typedef struct cookie {
cookie *_c = (c); \
const octet *_p = (const octet *)(p); \
_c->k = LOAD32(_p + 0); \
cookie *_c = (c); \
const octet *_p = (const octet *)(p); \
_c->k = LOAD32(_p + 0); \
- _c->exp = ((time_t)(((LOAD32(_p + 4) << 16) << 16) & ~MASK32) | \
+ _c->exp = ((time_t)(((LOAD32(_p + 4) << 16) << 16) & \
+ ~(unsigned long)MASK32) | \
(time_t)LOAD32(_p + 8)); \
} while (0)
(time_t)LOAD32(_p + 8)); \
} while (0)
@@
-485,7
+487,7
@@
static int cmd_verify(int argc, char *argv[])
GH_HASH(h, argv[optind + 1], strlen(argv[optind + 1]));
t = GH_DONE(h, 0);
GH_HASH(h, argv[optind + 1], strlen(argv[optind + 1]));
t = GH_DONE(h, 0);
- if (
memcmp(t, d.buf + COOKIE_SZ, cbits / 8) != 0
) {
+ if (
!ct_memeq(t, d.buf + COOKIE_SZ, cbits / 8)
) {
if (v) printf("FAIL bad authentication token\n");
goto fail;
}
if (v) printf("FAIL bad authentication token\n");
goto fail;
}