summaryrefslogtreecommitdiffstats
path: root/ssl
AgeCommit message (Collapse)Author
2015-09-02Fix CCM support in DTLSDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-02Fix DTLS1.2 buffersHiroyuki YAMAMORI
Fix the setup of DTLS1.2 buffers to take account of the Header Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-31Add X509_up_ref function.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-26Clean up reset of read/write sequencesMatt Caswell
Use sizeof instead of an explicit size, and use the functions for the purpose. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-08-26PACKET: add methods for reading length-prefixed TLS vectors.Emilia Kasper
Rewrite ssl3_get_client_hello to use the new methods. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-26Fix SSLv2-compatible ClientHello processing.Emilia Kasper
If the client challenge is less than 32 bytes, it is padded with leading - not trailing - zero bytes. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-26PACKET: constify where possibleEmilia Kasper
The PACKET should hold a 'const unsigned char*' underneath as well but the legacy code passes the record buffer around as 'unsigned char*' (to callbacks, too) so that's a bigger refactor. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-26Fix DTLS session ticket renewalMatt Caswell
A DTLS client will abort a handshake if the server attempts to renew the session ticket. This is caused by a state machine discrepancy between DTLS and TLS discovered during the state machine rewrite work. The bug can be demonstrated as follows: Start a DTLS s_server instance: openssl s_server -dtls Start a client and obtain a session but no ticket: openssl s_client -dtls -sess_out session.pem -no_ticket Now start a client reusing the session, but allow a ticket: openssl s_client -dtls -sess_in session.pem The client will abort the handshake. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-14PACKETise CertificateRequestMatt Caswell
Process CertificateRequest messages using the PACKET API Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-14PACKETise ClientKeyExchange processingMatt Caswell
Use the new PACKET code to process the CKE message Reviewed-by: Stephen Henson <steve@openssl.org>
2015-08-14PACKETise NewSessionTicketMatt Caswell
Process NewSessionTicket messages using the new PACKET API Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-14Fix session ticketsMatt Caswell
Commit 9ceb2426b0 (PACKETise ClientHello) broke session tickets by failing to detect the session ticket extension in an incoming ClientHello. This commit fixes the bug. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-14Add CCM ciphersuites from RFC6655 and RFC7251Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-14ccm8 supportDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-14CCM support.Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-13PACKETise Certificate Status messageMatt Caswell
Process the Certificate Status message using the PACKET API Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-13Enhance PACKET readabilityMatt Caswell
Enhance the PACKET code readability, and fix a stale comment. Thanks to Ben Kaduk (bkaduk@akamai.com) for pointing this out. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-13Add missing return check for PACKET_buf_initMatt Caswell
The new ClientHello PACKET code is missing a return value check. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-13PACKETise Server Certificate processingMatt Caswell
Use the PACKET API to process an incoming server Certificate message. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-08-11Remove Gost94 signature algorithm.Rich Salz
This was obsolete in 2001. This is not the same as Gost94 digest. Thanks to Dmitry Belyavsky <beldmit@gmail.com> for review and advice. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-11Fix "make test" seg fault with SCTP enabledMatt Caswell
When config'd with "sctp" running "make test" causes a seg fault. This is actually due to the way ssltest works - it dives under the covers and frees up BIOs manually and so some BIOs are NULL when the SCTP code does not expect it. The simplest fix is just to add some sanity checks to make sure the BIOs aren't NULL before we use them. This problem occurs in master and 1.0.2. The fix has also been applied to 1.0.1 to keep the code in sync. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-11Fix missing return value checks in SCTPMatt Caswell
There are some missing return value checks in the SCTP code. In master this was causing a compilation failure when config'd with "--strict-warnings sctp". Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-11Fix seg fault with 0 p val in SKEGuy Leaver (guleaver)
If a client receives a ServerKeyExchange for an anon DH ciphersuite with the value of p set to 0 then a seg fault can occur. This commits adds a test to reject p, g and pub key parameters that have a 0 value (in accordance with RFC 5246) The security vulnerability only affects master and 1.0.2, but the fix is additionally applied to 1.0.1 for additional confidence. CVE-2015-1794 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-11Normalise make errors outputMatt Caswell
make errors wants things in a different order to the way things are currently defined in the header files. The easiest fix is to just let it reorder it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-08-10RT3999: Remove sub-component version stringsRich Salz
Especially since after the #ifdef cleanups this is not useful. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-04Change error reason to match previous behaviour.Adam Eijdenberg
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-04Fix unhandled error condition in sslv2 client hello parsing.Adam Eijdenberg
--strict-warnings started showing warnings for this today... Surely an error should be raised if these reads fail? Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-08-04PACKETise NextProtoMatt Caswell
Change NextProto message processing to use the PACKET API. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-08-04PACKETise CertificateVerify processingMatt Caswell
Modify CertificateVerify processing to use the new PACKET API. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-08-04PACKETise ClientCertificate processingMatt Caswell
Use the PACKET API for processing ClientCertificate messages Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-04Fix a bug in the new PACKET implementationMatt Caswell
Some of the PACKET functions were returning incorrect data. An unfortunate choice of test data in the unit test was masking the failure. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-03Fix make errors for the CCS changesMatt Caswell
The move of CCS into the state machine was causing make errors to fail. This fixes it. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-03Fix ssl3_read_bytes handshake fragment bugMatt Caswell
The move of CCS into the state machine introduced a bug in ssl3_read_bytes. The value of |recvd_type| was not being set if we are satisfying the request from handshake fragment storage. This can occur, for example, with renegotiation and causes the handshake to fail. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-03Move DTLS CCS processing into the state machineMatt Caswell
Continuing on from the previous commit this moves the processing of DTLS CCS messages out of the record layer and into the state machine. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-03Move TLS CCS processing into the state machineMatt Caswell
The handling of incoming CCS records is a little strange. Since CCS is not a handshake message it is handled differently to normal handshake messages. Unfortunately whilst technically it is not a handhshake message the reality is that it must be processed in accordance with the state of the handshake. Currently CCS records are processed entirely within the record layer. In order to ensure that it is handled in accordance with the handshake state a flag is used to indicate that it is an acceptable time to receive a CCS. Previously this flag did not exist (see CVE-2014-0224), but the flag should only really be considered a workaround for the problem that CCS is not visible to the state machine. Outgoing CCS messages are already handled within the state machine. This patch makes CCS visible to the TLS state machine. A separate commit will handle DTLS. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-03PACKETise ClientHello processingMatt Caswell
Uses the new PACKET code to process the incoming ClientHello including all extensions etc. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-03Add initial packet parsing codeMatt Caswell
Provide more robust (inline) functions to replace n2s, n2l, etc. These functions do the same thing as the previous macros, but also keep track of the amount of data remaining and return an error if we try to read more data than we've got. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-08-01Make BSD make happy with subdirectories.Ben Laurie
Reviewed-by: Richard Levitte
2015-07-31Remove erroneous server_random fillingMatt Caswell
Commit e481f9b90b164 removed OPENSSL_NO_TLSEXT from the code. Previously if OPENSSL_NO_TLSEXT *was not* defined then the server random was filled during getting of the ClientHello. If it *was* defined then the server random would be filled in ssl3_send_server_hello(). Unfortunately in commit e481f9b90b164 the OPENSSL_NO_TLSEXT guards were removed but *both* server random fillings were left in. This could cause problems for session ticket callbacks. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-07-30cleanse psk_identity on errorDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Free and cleanse pms on errorDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Don't request certificates for any PSK ciphersuiteDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30CAMELLIA PSK ciphersuites from RFC6367Dr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Add RFC4785 ciphersuitesDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Add RFC4279, RFC5487 and RFC5489 ciphersuites.Dr. Stephen Henson
Note: some of the RFC4279 ciphersuites were originally part of PR#2464. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Add full PSK trace supportDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30PSK premaster secret derivation.Dr. Stephen Henson
Move PSK premaster secret algorithm to ssl_generate_master secret so existing key exchange code can be used and modified slightly to add the PSK wrapping structure. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Extended PSK server support.Dr. Stephen Henson
Add support for RSAPSK, DHEPSK and ECDHEPSK server side. Update various checks to ensure certificate and server key exchange messages are only sent when required. Update message handling. PSK server key exchange parsing now include an identity hint prefix for all PSK server key exchange messages. PSK client key exchange message expects PSK identity and requests key for all PSK key exchange ciphersuites. Update flags for RSA, DH and ECDH so they are also used in PSK. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30Extended PSK client support.Dr. Stephen Henson
Add support for RSAPSK, DHEPSK and ECDHEPSK client side. Update various checks to ensure certificate and server key exchange messages are only expected when required. Update message handling. PSK server key exchange parsing now expects an identity hint prefix for all PSK server key exchange messages. PSK client key exchange message requests PSK identity and key for all PSK key exchange ciphersuites and includes identity in message. Update flags for RSA, DH and ECDH so they are also used in PSK. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-07-30PSK PRF correction.Dr. Stephen Henson
For SHA384 PRF PSK ciphersuites we have to switch to default PRF for TLS < 1.2 Reviewed-by: Matt Caswell <matt@openssl.org>