mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-19 18:15:18 -07:00
Check that a zero blocksize returns -1
This commit is contained in:
parent
a27c18d0e8
commit
0850e55808
@ -296,14 +296,16 @@ main(void)
|
|||||||
blocksize, bin_padded_maxlen - 1U) == -1);
|
blocksize, bin_padded_maxlen - 1U) == -1);
|
||||||
assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
|
assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
|
||||||
blocksize, bin_padded_maxlen + 1U) == 0);
|
blocksize, bin_padded_maxlen + 1U) == 0);
|
||||||
|
assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
|
||||||
|
0U, bin_padded_maxlen) == -1);
|
||||||
assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
|
assert(sodium_pad(&bin_padded_len, bin_padded, bin_len,
|
||||||
blocksize, bin_padded_maxlen) == 0);
|
blocksize, bin_padded_maxlen) == 0);
|
||||||
assert(bin_padded_len == bin_padded_maxlen);
|
assert(bin_padded_len == bin_padded_maxlen);
|
||||||
|
|
||||||
assert(sodium_unpad(&bin_len2, bin_padded, bin_padded_len,
|
|
||||||
0U) == -1);
|
|
||||||
assert(sodium_unpad(&bin_len2, bin_padded, bin_padded_len,
|
assert(sodium_unpad(&bin_len2, bin_padded, bin_padded_len,
|
||||||
bin_padded_len + 1U) == -1);
|
bin_padded_len + 1U) == -1);
|
||||||
|
assert(sodium_unpad(&bin_len2, bin_padded, bin_padded_len,
|
||||||
|
0U) == -1);
|
||||||
assert(sodium_unpad(&bin_len2, bin_padded, bin_padded_len,
|
assert(sodium_unpad(&bin_len2, bin_padded, bin_padded_len,
|
||||||
blocksize) == 0);
|
blocksize) == 0);
|
||||||
assert(bin_len2 == bin_len);
|
assert(bin_len2 == bin_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user