summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-02-21 01:45:14 +0100
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>2018-02-26 19:39:43 +0100
commitb3f9b401ab6284e6bbde59dde06736f681f70a9d (patch)
treebf3f4fe2c9dac85d92321ef250e6794f21d46e96 /doc
parent37e62cee3ee50983ecad88813ec11b326efb123a (diff)
bio_b64.c: prevent base64 filter BIO from decoding out-of-bound data
Fixes #5405, #1381 The base64 filter BIO reads its input in chunks of B64_BLOCK_SIZE bytes. When processing input in PEM format it can happen in rare cases that - the trailing PEM marker crosses the boundary of a chunk, and - the beginning of the following chunk contains valid base64 encoded data. This happened in issue #5405, where the PEM marker was split into "-----END CER" and "TIFICATE-----" at the end of the first chunk. The decoding of the first chunk terminated correctly at the '-' character, which is treated as an EOF marker, and b64_read() returned. However, when called the second time, b64_read() read the next chunk and interpreted the string "TIFICATE" as valid base64 encoded data, adding 6 extra bytes '4c 81 48 08 04 c4'. This patch restores the assignment of the error code to 'ctx->cont', which was deleted accidentally in commit 5562cfaca4f3 and which prevents b64_read() from reading additional data on subsequent calls. This issue was observed and reported by Annie Yousar. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5422)
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions