summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/bio_b64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/bio_b64.c')
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 84729119df..bd5e24f993 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -69,6 +69,7 @@ static int b64_read(BIO *h,char *buf,int size);
69static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2);
70static int b64_new(BIO *h); 70static int b64_new(BIO *h);
71static int b64_free(BIO *data); 71static int b64_free(BIO *data);
72static long b64_callback_ctrl(BIO *h,int cmd,void (*fp)());
72#define B64_BLOCK_SIZE 1024 73#define B64_BLOCK_SIZE 1024
73#define B64_BLOCK_SIZE2 768 74#define B64_BLOCK_SIZE2 768
74#define B64_NONE 0 75#define B64_NONE 0
@@ -100,6 +101,7 @@ static BIO_METHOD methods_b64=
100 b64_ctrl, 101 b64_ctrl,
101 b64_new, 102 b64_new,
102 b64_free, 103 b64_free,
104 b64_callback_ctrl,
103 }; 105 };
104 106
105BIO_METHOD *BIO_f_base64(void) 107BIO_METHOD *BIO_f_base64(void)
@@ -237,8 +239,8 @@ static int b64_read(BIO *b, char *out, int outl)
237 &(ctx->tmp[0])); 239 &(ctx->tmp[0]));
238 for (x=0; x < i; x++) 240 for (x=0; x < i; x++)
239 ctx->tmp[x]=p[x]; 241 ctx->tmp[x]=p[x];
240 EVP_DecodeInit(&ctx->base64);
241 } 242 }
243 EVP_DecodeInit(&ctx->base64);
242 ctx->start=0; 244 ctx->start=0;
243 break; 245 break;
244 } 246 }
@@ -522,3 +524,17 @@ again:
522 return(ret); 524 return(ret);
523 } 525 }
524 526
527static long b64_callback_ctrl(BIO *b, int cmd, void (*fp)())
528 {
529 long ret=1;
530
531 if (b->next_bio == NULL) return(0);
532 switch (cmd)
533 {
534 default:
535 ret=BIO_callback_ctrl(b->next_bio,cmd,fp);
536 break;
537 }
538 return(ret);
539 }
540