diff options
Diffstat (limited to 'src/lib/libssl/s23_lib.c')
-rw-r--r-- | src/lib/libssl/s23_lib.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/lib/libssl/s23_lib.c b/src/lib/libssl/s23_lib.c index dded7a19c5..ad2d8dadf7 100644 --- a/src/lib/libssl/s23_lib.c +++ b/src/lib/libssl/s23_lib.c | |||
@@ -63,6 +63,7 @@ | |||
63 | static int ssl23_num_ciphers(void ); | 63 | static int ssl23_num_ciphers(void ); |
64 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u); | 64 | static SSL_CIPHER *ssl23_get_cipher(unsigned int u); |
65 | static int ssl23_read(SSL *s, void *buf, int len); | 65 | static int ssl23_read(SSL *s, void *buf, int len); |
66 | static int ssl23_peek(SSL *s, void *buf, int len); | ||
66 | static int ssl23_write(SSL *s, const void *buf, int len); | 67 | static int ssl23_write(SSL *s, const void *buf, int len); |
67 | static long ssl23_default_timeout(void ); | 68 | static long ssl23_default_timeout(void ); |
68 | static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p); | 69 | static int ssl23_put_cipher_by_char(const SSL_CIPHER *c, unsigned char *p); |
@@ -77,7 +78,7 @@ static SSL_METHOD SSLv23_data= { | |||
77 | ssl_undefined_function, | 78 | ssl_undefined_function, |
78 | ssl_undefined_function, | 79 | ssl_undefined_function, |
79 | ssl23_read, | 80 | ssl23_read, |
80 | (int (*)(struct ssl_st *, char *, int))ssl_undefined_function, | 81 | ssl23_peek, |
81 | ssl23_write, | 82 | ssl23_write, |
82 | ssl_undefined_function, | 83 | ssl_undefined_function, |
83 | ssl_undefined_function, | 84 | ssl_undefined_function, |
@@ -169,13 +170,6 @@ static int ssl23_read(SSL *s, void *buf, int len) | |||
169 | { | 170 | { |
170 | int n; | 171 | int n; |
171 | 172 | ||
172 | #if 0 | ||
173 | if (s->shutdown & SSL_RECEIVED_SHUTDOWN) | ||
174 | { | ||
175 | s->rwstate=SSL_NOTHING; | ||
176 | return(0); | ||
177 | } | ||
178 | #endif | ||
179 | clear_sys_error(); | 173 | clear_sys_error(); |
180 | if (SSL_in_init(s) && (!s->in_handshake)) | 174 | if (SSL_in_init(s) && (!s->in_handshake)) |
181 | { | 175 | { |
@@ -195,17 +189,33 @@ static int ssl23_read(SSL *s, void *buf, int len) | |||
195 | } | 189 | } |
196 | } | 190 | } |
197 | 191 | ||
198 | static int ssl23_write(SSL *s, const void *buf, int len) | 192 | static int ssl23_peek(SSL *s, void *buf, int len) |
199 | { | 193 | { |
200 | int n; | 194 | int n; |
201 | 195 | ||
202 | #if 0 | 196 | clear_sys_error(); |
203 | if (s->shutdown & SSL_SENT_SHUTDOWN) | 197 | if (SSL_in_init(s) && (!s->in_handshake)) |
198 | { | ||
199 | n=s->handshake_func(s); | ||
200 | if (n < 0) return(n); | ||
201 | if (n == 0) | ||
202 | { | ||
203 | SSLerr(SSL_F_SSL23_PEEK,SSL_R_SSL_HANDSHAKE_FAILURE); | ||
204 | return(-1); | ||
205 | } | ||
206 | return(SSL_peek(s,buf,len)); | ||
207 | } | ||
208 | else | ||
204 | { | 209 | { |
205 | s->rwstate=SSL_NOTHING; | 210 | ssl_undefined_function(s); |
206 | return(0); | 211 | return(-1); |
207 | } | 212 | } |
208 | #endif | 213 | } |
214 | |||
215 | static int ssl23_write(SSL *s, const void *buf, int len) | ||
216 | { | ||
217 | int n; | ||
218 | |||
209 | clear_sys_error(); | 219 | clear_sys_error(); |
210 | if (SSL_in_init(s) && (!s->in_handshake)) | 220 | if (SSL_in_init(s) && (!s->in_handshake)) |
211 | { | 221 | { |