summaryrefslogtreecommitdiffstats
path: root/ssl/statem
AgeCommit message (Collapse)Author
2015-11-14Don't alow TLS v1.0 ciphersuites for SSLv3Dr. Stephen Henson
This disables some ciphersuites which aren't supported in SSL v3: specifically PSK ciphersuites which use SHA256 or SHA384 for the MAC. Thanks to the Open Crypto Audit Project for identifying this issue. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-13absent identity hint should be NULLDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-09Standardise our style for checking malloc failuresMatt Caswell
if we have a malloc |x = OPENSSL_malloc(...)| sometimes we check |x| for NULL and sometimes we treat it as a boolean |if(!x) ...|. Standardise the approach in libssl. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-06Fix compilation problems with SCTPMatt Caswell
The SCTP code is not compiled by default. This fixes some compilation problems in that code. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-11-06Remove some redundant assignmentsMatt Caswell
We were setting |s->renegotiate| and |s->new_session| to 0 twice in tls_finish_handshake. This is redundant so now we just do it once! Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-06Don't finish the handshake twiceMatt Caswell
We finish the handshake when we move into the TLS_ST_OK state. At various points we were also unnecessarily finishing it when we were reading/writing the Finished message. It's much simpler just to do it in TLS_ST_OK, so remove the other calls. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-10-30Add SRP and PSK to disallowed CertificateRequest ciphersuitesMatt Caswell
There was a discrepancy between what ciphersuites we allowed to send a CertificateRequest, and what ciphersuites we allowed to receive one. So add PSK and SRP to the disallowed ones. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Remove the inline keywordMatt Caswell
Some functions were marked as inline in statem_srvr.c where they probably didn't need to be, so remove it. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Remove superfluous checkMatt Caswell
|tls_process_finished| was checking that |peer_finish_md_len| was non-negative. However neither |tls1_final_finish_mac| or |ssl3_final_finish_mac| can ever return a negative value, so the check is superfluous. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Change snprintf to memcpyMatt Caswell
There was a few uses of snprintf in the DTLS SCTP code which made more sense to be a memcpy. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Add ossl_statem prefix to various functionsMatt Caswell
Add the ossl_statem prefix to various funtions to avoid name clashes. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Convert enums to typedefsMatt Caswell
Various enums were introduced as part of the state machine rewrite. As a matter of style it is preferred for these to be typedefs. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix a bogus clang warningMatt Caswell
Clang with --strict-warnings was complaining about an uninitalised variable. In reality it will never be used uninitialised but clang can't figure out the logic, so just init it anyway to silence the warning. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix empty NewSessionTicket processingMatt Caswell
Rebasing the state machine code introduced a problem with empty NewSessionTicket processing. The return value from the tls_process_new_session_ticket() is supposed to be an enum, but a bare integer was being used. Unfortunately this is valid C so the compiler doesn't pick it up. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix uninitialised variableMatt Caswell
Fix another instance of |al| being unitialised in certain error scenarios. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix various error codesMatt Caswell
A number of error codes were wrong due to a rebase of the state machine code. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Move in_handshake into STATEMMatt Caswell
The SSL variable |in_handshake| seems misplaced. It would be better to have it in the STATEM structure. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix unitialised variable problemMatt Caswell
tls_process_client_hello() failed to initialise the |al| variable in some (error) scenarios. This could cause issues with creating the alert. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix DTLSv1_listen following state machine changesMatt Caswell
Adding the new state machine broke the DTLSv1_listen code because calling SSL_in_before() was erroneously returning true after DTLSv1_listen had successfully completed. This change ensures that SSL_in_before returns false. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Add a function to get the info_callbackMatt Caswell
Remove repeated blocks of checking SSL and then SSL_CTX for the info_callback. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Change SUB_STATE_RETURN into a typedefMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Rename STATEM to OSSL_STATEMMatt Caswell
Add an OSSL_ prefix onto STATEM Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Remove SSL_state and SSL_set_stateMatt Caswell
SSL_state has been replaced by SSL_get_state and SSL_set_state is no longer supported. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Move |no_cert_verify| into state machineMatt Caswell
The |no_cert_verify| should be in the state machine structure not in SSL Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Change statem prefix to ossl_statemMatt Caswell
Change various state machine functions to use the prefix ossl_statem instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Change HANDSHAKE_STATE to OSSL_HANDSHAKE_STATEMatt Caswell
Rename the enum HANDSHAKE_STATE to OSSL_HANDSHAKE_STATE to ensure there are no namespace clashes, and convert it into a typedef. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix some client side transition logicMatt Caswell
Fixed some issues in the logic for determining whether an SKE should be expected or not. In particular only allow an SKE for RSA if its export and the key size is not allowed. Also fix the ephemeral ciphersuite checks and add in a missing call to ssl3_check_cert_and_algorithm(). Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Fix a commentMatt Caswell
Fix an out of date reference to old state machine code in a comment Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Add a state machine READMEMatt Caswell
Add some documentation on the thinking behind the state machine. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30More state machine reorgMatt Caswell
Move some function definitions around within the state machine to make sure they are in the correct files. Also create a statem_locl.h header for stuff entirely local to the state machine code and move various definitions into it. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-30Reorganise state machine filesMatt Caswell
Pull out the state machine into a separate sub directory. Also moved some functions which were nothing to do with the state machine but were in state machine files. Pulled all the SSL_METHOD definitions into one place...most of those files had very little left in them any more. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>