Deleted Added
full compact
ssl_lib.c (72613) ssl_lib.c (76866)
1/*! \file ssl/ssl_lib.c
2 * \brief Version independent SSL functions.
3 */
4/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
5 * All rights reserved.
6 *
7 * This package is an SSL implementation written
8 * by Eric Young (eay@cryptsoft.com).

--- 694 unchanged lines hidden (view full) ---

703 return(s->method->ssl_connect(s));
704 }
705
706long SSL_get_default_timeout(SSL *s)
707 {
708 return(s->method->get_timeout());
709 }
710
1/*! \file ssl/ssl_lib.c
2 * \brief Version independent SSL functions.
3 */
4/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
5 * All rights reserved.
6 *
7 * This package is an SSL implementation written
8 * by Eric Young (eay@cryptsoft.com).

--- 694 unchanged lines hidden (view full) ---

703 return(s->method->ssl_connect(s));
704 }
705
706long SSL_get_default_timeout(SSL *s)
707 {
708 return(s->method->get_timeout());
709 }
710
711int SSL_read(SSL *s,char *buf,int num)
711int SSL_read(SSL *s,void *buf,int num)
712 {
713 if (s->handshake_func == 0)
714 {
715 SSLerr(SSL_F_SSL_READ, SSL_R_UNINITIALIZED);
716 return -1;
717 }
718
719 if (s->shutdown & SSL_RECEIVED_SHUTDOWN)
720 {
721 s->rwstate=SSL_NOTHING;
722 return(0);
723 }
724 return(s->method->ssl_read(s,buf,num));
725 }
726
712 {
713 if (s->handshake_func == 0)
714 {
715 SSLerr(SSL_F_SSL_READ, SSL_R_UNINITIALIZED);
716 return -1;
717 }
718
719 if (s->shutdown & SSL_RECEIVED_SHUTDOWN)
720 {
721 s->rwstate=SSL_NOTHING;
722 return(0);
723 }
724 return(s->method->ssl_read(s,buf,num));
725 }
726
727int SSL_peek(SSL *s,char *buf,int num)
727int SSL_peek(SSL *s,void *buf,int num)
728 {
728 {
729 if (s->handshake_func == 0)
730 {
731 SSLerr(SSL_F_SSL_READ, SSL_R_UNINITIALIZED);
732 return -1;
733 }
734
729 if (s->shutdown & SSL_RECEIVED_SHUTDOWN)
730 {
731 return(0);
732 }
733 return(s->method->ssl_peek(s,buf,num));
734 }
735
735 if (s->shutdown & SSL_RECEIVED_SHUTDOWN)
736 {
737 return(0);
738 }
739 return(s->method->ssl_peek(s,buf,num));
740 }
741
736int SSL_write(SSL *s,const char *buf,int num)
742int SSL_write(SSL *s,const void *buf,int num)
737 {
738 if (s->handshake_func == 0)
739 {
740 SSLerr(SSL_F_SSL_WRITE, SSL_R_UNINITIALIZED);
741 return -1;
742 }
743
744 if (s->shutdown & SSL_SENT_SHUTDOWN)

--- 929 unchanged lines hidden (view full) ---

1674 * they should not both point to the same object,
1675 * and thus we can't use SSL_copy_session_id. */
1676
1677 ret->method = s->method;
1678 ret->method->ssl_new(ret);
1679
1680 if (s->cert != NULL)
1681 {
743 {
744 if (s->handshake_func == 0)
745 {
746 SSLerr(SSL_F_SSL_WRITE, SSL_R_UNINITIALIZED);
747 return -1;
748 }
749
750 if (s->shutdown & SSL_SENT_SHUTDOWN)

--- 929 unchanged lines hidden (view full) ---

1680 * they should not both point to the same object,
1681 * and thus we can't use SSL_copy_session_id. */
1682
1683 ret->method = s->method;
1684 ret->method->ssl_new(ret);
1685
1686 if (s->cert != NULL)
1687 {
1688 if (ret->cert != NULL)
1689 {
1690 ssl_cert_free(ret->cert);
1691 }
1682 ret->cert = ssl_cert_dup(s->cert);
1683 if (ret->cert == NULL)
1684 goto err;
1685 }
1686
1687 SSL_set_session_id_context(ret,
1688 s->sid_ctx, s->sid_ctx_length);
1689 }

--- 375 unchanged lines hidden ---
1692 ret->cert = ssl_cert_dup(s->cert);
1693 if (ret->cert == NULL)
1694 goto err;
1695 }
1696
1697 SSL_set_session_id_context(ret,
1698 s->sid_ctx, s->sid_ctx_length);
1699 }

--- 375 unchanged lines hidden ---