mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Fix test of first of 255 CBC padding bytes.
Thanks to Peter Gijsels for pointing out that if a CBC record has 255 bytes of padding, the first was not being checked. (This is an import of change 80842bdb from BoringSSL.) Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1431)
This commit is contained in:
parent
358558eba8
commit
eea8723cd0
@ -1149,9 +1149,9 @@ int tls1_cbc_remove_padding(const SSL *s,
|
|||||||
* maximum amount of padding possible. (Again, the length of the record
|
* maximum amount of padding possible. (Again, the length of the record
|
||||||
* is public information so we can use it.)
|
* is public information so we can use it.)
|
||||||
*/
|
*/
|
||||||
to_check = 255; /* maximum amount of padding. */
|
to_check = 256; /* maximum amount of padding, inc length byte. */
|
||||||
if (to_check > rec->length - 1)
|
if (to_check > rec->length)
|
||||||
to_check = rec->length - 1;
|
to_check = rec->length;
|
||||||
|
|
||||||
for (i = 0; i < to_check; i++) {
|
for (i = 0; i < to_check; i++) {
|
||||||
unsigned char mask = constant_time_ge_8(padding_length, i);
|
unsigned char mask = constant_time_ge_8(padding_length, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user