OpenSSL 1.1.1-pre2
This commit is contained in:
+10
-17
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
@@ -17,9 +17,6 @@
|
||||
static int b64_write(BIO *h, const char *buf, int num);
|
||||
static int b64_read(BIO *h, char *buf, int size);
|
||||
static int b64_puts(BIO *h, const char *str);
|
||||
/*
|
||||
* static int b64_gets(BIO *h, char *str, int size);
|
||||
*/
|
||||
static long b64_ctrl(BIO *h, int cmd, long arg1, void *arg2);
|
||||
static int b64_new(BIO *h);
|
||||
static int b64_free(BIO *data);
|
||||
@@ -49,7 +46,11 @@ typedef struct b64_struct {
|
||||
static const BIO_METHOD methods_b64 = {
|
||||
BIO_TYPE_BASE64,
|
||||
"base64 encoding",
|
||||
/* TODO: Convert to new style write function */
|
||||
bwrite_conv,
|
||||
b64_write,
|
||||
/* TODO: Convert to new style read function */
|
||||
bread_conv,
|
||||
b64_read,
|
||||
b64_puts,
|
||||
NULL, /* b64_gets, */
|
||||
@@ -113,7 +114,7 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
BIO *next;
|
||||
|
||||
if (out == NULL)
|
||||
return (0);
|
||||
return 0;
|
||||
ctx = (BIO_B64_CTX *)BIO_get_data(b);
|
||||
|
||||
next = BIO_next(b);
|
||||
@@ -288,14 +289,6 @@ static int b64_read(BIO *b, char *out, int outl)
|
||||
(unsigned char *)ctx->tmp, i);
|
||||
ctx->tmp_len = 0;
|
||||
}
|
||||
/*
|
||||
* If eof or an error was signalled, then the condition
|
||||
* 'ctx->cont <= 0' will prevent b64_read() from reading
|
||||
* more data on subsequent calls. This assignment was
|
||||
* deleted accidentally in commit 5562cfaca4f3.
|
||||
*/
|
||||
ctx->cont = i;
|
||||
|
||||
ctx->buf_off = 0;
|
||||
if (i < 0) {
|
||||
ret_code = 0;
|
||||
@@ -354,7 +347,7 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
i = BIO_write(next, &(ctx->buf[ctx->buf_off]), n);
|
||||
if (i <= 0) {
|
||||
BIO_copy_next_retry(b);
|
||||
return (i);
|
||||
return i;
|
||||
}
|
||||
OPENSSL_assert(i <= n);
|
||||
ctx->buf_off += i;
|
||||
@@ -367,7 +360,7 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
ctx->buf_len = 0;
|
||||
|
||||
if ((in == NULL) || (inl <= 0))
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
while (inl > 0) {
|
||||
n = (inl > B64_BLOCK_SIZE) ? B64_BLOCK_SIZE : inl;
|
||||
@@ -440,7 +433,7 @@ static int b64_write(BIO *b, const char *in, int inl)
|
||||
ctx->buf_len = 0;
|
||||
ctx->buf_off = 0;
|
||||
}
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static long b64_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
@@ -542,7 +535,7 @@ static long b64_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
|
||||
ret = BIO_callback_ctrl(next, cmd, fp);
|
||||
break;
|
||||
}
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int b64_puts(BIO *b, const char *str)
|
||||
|
||||
Reference in New Issue
Block a user