diff options
author | Rob Percival <robpercival@google.com> | 2016-10-19 15:11:04 +0100 |
---|---|---|
committer | Rob Percival <robpercival@google.com> | 2016-11-16 13:43:36 +0000 |
commit | 70a06fc1a8b098e9934f837896159bfc6caf0228 (patch) | |
tree | 89073e6633a1a09c7bec27418fbb66a802c45c58 /crypto | |
parent | f7a39a5a3f7f91e0d1ba0030323eef26bc8ccddf (diff) | |
download | openssl-new-70a06fc1a8b098e9934f837896159bfc6caf0228.tar.gz |
Subtract padding from outlen in ct_base64_decode
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1548)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ct/ct_b64.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crypto/ct/ct_b64.c b/crypto/ct/ct_b64.c index d13d8f2af2..636ac4f5d2 100644 --- a/crypto/ct/ct_b64.c +++ b/crypto/ct/ct_b64.c @@ -45,6 +45,11 @@ static int ct_base64_decode(const char *in, unsigned char **out) goto err; } + /* Subtract padding bytes from |outlen| */ + while (in[--inlen] == '=') { + --outlen; + } + *out = outbuf; return outlen; err: |