diff options
Diffstat (limited to 'src/lib/libcrypto/bio/bf_nbio.c')
-rw-r--r-- | src/lib/libcrypto/bio/bf_nbio.c | 50 |
1 files changed, 11 insertions, 39 deletions
diff --git a/src/lib/libcrypto/bio/bf_nbio.c b/src/lib/libcrypto/bio/bf_nbio.c index 034b3024df..cbec2bae29 100644 --- a/src/lib/libcrypto/bio/bf_nbio.c +++ b/src/lib/libcrypto/bio/bf_nbio.c | |||
@@ -59,14 +59,13 @@ | |||
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 "rand.h" | 62 | #include <openssl/rand.h> |
63 | #include "bio.h" | 63 | #include <openssl/bio.h> |
64 | #include "evp.h" | 64 | #include <openssl/evp.h> |
65 | 65 | ||
66 | /* BIO_put and BIO_get both add to the digest, | 66 | /* BIO_put and BIO_get both add to the digest, |
67 | * BIO_gets returns the digest */ | 67 | * BIO_gets returns the digest */ |
68 | 68 | ||
69 | #ifndef NOPROTO | ||
70 | static int nbiof_write(BIO *h,char *buf,int num); | 69 | static int nbiof_write(BIO *h,char *buf,int num); |
71 | static int nbiof_read(BIO *h,char *buf,int size); | 70 | static int nbiof_read(BIO *h,char *buf,int size); |
72 | static int nbiof_puts(BIO *h,char *str); | 71 | static int nbiof_puts(BIO *h,char *str); |
@@ -74,16 +73,6 @@ static int nbiof_gets(BIO *h,char *str,int size); | |||
74 | static long nbiof_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 73 | static long nbiof_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
75 | static int nbiof_new(BIO *h); | 74 | static int nbiof_new(BIO *h); |
76 | static int nbiof_free(BIO *data); | 75 | static int nbiof_free(BIO *data); |
77 | #else | ||
78 | static int nbiof_write(); | ||
79 | static int nbiof_read(); | ||
80 | static int nbiof_puts(); | ||
81 | static int nbiof_gets(); | ||
82 | static long nbiof_ctrl(); | ||
83 | static int nbiof_new(); | ||
84 | static int nbiof_free(); | ||
85 | #endif | ||
86 | |||
87 | typedef struct nbio_test_st | 76 | typedef struct nbio_test_st |
88 | { | 77 | { |
89 | /* only set if we sent a 'should retry' error */ | 78 | /* only set if we sent a 'should retry' error */ |
@@ -104,13 +93,12 @@ static BIO_METHOD methods_nbiof= | |||
104 | nbiof_free, | 93 | nbiof_free, |
105 | }; | 94 | }; |
106 | 95 | ||
107 | BIO_METHOD *BIO_f_nbio_test() | 96 | BIO_METHOD *BIO_f_nbio_test(void) |
108 | { | 97 | { |
109 | return(&methods_nbiof); | 98 | return(&methods_nbiof); |
110 | } | 99 | } |
111 | 100 | ||
112 | static int nbiof_new(bi) | 101 | static int nbiof_new(BIO *bi) |
113 | BIO *bi; | ||
114 | { | 102 | { |
115 | NBIO_TEST *nt; | 103 | NBIO_TEST *nt; |
116 | 104 | ||
@@ -123,8 +111,7 @@ BIO *bi; | |||
123 | return(1); | 111 | return(1); |
124 | } | 112 | } |
125 | 113 | ||
126 | static int nbiof_free(a) | 114 | static int nbiof_free(BIO *a) |
127 | BIO *a; | ||
128 | { | 115 | { |
129 | if (a == NULL) return(0); | 116 | if (a == NULL) return(0); |
130 | if (a->ptr != NULL) | 117 | if (a->ptr != NULL) |
@@ -135,10 +122,7 @@ BIO *a; | |||
135 | return(1); | 122 | return(1); |
136 | } | 123 | } |
137 | 124 | ||
138 | static int nbiof_read(b,out,outl) | 125 | static int nbiof_read(BIO *b, char *out, int outl) |
139 | BIO *b; | ||
140 | char *out; | ||
141 | int outl; | ||
142 | { | 126 | { |
143 | NBIO_TEST *nt; | 127 | NBIO_TEST *nt; |
144 | int ret=0; | 128 | int ret=0; |
@@ -173,10 +157,7 @@ int outl; | |||
173 | return(ret); | 157 | return(ret); |
174 | } | 158 | } |
175 | 159 | ||
176 | static int nbiof_write(b,in,inl) | 160 | static int nbiof_write(BIO *b, char *in, int inl) |
177 | BIO *b; | ||
178 | char *in; | ||
179 | int inl; | ||
180 | { | 161 | { |
181 | NBIO_TEST *nt; | 162 | NBIO_TEST *nt; |
182 | int ret=0; | 163 | int ret=0; |
@@ -221,11 +202,7 @@ int inl; | |||
221 | return(ret); | 202 | return(ret); |
222 | } | 203 | } |
223 | 204 | ||
224 | static long nbiof_ctrl(b,cmd,num,ptr) | 205 | static long nbiof_ctrl(BIO *b, int cmd, long num, char *ptr) |
225 | BIO *b; | ||
226 | int cmd; | ||
227 | long num; | ||
228 | char *ptr; | ||
229 | { | 206 | { |
230 | long ret; | 207 | long ret; |
231 | 208 | ||
@@ -247,19 +224,14 @@ char *ptr; | |||
247 | return(ret); | 224 | return(ret); |
248 | } | 225 | } |
249 | 226 | ||
250 | static int nbiof_gets(bp,buf,size) | 227 | static int nbiof_gets(BIO *bp, char *buf, int size) |
251 | BIO *bp; | ||
252 | char *buf; | ||
253 | int size; | ||
254 | { | 228 | { |
255 | if (bp->next_bio == NULL) return(0); | 229 | if (bp->next_bio == NULL) return(0); |
256 | return(BIO_gets(bp->next_bio,buf,size)); | 230 | return(BIO_gets(bp->next_bio,buf,size)); |
257 | } | 231 | } |
258 | 232 | ||
259 | 233 | ||
260 | static int nbiof_puts(bp,str) | 234 | static int nbiof_puts(BIO *bp, char *str) |
261 | BIO *bp; | ||
262 | char *str; | ||
263 | { | 235 | { |
264 | if (bp->next_bio == NULL) return(0); | 236 | if (bp->next_bio == NULL) return(0); |
265 | return(BIO_puts(bp->next_bio,str)); | 237 | return(BIO_puts(bp->next_bio,str)); |