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.c39
1 files changed, 8 insertions, 31 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 73172b9a07..84729119df 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -59,10 +59,9 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <errno.h> 60#include <errno.h>
61#include "cryptlib.h" 61#include "cryptlib.h"
62#include "buffer.h" 62#include <openssl/buffer.h>
63#include "evp.h" 63#include <openssl/evp.h>
64 64
65#ifndef NOPROTO
66static int b64_write(BIO *h,char *buf,int num); 65static int b64_write(BIO *h,char *buf,int num);
67static int b64_read(BIO *h,char *buf,int size); 66static int b64_read(BIO *h,char *buf,int size);
68/*static int b64_puts(BIO *h,char *str); */ 67/*static int b64_puts(BIO *h,char *str); */
@@ -70,16 +69,6 @@ static int b64_read(BIO *h,char *buf,int size);
70static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2); 69static long b64_ctrl(BIO *h,int cmd,long arg1,char *arg2);
71static int b64_new(BIO *h); 70static int b64_new(BIO *h);
72static int b64_free(BIO *data); 71static int b64_free(BIO *data);
73#else
74static int b64_write();
75static int b64_read();
76/*static int b64_puts(); */
77/*static int b64_gets(); */
78static long b64_ctrl();
79static int b64_new();
80static int b64_free();
81#endif
82
83#define B64_BLOCK_SIZE 1024 72#define B64_BLOCK_SIZE 1024
84#define B64_BLOCK_SIZE2 768 73#define B64_BLOCK_SIZE2 768
85#define B64_NONE 0 74#define B64_NONE 0
@@ -113,13 +102,12 @@ static BIO_METHOD methods_b64=
113 b64_free, 102 b64_free,
114 }; 103 };
115 104
116BIO_METHOD *BIO_f_base64() 105BIO_METHOD *BIO_f_base64(void)
117 { 106 {
118 return(&methods_b64); 107 return(&methods_b64);
119 } 108 }
120 109
121static int b64_new(bi) 110static int b64_new(BIO *bi)
122BIO *bi;
123 { 111 {
124 BIO_B64_CTX *ctx; 112 BIO_B64_CTX *ctx;
125 113
@@ -140,8 +128,7 @@ BIO *bi;
140 return(1); 128 return(1);
141 } 129 }
142 130
143static int b64_free(a) 131static int b64_free(BIO *a)
144BIO *a;
145 { 132 {
146 if (a == NULL) return(0); 133 if (a == NULL) return(0);
147 Free(a->ptr); 134 Free(a->ptr);
@@ -151,10 +138,7 @@ BIO *a;
151 return(1); 138 return(1);
152 } 139 }
153 140
154static int b64_read(b,out,outl) 141static int b64_read(BIO *b, char *out, int outl)
155BIO *b;
156char *out;
157int outl;
158 { 142 {
159 int ret=0,i,ii,j,k,x,n,num,ret_code=0; 143 int ret=0,i,ii,j,k,x,n,num,ret_code=0;
160 BIO_B64_CTX *ctx; 144 BIO_B64_CTX *ctx;
@@ -354,10 +338,7 @@ int outl;
354 return((ret == 0)?ret_code:ret); 338 return((ret == 0)?ret_code:ret);
355 } 339 }
356 340
357static int b64_write(b,in,inl) 341static int b64_write(BIO *b, char *in, int inl)
358BIO *b;
359char *in;
360int inl;
361 { 342 {
362 int ret=inl,n,i; 343 int ret=inl,n,i;
363 BIO_B64_CTX *ctx; 344 BIO_B64_CTX *ctx;
@@ -451,11 +432,7 @@ int inl;
451 return(ret); 432 return(ret);
452 } 433 }
453 434
454static long b64_ctrl(b,cmd,num,ptr) 435static long b64_ctrl(BIO *b, int cmd, long num, char *ptr)
455BIO *b;
456int cmd;
457long num;
458char *ptr;
459 { 436 {
460 BIO_B64_CTX *ctx; 437 BIO_B64_CTX *ctx;
461 long ret=1; 438 long ret=1;