summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bf_nbio.c
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/bio/bf_nbio.c
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/bio/bf_nbio.c')
-rw-r--r--src/lib/libcrypto/bio/bf_nbio.c50
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
70static int nbiof_write(BIO *h,char *buf,int num); 69static int nbiof_write(BIO *h,char *buf,int num);
71static int nbiof_read(BIO *h,char *buf,int size); 70static int nbiof_read(BIO *h,char *buf,int size);
72static int nbiof_puts(BIO *h,char *str); 71static int nbiof_puts(BIO *h,char *str);
@@ -74,16 +73,6 @@ static int nbiof_gets(BIO *h,char *str,int size);
74static long nbiof_ctrl(BIO *h,int cmd,long arg1,char *arg2); 73static long nbiof_ctrl(BIO *h,int cmd,long arg1,char *arg2);
75static int nbiof_new(BIO *h); 74static int nbiof_new(BIO *h);
76static int nbiof_free(BIO *data); 75static int nbiof_free(BIO *data);
77#else
78static int nbiof_write();
79static int nbiof_read();
80static int nbiof_puts();
81static int nbiof_gets();
82static long nbiof_ctrl();
83static int nbiof_new();
84static int nbiof_free();
85#endif
86
87typedef struct nbio_test_st 76typedef 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
107BIO_METHOD *BIO_f_nbio_test() 96BIO_METHOD *BIO_f_nbio_test(void)
108 { 97 {
109 return(&methods_nbiof); 98 return(&methods_nbiof);
110 } 99 }
111 100
112static int nbiof_new(bi) 101static int nbiof_new(BIO *bi)
113BIO *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
126static int nbiof_free(a) 114static int nbiof_free(BIO *a)
127BIO *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
138static int nbiof_read(b,out,outl) 125static int nbiof_read(BIO *b, char *out, int outl)
139BIO *b;
140char *out;
141int 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
176static int nbiof_write(b,in,inl) 160static int nbiof_write(BIO *b, char *in, int inl)
177BIO *b;
178char *in;
179int 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
224static long nbiof_ctrl(b,cmd,num,ptr) 205static long nbiof_ctrl(BIO *b, int cmd, long num, char *ptr)
225BIO *b;
226int cmd;
227long num;
228char *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
250static int nbiof_gets(bp,buf,size) 227static int nbiof_gets(BIO *bp, char *buf, int size)
251BIO *bp;
252char *buf;
253int 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
260static int nbiof_puts(bp,str) 234static int nbiof_puts(BIO *bp, char *str)
261BIO *bp;
262char *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));