diff options
author | Adam Langley <alangley@gmail.com> | 2016-05-20 20:51:48 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2016-05-26 20:59:10 +0300 |
commit | d09175ffe335d9be6846b4ac5e9e622d96213a00 (patch) | |
tree | f4b68d43bbedb052902c3f0c87d581066ef4d519 /decrepit | |
parent | 1cb405d96b11db5767446766d76516534067bbd1 (diff) |
Replace base64 decoding.
This code has caused a long history of problems. This change rewrites it
completely with something that is, hopefully, much simplier and robust
and adds more testing.
Change-Id: Ibeef51f9386afd95d5b73316e451eb3a2d7ec4e0
Reviewed-on: https://boringssl-review.googlesource.com/8033
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'decrepit')
-rw-r--r-- | decrepit/bio/base64_bio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/decrepit/bio/base64_bio.c b/decrepit/bio/base64_bio.c index 2056138f..8415bfed 100644 --- a/decrepit/bio/base64_bio.c +++ b/decrepit/bio/base64_bio.c @@ -452,7 +452,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr) { case BIO_CTRL_WPENDING: /* More to write in buffer */ assert(ctx->buf_len >= ctx->buf_off); ret = ctx->buf_len - ctx->buf_off; - if ((ret == 0) && (ctx->encode != B64_NONE) && (ctx->base64.num != 0)) { + if ((ret == 0) && (ctx->encode != B64_NONE) && (ctx->base64.data_used != 0)) { ret = 1; } else if (ret <= 0) { ret = BIO_ctrl(b->next_bio, cmd, num, ptr); @@ -484,7 +484,7 @@ static long b64_ctrl(BIO *b, int cmd, long num, void *ptr) { ctx->tmp_len = 0; goto again; } - } else if (ctx->encode != B64_NONE && ctx->base64.num != 0) { + } else if (ctx->encode != B64_NONE && ctx->base64.data_used != 0) { ctx->buf_off = 0; EVP_EncodeFinal(&(ctx->base64), (uint8_t *)ctx->buf, &(ctx->buf_len)); /* push out the bytes */ |