aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/openssl/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2001-07-04 23:24:42 +0000
committerKris Kennaway <kris@FreeBSD.org>2001-07-04 23:24:42 +0000
commit2d9194bc64db3221589398c7c3d3224140636069 (patch)
tree2baf3abb4268720bf0d483c837033e36b680fd5e /crypto/openssl/ssl/ssl_lib.c
parent009a7941eae749263728d858f941ded8cda878f0 (diff)
downloadsrc-2d9194bc64db3221589398c7c3d3224140636069.tar.gz
src-2d9194bc64db3221589398c7c3d3224140636069.zip
MFC: Update to OpenSSL 0.9.6a
Notes
Notes: svn path=/stable/4/; revision=79262
Diffstat (limited to 'crypto/openssl/ssl/ssl_lib.c')
-rw-r--r--crypto/openssl/ssl/ssl_lib.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/crypto/openssl/ssl/ssl_lib.c b/crypto/openssl/ssl/ssl_lib.c
index 635b25062e8b..1fe85b6cb756 100644
--- a/crypto/openssl/ssl/ssl_lib.c
+++ b/crypto/openssl/ssl/ssl_lib.c
@@ -119,7 +119,9 @@ int SSL_clear(SSL *s)
s->client_version=s->version;
s->rwstate=SSL_NOTHING;
s->rstate=SSL_ST_READ_HEADER;
+#if 0
s->read_ahead=s->ctx->read_ahead;
+#endif
if (s->init_buf != NULL)
{
@@ -229,6 +231,7 @@ SSL *SSL_new(SSL_CTX *ctx)
s->server=(ctx->method->ssl_accept == ssl_undefined_function)?0:1;
s->options=ctx->options;
s->mode=ctx->mode;
+ s->read_ahead=ctx->read_ahead; /* used to happen in SSL_clear */
SSL_clear(s);
CRYPTO_new_ex_data(ssl_meth,s,&s->ex_data);
@@ -705,7 +708,7 @@ long SSL_get_default_timeout(SSL *s)
return(s->method->get_timeout());
}
-int SSL_read(SSL *s,char *buf,int num)
+int SSL_read(SSL *s,void *buf,int num)
{
if (s->handshake_func == 0)
{
@@ -721,8 +724,14 @@ int SSL_read(SSL *s,char *buf,int num)
return(s->method->ssl_read(s,buf,num));
}
-int SSL_peek(SSL *s,char *buf,int num)
+int SSL_peek(SSL *s,void *buf,int num)
{
+ if (s->handshake_func == 0)
+ {
+ SSLerr(SSL_F_SSL_READ, SSL_R_UNINITIALIZED);
+ return -1;
+ }
+
if (s->shutdown & SSL_RECEIVED_SHUTDOWN)
{
return(0);
@@ -730,7 +739,7 @@ int SSL_peek(SSL *s,char *buf,int num)
return(s->method->ssl_peek(s,buf,num));
}
-int SSL_write(SSL *s,const char *buf,int num)
+int SSL_write(SSL *s,const void *buf,int num)
{
if (s->handshake_func == 0)
{
@@ -1676,6 +1685,10 @@ SSL *SSL_dup(SSL *s)
if (s->cert != NULL)
{
+ if (ret->cert != NULL)
+ {
+ ssl_cert_free(ret->cert);
+ }
ret->cert = ssl_cert_dup(s->cert);
if (ret->cert == NULL)
goto err;