projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refer to SSL_pending from the man page for SSL_read
[oweals/openssl.git]
/
ssl
/
bio_ssl.c
diff --git
a/ssl/bio_ssl.c
b/ssl/bio_ssl.c
index d85555a7e697056411fd792e5dfc820be06cca21..420deb7fc966b656651766aa984d5f3eaf369cc7 100644
(file)
--- a/
ssl/bio_ssl.c
+++ b/
ssl/bio_ssl.c
@@
-206,6
+206,10
@@
static int ssl_read(BIO *b, char *out, int outl)
BIO_set_retry_special(b);
retry_reason=BIO_RR_SSL_X509_LOOKUP;
break;
BIO_set_retry_special(b);
retry_reason=BIO_RR_SSL_X509_LOOKUP;
break;
+ case SSL_ERROR_WANT_ACCEPT:
+ BIO_set_retry_special(b);
+ retry_reason=BIO_RR_ACCEPT;
+ break;
case SSL_ERROR_WANT_CONNECT:
BIO_set_retry_special(b);
retry_reason=BIO_RR_CONNECT;
case SSL_ERROR_WANT_CONNECT:
BIO_set_retry_special(b);
retry_reason=BIO_RR_CONNECT;
@@
-399,6
+403,10
@@
static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
{
BIO_free_all(ssl->wbio);
}
{
BIO_free_all(ssl->wbio);
}
+ if (b->next_bio != NULL)
+ {
+ CRYPTO_add(&b->next_bio->references,1,CRYPTO_LOCK_BIO);
+ }
ssl->wbio=NULL;
ssl->rbio=NULL;
break;
ssl->wbio=NULL;
ssl->rbio=NULL;
break;
@@
-448,7
+456,7
@@
static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
case BIO_CTRL_SET_CALLBACK:
{
#if 0 /* FIXME: Should this be used? -- Richard Levitte */
case BIO_CTRL_SET_CALLBACK:
{
#if 0 /* FIXME: Should this be used? -- Richard Levitte */
-
BIO
err(SSL_F_SSL_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+
SSL
err(SSL_F_SSL_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
ret = -1;
#else
ret=0;
ret = -1;
#else
ret=0;
@@
-457,9
+465,9
@@
static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_CTRL_GET_CALLBACK:
{
break;
case BIO_CTRL_GET_CALLBACK:
{
- void (**fptr)();
+ void (**fptr)(
const SSL *xssl,int type,int val
);
- fptr=(void (**)())ptr;
+ fptr=(void (**)(
const SSL *xssl,int type,int val
))ptr;
*fptr=SSL_get_info_callback(ssl);
}
break;
*fptr=SSL_get_info_callback(ssl);
}
break;
@@
-482,7
+490,9
@@
static long ssl_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp)
{
case BIO_CTRL_SET_CALLBACK:
{
{
case BIO_CTRL_SET_CALLBACK:
{
- SSL_set_info_callback(ssl,fp);
+ /* FIXME: setting this via a completely different prototype
+ seems like a crap idea */
+ SSL_set_info_callback(ssl,(void (*)(const SSL *,int,int))fp);
}
break;
default:
}
break;
default:
@@
-503,6
+513,7
@@
static int ssl_puts(BIO *bp, const char *str)
BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx)
{
BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx)
{
+#ifndef OPENSSL_NO_SOCK
BIO *ret=NULL,*buf=NULL,*ssl=NULL;
if ((buf=BIO_new(BIO_f_buffer())) == NULL)
BIO *ret=NULL,*buf=NULL,*ssl=NULL;
if ((buf=BIO_new(BIO_f_buffer())) == NULL)
@@
-515,6
+526,7
@@
BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx)
err:
if (buf != NULL) BIO_free(buf);
if (ssl != NULL) BIO_free(ssl);
err:
if (buf != NULL) BIO_free(buf);
if (ssl != NULL) BIO_free(ssl);
+#endif
return(NULL);
}
return(NULL);
}