summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-03-26Move s->packet and s->packet_length into s->rlayerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Remove unneccessary use of accessor function now code is moved into recordMatt Caswell
layer Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Make rrec, wrec, rbuf and wbuf fully private to the record layer. Also, cleanMatt Caswell
up some access to them. Now that various functions have been moved into the record layer they no longer need to use the accessor macros. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Removed dependency on rrec from heartbeat processingMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Introduce macro RECORD_LAYER_setup_comp_bufferMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Fix bug where rrec was being released...should have been removed by one ofMatt Caswell
the earlier record layer commits Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move ssl3_pending into the record layerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Remove RECORD_LAYER_set_ssl and introduce RECORD_LAYER_initMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Provide RECORD_LAYER_set_data functionMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Introduce the functions RECORD_LAYER_release, RECORD_LAYER_read_pending, andMatt Caswell
RECORD_LAYER_write_pending. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Create RECORD_LAYER_clear function.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Tidy up rec_layer.h. Add some comments regarding which functions should beMatt Caswell
being used for what purpose. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Moved s3_pkt.c, s23_pkt.c and d1_pkt.c into the record layer.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Split out non record layer functions out of s3_pkt.c and d1_pkt.c intoMatt Caswell
the new files s3_msg.c and s1_msg.c respectively. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move more SSL3_RECORD oriented functions into ssl3_record.cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move SSL3_RECORD oriented functions into ssl3_record.cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move SSL3_BUFFER set up and release code into ssl3_buffer.cMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move s->s3->wrec to s>rlayer>wrecMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate s->s3->wrecMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move s->s3->rrec to s->rlayer->rrecMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate s->s3->rrecMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move s->s3->wbuf to s->rlayer->wbufMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate access to s->s3->wbufMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Move s->s3->rrec into s->rlayerMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Encapsulate SSL3_BUFFER and all access to s->s3->rbuf.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-26Create a RECORD_LAYER structure and move read_ahead into it.Matt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25free NULL cleanup.Rich Salz
This gets EC_GROUP_clear_free EC_GROUP_free, EC_KEY_free, EC_POINT_clear_free, EC_POINT_free Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-03-25Resolve swallowed returns codesMatt Caswell
The recent updates to libssl to enforce stricter return code checking, left a small number of instances behind where return codes were being swallowed (typically because the function they were being called from was declared as void). This commit fixes those instances to handle the return codes more appropriately. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25free NULL cleanupRich Salz
This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free BIO_free BIO_free_all BIO_vfree Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-25Support key loading from certificate fileDr. Stephen Henson
Support loading of key and certificate from the same file if SSL_CONF_FLAG_REQUIRE_PRIVATE is set. This is done by remembering the filename used for each certificate type and attempting to load a private key from the file when SSL_CONF_CTX_finish is called. Update docs. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG was disabled in 0.9.8q and 1.0.0c.Matt Caswell
This commit sets the value of SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG to zero. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25RAND_bytes updatesMatt Caswell
Ensure RAND_bytes return value is checked correctly, and that we no longer use RAND_pseudo_bytes. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25Add ticket length before buffering DTLS messageMatt Caswell
In ssl3_send_new_session_ticket the message to be sent is constructed. We skip adding the length of the session ticket initially, then call ssl_set_handshake_header, and finally go back and add in the length of the ticket. Unfortunately, in DTLS, ssl_set_handshake_header also has the side effect of buffering the message for subsequent retransmission if required. By adding the ticket length after the call to ssl_set_handshake_header the message that is buffered is incomplete, causing an invalid message to be sent on retransmission. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-25Ensure last_write_sequence is saved in DTLS1.2Matt Caswell
In DTLS, immediately prior to epoch change, the write_sequence is supposed to be stored in s->d1->last_write_sequence. The write_sequence is then reset back to 00000000. In the event of retransmits of records from the previous epoch, the last_write_sequence is restored. This commit fixes a bug in DTLS1.2 where the write_sequence was being reset before last_write_sequence was saved, and therefore retransmits are sent with incorrect sequence numbers. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-24free NULL cleanupRich Salz
Start ensuring all OpenSSL "free" routines allow NULL, and remove any if check before calling them. This gets DH_free, DSA_free, RSA_free Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-24make dependDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-23return unexpected message when receiving kx with kDHr or kDHdKurt Roeckx
It was saying that it was an illegal parameter / unsupported cipher Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-23Don't send a for ServerKeyExchange for kDHr and kDHdKurt Roeckx
The certificate already contains the DH parameters in that case. ssl3_send_server_key_exchange() would fail in that case anyway. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-23Make sure that cert is never NULLKurt Roeckx
Also removes for it being NULL Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-23Fix SSL_clear unused returnMatt Caswell
Fix missing return value check in dtls1_listen when calling SSL_clear(). Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23ssl3_set_handshake_header returnsMatt Caswell
Change ssl_set_handshake_header from return void to returning int, and handle error return code appropriately. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23Fix missing return value checksMatt Caswell
Ensure that all functions have their return values checked where appropriate. This covers all functions defined and called from within libssl. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23Check libssl function returnsMatt Caswell
Mark most functions returning a result defined in any libssl header file with __owur to warn if they are used without checking the return value. Use -DUNUSED_RETURN compiler flag with gcc to activate these warnings. Some functions returning a result are skipped if it is common and valid to use these functions without checking the return value. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23Don't check curves that haven't been sentMatt Caswell
Don't check that the curve appears in the list of acceptable curves for the peer, if they didn't send us such a list (RFC 4492 does not require that the extension be sent). Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-03-20Add DTLS support to ssltestDavid Woodhouse
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-03-20Add DTLS to SSL_get_versionDavid Woodhouse
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-03-19Fix DHE Null CKE vulnerabilityMatt Caswell
If client auth is used then a server can seg fault in the event of a DHE cipher being used and a zero length ClientKeyExchange message being sent by the client. This could be exploited in a DoS attack. CVE-2015-1787 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Fix for CVE-2015-0291Dr. Stephen Henson
If a client renegotiates using an invalid signature algorithms extension it will crash a server with a NULL pointer dereference. Thanks to David Ramos of Stanford University for reporting this bug. CVE-2015-0291 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-03-19Fix Seg fault in DTLSv1_listenMatt Caswell
The DTLSv1_listen function is intended to be stateless and processes the initial ClientHello from many peers. It is common for user code to loop over the call to DTLSv1_listen until a valid ClientHello is received with an associated cookie. A defect in the implementation of DTLSv1_listen means that state is preserved in the SSL object from one invokation to the next that can lead to a segmentation fault. Erorrs processing the initial ClientHello can trigger this scenario. An example of such an error could be that a DTLS1.0 only client is attempting to connect to a DTLS1.2 only server. CVE-2015-0207 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-19Multiblock corrupted pointer fixMatt Caswell
OpenSSL 1.0.2 introduced the "multiblock" performance improvement. This feature only applies on 64 bit x86 architecture platforms that support AES NI instructions. A defect in the implementation of "multiblock" can cause OpenSSL's internal write buffer to become incorrectly set to NULL when using non-blocking IO. Typically, when the user application is using a socket BIO for writing, this will only result in a failed connection. However if some other BIO is used then it is likely that a segmentation fault will be triggered, thus enabling a potential DoS attack. CVE-2015-0290 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org>