X-Git-Url: https://git.distorted.org.uk/~mdw/userv-utils/blobdiff_plain/76a30d074c1656141e57a3402805f07a1a5c90e8..8bb9d875e22b456711478e9d9972d458e8eb0d48:/ipif/mech-pkcs5.c diff --git a/ipif/mech-pkcs5.c b/ipif/mech-pkcs5.c index 6ff35cd..df4d918 100644 --- a/ipif/mech-pkcs5.c +++ b/ipif/mech-pkcs5.c @@ -58,11 +58,11 @@ static const char *mdec_pkcs5(struct mechdata *md, struct buffer *buf) { unsigned padlen; int i; - BUF_UNPREPEND(padp,buf,1); + BUF_UNAPPEND(padp,buf,1); padlen= *padp; - if (!padlen || (padlen & ~md->mask)) return "invalid length"; + if (!padlen || (padlen > md->mask+1)) return "invalid length"; - BUF_UNPREPEND(padp,buf,padlen-1); + BUF_UNAPPEND(padp,buf,padlen-1); for (i=0; i