OLD | NEW |
1 /* crypto/bio/bf_nbio.c */ | 1 /* crypto/bio/bf_nbio.c */ |
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
8 * | 8 * |
9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (a->ptr != NULL) | 118 if (a->ptr != NULL) |
119 OPENSSL_free(a->ptr); | 119 OPENSSL_free(a->ptr); |
120 a->ptr=NULL; | 120 a->ptr=NULL; |
121 a->init=0; | 121 a->init=0; |
122 a->flags=0; | 122 a->flags=0; |
123 return(1); | 123 return(1); |
124 } | 124 } |
125 | 125 |
126 static int nbiof_read(BIO *b, char *out, int outl) | 126 static int nbiof_read(BIO *b, char *out, int outl) |
127 { | 127 { |
128 NBIO_TEST *nt; | |
129 int ret=0; | 128 int ret=0; |
130 #if 1 | 129 #if 1 |
131 int num; | 130 int num; |
132 unsigned char n; | 131 unsigned char n; |
133 #endif | 132 #endif |
134 | 133 |
135 if (out == NULL) return(0); | 134 if (out == NULL) return(0); |
136 if (b->next_bio == NULL) return(0); | 135 if (b->next_bio == NULL) return(0); |
137 nt=(NBIO_TEST *)b->ptr; | |
138 | 136 |
139 BIO_clear_retry_flags(b); | 137 BIO_clear_retry_flags(b); |
140 #if 1 | 138 #if 1 |
141 RAND_pseudo_bytes(&n,1); | 139 RAND_pseudo_bytes(&n,1); |
142 num=(n&0x07); | 140 num=(n&0x07); |
143 | 141 |
144 if (outl > num) outl=num; | 142 if (outl > num) outl=num; |
145 | 143 |
146 if (num == 0) | 144 if (num == 0) |
147 { | 145 { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 } | 244 } |
247 | 245 |
248 | 246 |
249 static int nbiof_puts(BIO *bp, const char *str) | 247 static int nbiof_puts(BIO *bp, const char *str) |
250 { | 248 { |
251 if (bp->next_bio == NULL) return(0); | 249 if (bp->next_bio == NULL) return(0); |
252 return(BIO_puts(bp->next_bio,str)); | 250 return(BIO_puts(bp->next_bio,str)); |
253 } | 251 } |
254 | 252 |
255 | 253 |
OLD | NEW |