diff options
| author | markus <> | 2002-09-05 12:51:50 +0000 | 
|---|---|---|
| committer | markus <> | 2002-09-05 12:51:50 +0000 | 
| commit | 15b5d84f9da2ce4bfae8580e56e34a859f74ad71 (patch) | |
| tree | bf939e82d7fd73cc8a01cf6959002209972091bc /src/lib/libcrypto/bio/bf_null.c | |
| parent | 027351f729b9e837200dae6e1520cda6577ab930 (diff) | |
| download | openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.gz openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.tar.bz2 openbsd-15b5d84f9da2ce4bfae8580e56e34a859f74ad71.zip | |
import openssl-0.9.7-beta1
Diffstat (limited to 'src/lib/libcrypto/bio/bf_null.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bf_null.c | 73 | 
1 files changed, 30 insertions, 43 deletions
| diff --git a/src/lib/libcrypto/bio/bf_null.c b/src/lib/libcrypto/bio/bf_null.c index a47a65741a..c1bf39a904 100644 --- a/src/lib/libcrypto/bio/bf_null.c +++ b/src/lib/libcrypto/bio/bf_null.c | |||
| @@ -59,30 +59,19 @@ | |||
| 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 "bio.h" | 62 | #include <openssl/bio.h> | 
| 63 | #include "evp.h" | ||
| 64 | 63 | ||
| 65 | /* BIO_put and BIO_get both add to the digest, | 64 | /* BIO_put and BIO_get both add to the digest, | 
| 66 | * BIO_gets returns the digest */ | 65 | * BIO_gets returns the digest */ | 
| 67 | 66 | ||
| 68 | #ifndef NOPROTO | 67 | static int nullf_write(BIO *h, const char *buf, int num); | 
| 69 | static int nullf_write(BIO *h,char *buf,int num); | 68 | static int nullf_read(BIO *h, char *buf, int size); | 
| 70 | static int nullf_read(BIO *h,char *buf,int size); | 69 | static int nullf_puts(BIO *h, const char *str); | 
| 71 | static int nullf_puts(BIO *h,char *str); | 70 | static int nullf_gets(BIO *h, char *str, int size); | 
| 72 | static int nullf_gets(BIO *h,char *str,int size); | 71 | static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2); | 
| 73 | static long nullf_ctrl(BIO *h,int cmd,long arg1,char *arg2); | ||
| 74 | static int nullf_new(BIO *h); | 72 | static int nullf_new(BIO *h); | 
| 75 | static int nullf_free(BIO *data); | 73 | static int nullf_free(BIO *data); | 
| 76 | #else | 74 | static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); | 
| 77 | static int nullf_write(); | ||
| 78 | static int nullf_read(); | ||
| 79 | static int nullf_puts(); | ||
| 80 | static int nullf_gets(); | ||
| 81 | static long nullf_ctrl(); | ||
| 82 | static int nullf_new(); | ||
| 83 | static int nullf_free(); | ||
| 84 | #endif | ||
| 85 | |||
| 86 | static BIO_METHOD methods_nullf= | 75 | static BIO_METHOD methods_nullf= | 
| 87 | { | 76 | { | 
| 88 | BIO_TYPE_NULL_FILTER, | 77 | BIO_TYPE_NULL_FILTER, | 
| @@ -94,15 +83,15 @@ static BIO_METHOD methods_nullf= | |||
| 94 | nullf_ctrl, | 83 | nullf_ctrl, | 
| 95 | nullf_new, | 84 | nullf_new, | 
| 96 | nullf_free, | 85 | nullf_free, | 
| 86 | nullf_callback_ctrl, | ||
| 97 | }; | 87 | }; | 
| 98 | 88 | ||
| 99 | BIO_METHOD *BIO_f_null() | 89 | BIO_METHOD *BIO_f_null(void) | 
| 100 | { | 90 | { | 
| 101 | return(&methods_nullf); | 91 | return(&methods_nullf); | 
| 102 | } | 92 | } | 
| 103 | 93 | ||
| 104 | static int nullf_new(bi) | 94 | static int nullf_new(BIO *bi) | 
| 105 | BIO *bi; | ||
| 106 | { | 95 | { | 
| 107 | bi->init=1; | 96 | bi->init=1; | 
| 108 | bi->ptr=NULL; | 97 | bi->ptr=NULL; | 
| @@ -110,8 +99,7 @@ BIO *bi; | |||
| 110 | return(1); | 99 | return(1); | 
| 111 | } | 100 | } | 
| 112 | 101 | ||
| 113 | static int nullf_free(a) | 102 | static int nullf_free(BIO *a) | 
| 114 | BIO *a; | ||
| 115 | { | 103 | { | 
| 116 | if (a == NULL) return(0); | 104 | if (a == NULL) return(0); | 
| 117 | /* a->ptr=NULL; | 105 | /* a->ptr=NULL; | 
| @@ -120,10 +108,7 @@ BIO *a; | |||
| 120 | return(1); | 108 | return(1); | 
| 121 | } | 109 | } | 
| 122 | 110 | ||
| 123 | static int nullf_read(b,out,outl) | 111 | static int nullf_read(BIO *b, char *out, int outl) | 
| 124 | BIO *b; | ||
| 125 | char *out; | ||
| 126 | int outl; | ||
| 127 | { | 112 | { | 
| 128 | int ret=0; | 113 | int ret=0; | 
| 129 | 114 | ||
| @@ -135,10 +120,7 @@ int outl; | |||
| 135 | return(ret); | 120 | return(ret); | 
| 136 | } | 121 | } | 
| 137 | 122 | ||
| 138 | static int nullf_write(b,in,inl) | 123 | static int nullf_write(BIO *b, const char *in, int inl) | 
| 139 | BIO *b; | ||
| 140 | char *in; | ||
| 141 | int inl; | ||
| 142 | { | 124 | { | 
| 143 | int ret=0; | 125 | int ret=0; | 
| 144 | 126 | ||
| @@ -150,11 +132,7 @@ int inl; | |||
| 150 | return(ret); | 132 | return(ret); | 
| 151 | } | 133 | } | 
| 152 | 134 | ||
| 153 | static long nullf_ctrl(b,cmd,num,ptr) | 135 | static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr) | 
| 154 | BIO *b; | ||
| 155 | int cmd; | ||
| 156 | long num; | ||
| 157 | char *ptr; | ||
| 158 | { | 136 | { | 
| 159 | long ret; | 137 | long ret; | 
| 160 | 138 | ||
| @@ -175,19 +153,28 @@ char *ptr; | |||
| 175 | return(ret); | 153 | return(ret); | 
| 176 | } | 154 | } | 
| 177 | 155 | ||
| 178 | static int nullf_gets(bp,buf,size) | 156 | static long nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) | 
| 179 | BIO *bp; | 157 | { | 
| 180 | char *buf; | 158 | long ret=1; | 
| 181 | int size; | 159 | |
| 160 | if (b->next_bio == NULL) return(0); | ||
| 161 | switch (cmd) | ||
| 162 | { | ||
| 163 | default: | ||
| 164 | ret=BIO_callback_ctrl(b->next_bio,cmd,fp); | ||
| 165 | break; | ||
| 166 | } | ||
| 167 | return(ret); | ||
| 168 | } | ||
| 169 | |||
| 170 | static int nullf_gets(BIO *bp, char *buf, int size) | ||
| 182 | { | 171 | { | 
| 183 | if (bp->next_bio == NULL) return(0); | 172 | if (bp->next_bio == NULL) return(0); | 
| 184 | return(BIO_gets(bp->next_bio,buf,size)); | 173 | return(BIO_gets(bp->next_bio,buf,size)); | 
| 185 | } | 174 | } | 
| 186 | 175 | ||
| 187 | 176 | ||
| 188 | static int nullf_puts(bp,str) | 177 | static int nullf_puts(BIO *bp, const char *str) | 
| 189 | BIO *bp; | ||
| 190 | char *str; | ||
| 191 | { | 178 | { | 
| 192 | if (bp->next_bio == NULL) return(0); | 179 | if (bp->next_bio == NULL) return(0); | 
| 193 | return(BIO_puts(bp->next_bio,str)); | 180 | return(BIO_puts(bp->next_bio,str)); | 
