chiark
/
gitweb
/
~ian
/
userv-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto debugging, and several bugfixes
[userv-utils.git]
/
ipif
/
mech-blowfish.c
diff --git
a/ipif/mech-blowfish.c
b/ipif/mech-blowfish.c
index 07ec8c13cd89f463ede1271c0b7258aa80d4ffed..7447cadb1d888a3ccd729f897c720ba9e5ca0018 100644
(file)
--- a/
ipif/mech-blowfish.c
+++ b/
ipif/mech-blowfish.c
@@
-22,7
+22,7
@@
static void mds_blowfish(struct mechdata **md_r) {
unsigned char iv[BLOWFISH_BLOCKBYTES];
unsigned char key[BLOWFISH_MAXKEYBYTES];
unsigned char iv[BLOWFISH_BLOCKBYTES];
unsigned char key[BLOWFISH_MAXKEYBYTES];
-
md= xmalloc(sizeof(md)
);
+
XMALLOC(md
);
keysize= getarg_ulong();
arg_assert(!(keysize & 7));
keysize= getarg_ulong();
arg_assert(!(keysize & 7));
@@
-53,18
+53,20
@@
static void mes_bfmac(struct mechdata **md_r, int *maxprefix_io, int *maxsuffix_
#define MSGSIZE_OUT \
msgsize= buf->size; \
#define MSGSIZE_OUT \
msgsize= buf->size; \
- arg_assert(!(msgsize &
~BLOWFISH_BLOCKBYTES
));
+ arg_assert(!(msgsize &
(BLOWFISH_BLOCKBYTES-1)
));
#define MSGSIZE_IN \
msgsize= buf->size; \
#define MSGSIZE_IN \
msgsize= buf->size; \
- if (msgsize &
~BLOWFISH_BLOCKBYTES
) return "not multiple of block size"
+ if (msgsize &
(BLOWFISH_BLOCKBYTES-1)
) return "not multiple of block size"
#define FOREACH_BLOCK(func,inptr,outptr) \
{ \
unsigned char *ptr; \
#define FOREACH_BLOCK(func,inptr,outptr) \
{ \
unsigned char *ptr; \
- ptr= buf->start; \
- while (ptr < buf->start + msgsize) \
+ for (ptr= buf->start; \
+ ptr < buf->start + msgsize; \
+ ptr += BLOWFISH_BLOCKBYTES) { \
func(&md->cbc,inptr,outptr); \
func(&md->cbc,inptr,outptr); \
+ } \
}
static void menc_blowfish(struct mechdata *md, struct buffer *buf) {
}
static void menc_blowfish(struct mechdata *md, struct buffer *buf) {