chiark
/
gitweb
/
~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
site: Prepare for adding more MSG3 variants
[secnet]
/
transform-eax.c
diff --git
a/transform-eax.c
b/transform-eax.c
index 5a7bd640d71517abc611d11d06644961c2c8db98..04cd0e65d7648b28c4f0afd29437c53d139156de 100644
(file)
--- a/
transform-eax.c
+++ b/
transform-eax.c
@@
-7,7
+7,7
@@
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version
d
of the License, or
+ * the Free Software Foundation; either version
3
of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
@@
-167,8
+167,8
@@
static void transform_delkey(void *sst)
ti->keyed=False;
}
ti->keyed=False;
}
-static
uint32_t transform_forward(void *sst, struct buffer_if *buf
,
-
const char **errmsg)
+static
transform_apply_return transform_forward(void *sst
,
+
struct buffer_if *buf,
const char **errmsg)
{
struct transform_inst *ti=sst;
{
struct transform_inst *ti=sst;
@@
-205,8
+205,8
@@
static uint32_t transform_forward(void *sst, struct buffer_if *buf,
return 0;
}
return 0;
}
-static
uint32_t transform_reverse(void *sst, struct buffer_if *buf
,
-
const char **errmsg)
+static
transform_apply_return transform_reverse(void *sst
,
+
struct buffer_if *buf,
const char **errmsg)
{
struct transform_inst *ti=sst;
{
struct transform_inst *ti=sst;
@@
-233,7
+233,7
@@
static uint32_t transform_reverse(void *sst, struct buffer_if *buf,
if (!ok) {
TEAX_DEBUG(0,0);
*errmsg="EAX decryption failed";
if (!ok) {
TEAX_DEBUG(0,0);
*errmsg="EAX decryption failed";
- return
1
;
+ return
transform_apply_err
;
}
assert(buf->size >= (int)ti->p.tag_length);
buf->size -= ti->p.tag_length;
}
assert(buf->size >= (int)ti->p.tag_length);
buf->size -= ti->p.tag_length;
@@
-256,7
+256,7
@@
static uint32_t transform_reverse(void *sst, struct buffer_if *buf,
too_short:
*errmsg="ciphertext or plaintext too short";
too_short:
*errmsg="ciphertext or plaintext too short";
- return
1
;
+ return
transform_apply_err
;
}
static struct transform_inst_if *transform_create(void *sst)
}
static struct transform_inst_if *transform_create(void *sst)
@@
-290,7
+290,7
@@
static list_t *transform_apply(closure_t *self, struct cloc loc,
cfgfatal(loc,"eax-serpent","parameter must be a dictionary\n");
dict=item->data.dict;
cfgfatal(loc,"eax-serpent","parameter must be a dictionary\n");
dict=item->data.dict;
- SET_CAPAB_
TRANSFORMNUM(CAPAB_TRANSFORMNUM
_EAXSERPENT);
+ SET_CAPAB_
BIT(CAPAB_BIT
_EAXSERPENT);
SEQNUM_PARAMS_INIT(dict,&st->p,"eax-serpent",loc);
SEQNUM_PARAMS_INIT(dict,&st->p,"eax-serpent",loc);