Codebase list libcryptx-perl / 1a455d6
libtomcrypt fixes Karel Miko 5 years ago
3 changed file(s) with 4 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
2828 #endif
2929 unsigned char mask = 0xff; /* initialize mask at all ones */
3030
31 if (src == NULL || dest == NULL) return;
31 LTC_ARGCHKVD(src != NULL);
32 LTC_ARGCHKVD(dest != NULL);
3233
3334 if (coz != 0) coz = 1;
3435 y = 0;
3535 if (type < LTC_PAD_ONE_AND_ZERO) {
3636 pad = data[padded_length - 1];
3737
38 if (pad > padded_length) return CRYPT_INVALID_ARG;
38 if (pad > padded_length || pad == 0) return CRYPT_INVALID_ARG;
3939
4040 unpadded_length = padded_length - pad;
4141 } else {
116116 is(unpack("H*", $pt2), $t->{msg}, "$testname PT-v");
117117 }
118118 elsif ($result eq 'invalid') {
119 SKIP: {
120 skip "ltc bug CBC/PAD", 1 if $comment eq "bit padding"; #XXX-FIXME
121 skip "ltc bug CBC/PAD", 1 if $comment eq "zero padding"; #XXX-FIXME
122 is($pt2, undef, "$testname PT-i");
123 }
119 is($pt2, undef, "$testname PT-i");
124120 }
125121 else {
126122 ok(0, "UNEXPECTED result=$result");