~mdw
/
userv-utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New encrypting tunnel seems to work !
[userv-utils]
/
ipif
/
mech-pkcs5.c
diff --git
a/ipif/mech-pkcs5.c
b/ipif/mech-pkcs5.c
index
3603276
..
df4d918
100644
(file)
--- a/
ipif/mech-pkcs5.c
+++ b/
ipif/mech-pkcs5.c
@@
-7,7
+7,7
@@
* the number of bytes appended
*/
* the number of bytes appended
*/
-#include "
mech
.h"
+#include "
forwarder
.h"
struct mechdata {
unsigned mask;
struct mechdata {
unsigned mask;
@@
-21,7
+21,7
@@
static unsigned long setup(struct mechdata **md_r) {
blocksize= getarg_ulong();
md->mask= blocksize - 1;
blocksize= getarg_ulong();
md->mask= blocksize - 1;
- arg_assert(!
md->mask & blocksize
);
+ arg_assert(!
(md->mask & blocksize)
);
arg_assert(blocksize <= 255);
*md_r= md;
arg_assert(blocksize <= 255);
*md_r= md;
@@
-58,11
+58,11
@@
static const char *mdec_pkcs5(struct mechdata *md, struct buffer *buf) {
unsigned padlen;
int i;
unsigned padlen;
int i;
- BUF_UN
PRE
PEND(padp,buf,1);
+ BUF_UN
AP
PEND(padp,buf,1);
padlen= *padp;
padlen= *padp;
- if (!padlen || (padlen
& ~md->mask
)) return "invalid length";
+ if (!padlen || (padlen
> md->mask+1
)) return "invalid length";
- BUF_UN
PRE
PEND(padp,buf,padlen-1);
+ BUF_UN
AP
PEND(padp,buf,padlen-1);
for (i=0; i<padlen-1; i++)
if (*++padp != padlen) return "corrupted padding";
for (i=0; i<padlen-1; i++)
if (*++padp != padlen) return "corrupted padding";