Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2014-06-20 23:00:00 +0400
committerAdam Langley <agl@chromium.org>2014-06-21 00:17:36 +0400
commit64bda23cad8cb912a55328ee9a298ca4d9795477 (patch)
tree406439eb423a12f59482a5358e2760632571d2aa /crypto/base64
parentc3174b7b2d3b4517b597dc3e0d0db18a718d6ab5 (diff)
Base64 padding fix.
https://rt.openssl.org/Ticket/Display.html?id=2608 Previously, this input to the base64 code: ================================================================================- Would cause the output length of EVP_DecodeUpdate to be negative. When that happened in the base64 BIO, it would crash. In PEM decoding, the ASN.1 code actually maintains signed lengths and manages to simply error out!
Diffstat (limited to 'crypto/base64')
-rw-r--r--crypto/base64/base64.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/base64/base64.c b/crypto/base64/base64.c
index fb9aa366..94c3055c 100644
--- a/crypto/base64/base64.c
+++ b/crypto/base64/base64.c
@@ -250,6 +250,11 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, int *out_len,
seof = n;
}
eof++;
+ if (eof > 2) {
+ /* There are, at most, two equals signs at the end of base64 data. */
+ rv = -1;
+ goto end;
+ }
}
if (v == B64_CR) {