~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import release 0.1.12
[secnet]
/
transform.c
diff --git
a/transform.c
b/transform.c
index
a870449
..
dba0ef8
100644
(file)
--- a/
transform.c
+++ b/
transform.c
@@
-8,6
+8,7
@@
the packets sent over the wire. */
#include <stdio.h>
the packets sent over the wire. */
#include <stdio.h>
+#include <string.h>
#include "secnet.h"
#include "util.h"
#include "serpent.h"
#include "secnet.h"
#include "util.h"
#include "serpent.h"
@@
-53,7
+54,7
@@
static bool_t transform_setkey(void *sst, uint8_t *key, uint32_t keylen)
struct transform_inst *ti=sst;
if (keylen<REQUIRED_KEYLEN) {
struct transform_inst *ti=sst;
if (keylen<REQUIRED_KEYLEN) {
- Message(M_ERR
OR
,"transform_create: insufficient key material supplied "
+ Message(M_ERR,"transform_create: insufficient key material supplied "
"(need %d bytes, got %d)\n",REQUIRED_KEYLEN,keylen);
return False;
}
"(need %d bytes, got %d)\n",REQUIRED_KEYLEN,keylen);
return False;
}
@@
-308,10
+309,10
@@
static uint32_t transform_reverse(void *sst, struct buffer_if *buf,
is only allowed to increase. */
seqnum=buf_unprepend_uint32(buf);
skew=seqnum-ti->lastrecvseq;
is only allowed to increase. */
seqnum=buf_unprepend_uint32(buf);
skew=seqnum-ti->lastrecvseq;
- if (skew<
10
) {
+ if (skew<
0x8fffffff
) {
/* Ok */
ti->lastrecvseq=seqnum;
/* Ok */
ti->lastrecvseq=seqnum;
- } else if ((0-skew)<
10
) {
+ } else if ((0-skew)<
ti->max_skew
) {
/* Ok */
} else {
/* Too much skew */
/* Ok */
} else {
/* Too much skew */