Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

use correct padding logic for block ciphers #37

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jwe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2259,7 +2259,7 @@ static void r_jwe_remove_padding(unsigned char * text, size_t * text_len, unsign
unsigned char pad = text[(*text_len)-1], i;
int pad_ok = 1;

if (pad && pad < (unsigned char)block_size) {
if (pad && pad <= (unsigned char)block_size) {
for (i=0; i<pad; i++) {
if (text[((*text_len)-i-1)] != pad) {
pad_ok = 0;
Expand Down
Loading