OpenSSL 1.1.1-pre2
This commit is contained in:
+12
-34
@@ -16,12 +16,6 @@
|
||||
|
||||
static int enc_write(BIO *h, const char *buf, int num);
|
||||
static int enc_read(BIO *h, char *buf, int size);
|
||||
/*
|
||||
* static int enc_puts(BIO *h, const char *str);
|
||||
*/
|
||||
/*
|
||||
* static int enc_gets(BIO *h, char *str, int size);
|
||||
*/
|
||||
static long enc_ctrl(BIO *h, int cmd, long arg1, void *arg2);
|
||||
static int enc_new(BIO *h);
|
||||
static int enc_free(BIO *data);
|
||||
@@ -48,7 +42,11 @@ typedef struct enc_struct {
|
||||
static const BIO_METHOD methods_enc = {
|
||||
BIO_TYPE_CIPHER,
|
||||
"cipher",
|
||||
/* TODO: Convert to new style write function */
|
||||
bwrite_conv,
|
||||
enc_write,
|
||||
/* TODO: Convert to new style read function */
|
||||
bread_conv,
|
||||
enc_read,
|
||||
NULL, /* enc_puts, */
|
||||
NULL, /* enc_gets, */
|
||||
@@ -60,7 +58,7 @@ static const BIO_METHOD methods_enc = {
|
||||
|
||||
const BIO_METHOD *BIO_f_cipher(void)
|
||||
{
|
||||
return (&methods_enc);
|
||||
return &methods_enc;
|
||||
}
|
||||
|
||||
static int enc_new(BIO *bi)
|
||||
@@ -111,7 +109,7 @@ static int enc_read(BIO *b, char *out, int outl)
|
||||
BIO *next;
|
||||
|
||||
if (out == NULL)
|
||||
return (0);
|
||||
return 0;
|
||||
ctx = BIO_get_data(b);
|
||||
|
||||
next = BIO_next(b);
|
||||
@@ -251,7 +249,7 @@ static int enc_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;
|
||||
}
|
||||
ctx->buf_off += i;
|
||||
n -= i;
|
||||
@@ -259,7 +257,7 @@ static int enc_write(BIO *b, const char *in, int inl)
|
||||
/* at this point all pending data has been written */
|
||||
|
||||
if ((in == NULL) || (inl <= 0))
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
ctx->buf_off = 0;
|
||||
while (inl > 0) {
|
||||
@@ -289,7 +287,7 @@ static int enc_write(BIO *b, const char *in, int inl)
|
||||
ctx->buf_off = 0;
|
||||
}
|
||||
BIO_copy_next_retry(b);
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
@@ -384,7 +382,7 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
|
||||
ret = BIO_ctrl(next, cmd, num, ptr);
|
||||
break;
|
||||
}
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static long enc_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
|
||||
@@ -393,35 +391,15 @@ static long enc_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
|
||||
BIO *next = BIO_next(b);
|
||||
|
||||
if (next == NULL)
|
||||
return (0);
|
||||
return 0;
|
||||
switch (cmd) {
|
||||
default:
|
||||
ret = BIO_callback_ctrl(next, cmd, fp);
|
||||
break;
|
||||
}
|
||||
return (ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*-
|
||||
void BIO_set_cipher_ctx(b,c)
|
||||
BIO *b;
|
||||
EVP_CIPHER_ctx *c;
|
||||
{
|
||||
if (b == NULL) return;
|
||||
|
||||
if ((b->callback != NULL) &&
|
||||
(b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,0L) <= 0))
|
||||
return;
|
||||
|
||||
b->init=1;
|
||||
ctx=(BIO_ENC_CTX *)b->ptr;
|
||||
memcpy(ctx->cipher,c,sizeof(EVP_CIPHER_CTX));
|
||||
|
||||
if (b->callback != NULL)
|
||||
b->callback(b,BIO_CB_CTRL,(char *)c,BIO_CTRL_SET,e,1L);
|
||||
}
|
||||
*/
|
||||
|
||||
int BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,
|
||||
const unsigned char *i, int e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user