summaryrefslogtreecommitdiffstats
path: root/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace L suffix with UDr. Stephen Henson2015-11-081-39/+39
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Use uint32_t and int32_t for SSL_CIPHER structure.Dr. Stephen Henson2015-11-081-2/+2
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove the state parameter from BIO_ctrl_set_connectedRichard Levitte2015-11-021-2/+2
| | | | | | | | The actual implementation has the state of the connection being controlled with the peer parameter, non-NULL meaning connected and NULL meaning connected. Reviewed-by: Andy Polyakov <appro@openssl.org>
* BIO_s_datagram() ctrl doesn't support SEEK/TELL, so don't pretend it doesRichard Levitte2015-11-021-1/+1
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Correct or add comments indicating what controls belong to whatRichard Levitte2015-11-021-1/+5
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove PROXY controls that aren't used anywhereRichard Levitte2015-11-021-19/+4
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove dummy argument from BIO_get_bind_modeRichard Levitte2015-11-021-1/+1
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Have BIO_get_conn_int_port use BIO_ctrl instead BIO_int_ctrlRichard Levitte2015-11-021-1/+1
| | | | | | | | | | | BIO_int_ctrl isn't made for the purpose BIO_get_conn_int_port used it for. This also changes BIO_C_GET_CONNECT to actually return the port instead of assigning it to a pointer that was never returned back to the caller. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Replace "SSLeay" in API with OpenSSLRich Salz2015-10-307-41/+17
| | | | | | | All instances of SSLeay (any combination of case) were replaced with the case-equivalent OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix various error codesMatt Caswell2015-10-301-2/+2
| | | | | | | | 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>
* Remove the old state definesMatt Caswell2015-10-302-117/+0
| | | | | | | | | Remove all the defines for the old state machines states. Mapping old to new is probably going to cause more problems than it solves so it is probably better to just remove them. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove SSL_state and SSL_set_stateMatt Caswell2015-10-301-3/+1
| | | | | | | | 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>
* Don't depend on SSL structure internalsMatt Caswell2015-10-301-2/+2
| | | | | | | | | The macros SSL_in_connect_init() and SSL_in_accept_init() inadvertently depended on SSL structure internals. This fixes it to use public API calls instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Change HANDSHAKE_STATE to OSSL_HANDSHAKE_STATEMatt Caswell2015-10-301-4/+4
| | | | | | | | 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>
* Move PACKET creation into the state machineMatt Caswell2015-10-301-0/+2
| | | | | | | | | Previously each message specific process function would create its own PACKET structure. Rather than duplicate all of this code lots of times we should create it in the state machine itself. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Redefine old state valuesMatt Caswell2015-10-302-91/+97
| | | | | | | | | | | | | ssl.h and ssl3.h have a number of defines for the various states in the old state machine code. Since this is public API it is not desirable to just remove them. Instead redefine them to the closest equivalent state in the new state machine code. If an application calls SSL_state then the return value can still be compared against these old values if necessary. However not all values have an equivalent state in the new code, so these are just redefined to a dummy value. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove redundant codeMatt Caswell2015-10-301-7/+60
| | | | | | | | Clean up and remove lots of code that is now no longer needed due to the move to the new state machine. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Move server side DTLS to new state machineMatt Caswell2015-10-301-0/+1
| | | | | | | | Implement all of the necessary changes to make DTLS on the server work with the new state machine code. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Move server side TLS to new state machineMatt Caswell2015-10-301-0/+1
| | | | | | | | Implement all of the necessary changes for moving TLS server side processing into the new state machine code. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Split TLS server functionsMatt Caswell2015-10-301-0/+12
| | | | | | | | Split the TLS server ssl3_get_* and ssl3_send_* functions into two ready for the migration to the new state machine code. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Implement DTLS client move to new state machineMatt Caswell2015-10-301-0/+1
| | | | | | | | Move all DTLS client side processing into the new state machine code. A subsequent commit will clean up the old dead code. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* dtls_get_message changes for state machine moveMatt Caswell2015-10-301-0/+1
| | | | | | | | | Create a dtls_get_message function similar to the old dtls1_get_message but in the format required for the new state machine code. The old function will eventually be deleted in later commits. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Split client message reading and writing functionsMatt Caswell2015-10-301-0/+16
| | | | | | | | | | | | | The new state machine code will split up the reading and writing of hanshake messages into discrete phases. In order to facilitate that the existing "get" type functions will be split into two halves: one to get the message and one to process it. The "send" type functions will also have all work relating to constructing the message split out into a separate function just for that. For some functions there will also be separate pre and post "work" phases to prepare or update state. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add initial state machine rewrite codeMatt Caswell2015-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first drop of the new state machine code. The rewrite has the following objectives: - Remove duplication of state code between client and server - Remove duplication of state code between TLS and DTLS - Simplify transitions and bring the logic together in a single location so that it is easier to validate - Remove duplication of code between each of the message handling functions - Receive a message first and then work out whether that is a valid transition - not the other way around (the other way causes lots of issues where we are expecting one type of message next but actually get something else) - Separate message flow state from handshake state (in order to better understand each) - message flow state = when to flush buffers; handling restarts in the event of NBIO events; handling the common flow of steps for reading a message and the common flow of steps for writing a message etc - handshake state = what handshake message are we working on now - Control complexity: only the state machine can change state: keep all the state changes local to a file This builds on previous state machine related work: - Surface CCS processing in the state machine - Version negotiation rewrite Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Split ssl3_get_messageMatt Caswell2015-10-301-0/+2
| | | | | | | | | | | The function ssl3_get_message gets a whole message from the underlying bio and returns it to the state machine code. The new state machine code will split this into two discrete steps: get the message header and get the message body. This commit splits the existing function into these two sub steps to facilitate the state machine implementation. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove HAMC_cleanupRich Salz2015-10-271-2/+0
| | | | | | Old API for use with OpenSSL-0.9.6. Remove it. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix references to various RFCsAlessandro Ghedini2015-10-231-25/+12
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* embed support for ASN1_STRINGDr. Stephen Henson2015-10-111-0/+2
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Embed various OCSP fields.Dr. Stephen Henson2015-10-111-7/+7
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* DTLS: remove unused cookie fieldEmilia Kasper2015-10-091-1/+1
| | | | | | | | Note that this commit constifies a user callback parameter and therefore will break compilation for applications using this callback. But unless they are abusing write access to the buffer, the fix is trivial. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Initial commit for Certificate Transparency supportAdam Eijdenberg2015-10-091-0/+2
| | | | | | | | | Original authors: Rob Stradling <rob@comodo.com> Dr. Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Kasper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* PACKET: simplify ServerKeyExchange parsingEmilia Kasper2015-10-081-0/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix no-ripemd on WindowsMatt Caswell2015-10-081-1/+1
| | | | | | | | | | | | mkdef.pl was getting confused by: # ifdef OPENSSL_NO_RMD160 # error RIPEMD is disabled. # endif Changing RIPEMD to RMD160 solves it. Fix suggested by Steve Henson. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Address more Windows warnings illuminated by mingw.Andy Polyakov2015-10-061-2/+6
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* New cipher and cipher modes standardized in RussiaDmitry Belyavskiy2015-10-051-0/+27
| | | | | | | | This change introduces short names and NIDs for Russian GOST ciphers according to GOST R 34.13-2015 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* ssl3_get_client_hello: rearrange logicEmilia Kasper2015-10-051-0/+1
| | | | | | | | | | | | | | | | Move all packet parsing to the beginning of the method. This limits the SSLv2 compatibility soup to the parsing, and makes the rest of the processing uniform. This is also needed for simpler EMS support: EMS servers need to do an early scan for EMS to make resumption decisions. This'll be easier when the entire ClientHello is parsed in the beginning. As a side effect, 1) PACKETize ssl_get_prev_session and tls1_process_ticket; and 2) Delete dead code for SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG. Reviewed-by: Matt Caswell <matt@openssl.org>
* Free up ASN.1 structures at top level only.Dr. Stephen Henson2015-10-051-1/+1
| | | | | | | | When a decoding error in ASN.1 occurs only free up the partial structure at the top level. This simplifies embedded handling and fixes freeing up of structures when presented with malformed input. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove BIO_s_file_internal macro.Rich Salz2015-10-021-1/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Revert "Custom cipher constants"Matt Caswell2015-10-011-12/+0
| | | | | | This reverts commit 3aabc1dd1c969e60bdea8f827d6645ff04c56b67. Reviewed-by: Stephen Henson <steve@openssl.org>
* Custom cipher constantsDmitry Belyavskiy2015-10-011-0/+12
| | | | | | | Add some custom ctrls for Engine specific use. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Change the DEFAULT ciphersuites to exclude DES, RC4 and RC2Matt Caswell2015-09-301-1/+1
| | | | | | | | | | | | | This patch updates the "DEFAULT" cipherstring to be "ALL:!COMPLEMENTOFDEFAULT:!eNULL". COMPLEMENTOFDEFAULT is now defined internally by a flag on each ciphersuite indicating whether it should be excluded from DEFAULT or not. This gives us control at an individual ciphersuite level as to exactly what is in DEFAULT and what is not. Finally all DES, RC4 and RC2 ciphersuites are added to COMPLEMENTOFDEFAULT and hence removed from DEFAULT. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Make update / libeay.num fixRich Salz2015-09-301-11/+0
| | | | | | | | | | | | Looks like someone forgot to do a "make update" since crypto/ts/Makefile keeps changing. So include that. Second is that the declare_dh_bn macro fools the libeay.num script. The declarations are only needed in one file (dh_rfc5114) so remove them from the header and put the "raw" declarations directly into that file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix no-stdio buildDavid Woodhouse2015-09-307-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Much related/similar work also done by Ivan Nestlerode <ivan.nestlerode@sonos.com> +Replace FILE BIO's with dummy ops that fail. +Include <stdio.h> for sscanf() even with no-stdio (since the declaration is there). We rely on sscanf() to parse the OPENSSL_ia32cap environment variable, since it can be larger than a 'long'. And we don't rely on the availability of strtoull(). +Remove OPENSSL_stderr(); not used. +Make OPENSSL_showfatal() do nothing (currently without stdio there's nothing we can do). +Remove file-based functionality from ssl/. The function prototypes were already gone, but not the functions themselves. +Remove unviable conf functionality via SYS_UEFI +Add fallback definition of BUFSIZ. +Remove functions taking FILE * from header files. +Add missing DECLARE_PEM_write_fp_const +Disable X509_LOOKUP_hash_dir(). X509_LOOKUP_file() was already compiled out, so remove its prototype. +Use OPENSSL_showfatal() in CRYPTO_destroy_dynlockid(). +Eliminate SRP_VBASE_init() and supporting functions. Users will need to build the verifier manually instead. +Eliminate compiler warning for unused do_pk8pkey_fp(). +Disable TEST_ENG_OPENSSL_PKEY. +Disable GOST engine as is uses [f]printf all over the place. +Eliminate compiler warning for unused send_fp_chars(). Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
* asn1t.h: silence -Wmissing-prototype in Windows builds.Andy Polyakov2015-09-291-1/+1
| | | | | | | On Windows OPENSSL_EXPORT_VAR_AS_FUNCTION is defined and in a sense this modification simply harmonizes it with "VAR_AS_VAR". Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT3948: Some structs have confusing names.Nicholas Cooper2015-09-292-4/+4
| | | | | Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add ability to set default CA path and file locations individuallyMatt Caswell2015-09-251-0/+2
| | | | | | | Previously you could only set both the default path and file locations together. This adds the ability to set one without the other. Reviewed-by: Andy Polyakov <appro@openssl.org>
* DTLSv1_listen rewriteMatt Caswell2015-09-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementation of DTLSv1_listen() is fundamentally flawed. This function is used in DTLS solutions to listen for new incoming connections from DTLS clients. A client will send an initial ClientHello. The server will respond with a HelloVerifyRequest containing a unique cookie. The client the responds with a second ClientHello - which this time contains the cookie. Once the cookie has been verified then DTLSv1_listen() returns to user code, which is typically expected to continue the handshake with a call to (for example) SSL_accept(). Whilst listening for incoming ClientHellos, the underlying BIO is usually in an unconnected state. Therefore ClientHellos can come in from *any* peer. The arrival of the first ClientHello without the cookie, and the second one with it, could be interspersed with other intervening messages from different clients. The whole purpose of this mechanism is as a defence against DoS attacks. The idea is to avoid allocating state on the server until the client has verified that it is capable of receiving messages at the address it claims to come from. However the existing DTLSv1_listen() implementation completely fails to do this. It attempts to super-impose itself on the standard state machine and reuses all of this code. However the standard state machine expects to operate in a stateful manner with a single client, and this can cause various problems. A second more minor issue is that the return codes from this function are quite confused, with no distinction made between fatal and non-fatal errors. Most user code treats all errors as non-fatal, and simply retries the call to DTLSv1_listen(). This commit completely rewrites the implementation of DTLSv1_listen() and provides a stand alone implementation that does not rely on the existing state machine. It also provides more consistent return codes. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Add BIO_CTRL_DGRAM_SET_PEEK_MODEMatt Caswell2015-09-231-0/+2
| | | | | | | Add the ability to peek at a message from the DTLS read BIO. This is needed for the DTLSv1_listen rewrite. Reviewed-by: Andy Polyakov <appro@openssl.org>
* New function X509_get0_subject_key_id()Dr. Stephen Henson2015-09-221-0/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make X509 opaqueDr. Stephen Henson2015-09-221-42/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>