summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-03-07Move the _hidden_* static variables in dasync to be constructed in bindMatt Caswell
The _hidden_* variables were being created on-the-fly. It is better to create them once up front during bind to avoid any potential race conditions. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Fix typo in SSL_pending docsMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Rename EVP_CIPHER_CTX_cipher_data to EVP_CIPHER_CTX_get_cipher_dataMatt Caswell
We had the function EVP_CIPHER_CTX_cipher_data which is newly added for 1.1.0. As we now also need an EVP_CIPHER_CTX_set_cipher_data it makes more sense for the former to be called EVP_CIPHER_CTX_get_cipher_data. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Fix s_server/s_client handling of the split_send_frag argumentMatt Caswell
Ensure that a value of 0 is correctly handled for the split_send_frag argument. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add documentation for the EVP_CIPHER_CTX_cipher_data functionsMatt Caswell
The new pipeline code added a new function EVP_CIPHER_CTX_set_cipher_data(). Add documentation for this and the existing EVP_CIPHER_CTX_cipher_data() function. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Remove the wrec record layer fieldMatt Caswell
We used to use the wrec field in the record layer for keeping track of the current record that we are writing out. As part of the pipelining changes this has been moved to stack allocated variables to do the same thing, therefore the field is no longer needed. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Update a commentMatt Caswell
Update a comment that was out of date due to the pipelining changes Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add documentation for new s_server/s_client optionsMatt Caswell
Document the new split_send_frag, max_pipelines and read_buf options. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add documentation for SSL_has_pending()Matt Caswell
A previous commit added the SSL_has_pending() function which provides a method for knowing whether OpenSSL has buffered, but as yet unprocessed record data. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add pipelining documentationMatt Caswell
Add some documentation for all of the SSL/SSL_CTX functions/ctrls for conrolling read and write pipelining. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Fix erroneous fall thgrough in switch statementMatt Caswell
Fix an erroenous fall through when setting the max_pipelines value. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Ensure s_client and s_server work when read_ahead is setMatt Caswell
Previously s_client and s_server relied on using SSL_pending() which does not take into account read_ahead. For read pipelining to work, read_ahead gets set automatically. Therefore s_client and s_server have been converted to use SSL_has_pending() instead. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add an SSL_has_pending() functionMatt Caswell
This is similar to SSL_pending() but just returns a 1 if there is data pending in the internal OpenSSL buffers or 0 otherwise (as opposed to SSL_pending() which returns the number of bytes available). Unlike SSL_pending() this will work even if "read_ahead" is set (which is the case if you are using read pipelining, or if you are doing DTLS). A 1 return value means that we have unprocessed data. It does *not* necessarily indicate that there will be application data returned from a call to SSL_read(). The unprocessed data may not be application data or there could be errors when we attempt to parse the records. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add an ability to set the SSL read buffer sizeMatt Caswell
This capability is required for read pipelining. We will only read in as many records as will fit in the read buffer (and the network can provide in one go). The bigger the buffer the more records we can process in parallel. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Lazily initialise the compression bufferMatt Caswell
With read pipelining we use multiple SSL3_RECORD structures for reading. There are SSL_MAX_PIPELINES (32) of them defined (typically not all of these would be used). Each one has a 16k compression buffer allocated! This results in a significant amount of memory being consumed which, most of the time, is not needed. This change swaps the allocation of the compression buffer to be lazy so that it is only done immediately before it is actually used. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Implement read pipeline support in libsslMatt Caswell
Read pipelining is controlled in a slightly different way than with write pipelining. While reading we are constrained by the number of records that the peer (and the network) can provide to us in one go. The more records we can get in one go the more opportunity we have to parallelise the processing. There are two parameters that affect this: * The number of pipelines that we are willing to process in one go. This is controlled by max_pipelines (as for write pipelining) * The size of our read buffer. A subsequent commit will provide an API for adjusting the size of the buffer. Another requirement for this to work is that "read_ahead" must be set. The read_ahead parameter will attempt to read as much data into our read buffer as the network can provide. Without this set, data is read into the read buffer on demand. Setting the max_pipelines parameter to a value greater than 1 will automatically also turn read_ahead on. Finally, the read pipelining as currently implemented will only parallelise the processing of application data records. This would only make a difference for renegotiation so is unlikely to have a significant impact. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add dummy pipeline support for aes128_cbc_hmac_sha1Matt Caswell
Add dummy pipline support to dasync for the aes128_cbc_hmac_sha1 cipher. This is treated as an AEAD cipher. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add pipeline support to s_server and s_clientMatt Caswell
Add the options min_send_frag and max_pipelines to s_server and s_client in order to control pipelining capabilities. This will only have an effect if a pipeline capable cipher is used (such as the one provided by the dasync engine). Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Implement write pipeline support in libsslMatt Caswell
Use the new pipeline cipher capability to encrypt multiple records being written out all in one go. Two new SSL/SSL_CTX parameters can be used to control how this works: max_pipelines and split_send_fragment. max_pipelines defines the maximum number of pipelines that can ever be used in one go for a single connection. It must always be less than or equal to SSL_MAX_PIPELINES (currently defined to be 32). By default only one pipeline will be used (i.e. normal non-parallel operation). split_send_fragment defines how data is split up into pipelines. The number of pipelines used will be determined by the amount of data provided to the SSL_write call divided by split_send_fragment. For example if split_send_fragment is set to 2000 and max_pipelines is 4 then: SSL_write called with 0-2000 bytes == 1 pipeline used SSL_write called with 2001-4000 bytes == 2 pipelines used SSL_write called with 4001-6000 bytes == 3 pipelines used SSL_write_called with 6001+ bytes == 4 pipelines used split_send_fragment must always be less than or equal to max_send_fragment. By default it is set to be equal to max_send_fragment. This will mean that the same number of records will always be created as would have been created in the non-parallel case, although the data will be apportioned differently. In the parallel case data will be spread equally between the pipelines. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Update the dasync engine to add a pipeline cipherMatt Caswell
Implement aes128-cbc as a pipeline capable cipher in the dasync engine. As dasync is just a dummy engine, it actually just performs the parallel encrypts/decrypts in serial. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Add defines for pipeline capable ciphersMatt Caswell
Add a flag to indicate that a cipher is capable of performing "pipelining", i.e. multiple encrypts/decrypts in parallel. Also add some new ctrls that ciphers will need to implement if they are pipeline capable. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07make updateMatt Caswell
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Trim Travis config part 3Emilia Kasper
- Only build & test two configurations. Make all the other build variants buildonly on gcc (clang on osx). - Don't build with default clang at all on linux. - Only use gcc-5 and clang-3.6 for the sanitizer builds. Re-running e.g. CONFIG_OPTS="shared" with them seems redundant. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-07Revert "Allow OPENSSL_NO_SOCK in e_os.h even for non-Windows/DOS platforms"Rich Salz
This reverts commit 963bb62195109fb863dc4d88c7470ce7f9af25ac. Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-03-07Fix pkeyutl to KDF lnks.Rich Salz
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-07Remove really old demo'sRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-07Elide OPENSSL_INIT_set_config_filename() for no-stdio buildDavid Woodhouse
Strictly speaking, it isn't stdio and file access which offend me here; it's the fact that UEFI doesn't provide a strdup() function. But the fact that it's pointless without file access is a good enough excuse for compiling it out. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Elide DES_read_password() for no-ui buildDavid Woodhouse
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Move declaration of X509_aux_print() out of #ifndef OPENSSL_NO_STDIODavid Woodhouse
This isn't a file access function; it's still present. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Allow OPENSSL_NO_SOCK in e_os.h even for non-Windows/DOS platformsDavid Woodhouse
UEFI needs this too. Don't keep it only in the Windows/DOS ifdef block. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07ISSUE 43: Add BIO_sock_shutdownRich Salz
This replaces SHUTDOWN/SHUTDOWN2 with BIO_closesocket. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-07Minor update to includes and documentation for ct_test.cRob Percival
Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Remove OPENSSL_NO_UNIT_TEST guard from ct_test.cRob Percival
Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Use s->session->peer instead of calling SSL_get_peer_certificate(s)Rob Percival
Avoids modifying certificate reference count, and thereby avoids locking. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Lowercase name of SSL_validate_ct as it is an internal functionRob Percival
Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07CT code now calls X509_free() after calling SSL_get_peer_certificate()Rob Percival
Without this, the peer certificate would never be deleted, resulting in a memory leak. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Fixes memory leaks in CT codeRob Percival
Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Fix the build tree include directory for afalg engineRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Make OpenSSL::Test::setup() a bit more forgivingRichard Levitte
It was unexpected that OpenSSL::Test::setup() should be called twice by the same recipe. However, that may happen if a recipe combines OpenSSL::Test and OpenSSL::Test::Simple, which can be a sensible thing to do. Therefore, we now allow it. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Elide EVP_read_pw_string() and friends for no-uiDavid Woodhouse
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-03-07GH768: Minor grammar nits in CRYPTO_get_ex_new_index.podBenjamin Kaduk
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-03-07Unified - adapt the generation of padlock assembler to use GENERATERichard Levitte
This gets rid of the BEGINRAW..ENDRAW sections in engines/build.info. This also moves the assembler generating perl scripts to take the output file name as last command line argument, where necessary. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Unified - adapt the generation of bignum assembler to use GENERATERichard Levitte
This gets rid of the BEGINRAW..ENDRAW sections in crypto/bn/build.info. This also moves the assembler generating perl scripts to take the output file name as last command line argument, where necessary. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Unified - Add the build.info command OVERRIDE, to avoid build file clashesRichard Levitte
Should it be needed because the recipes within a RAW section might clash with those generated by Configure, it's possible to tell it not to generate them with the use of OVERRIDES, for example: SOURCE[libfoo]=foo.c bar.c OVERRIDES=bar.o BEGINRAW[Makefile(unix)] bar.o: bar.c $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $< ENDRAW[Makefile(unix)] Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Unified - Adapt the Unix and VMS templates to support GENERATERichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Unified - Add the build.info command GENERATE, to generate source filesRichard Levitte
In some cases, one might want to generate some source files from others, that's done as follows: GENERATE[foo.s]=asm/something.pl $(CFLAGS) GENERATE[bar.s]=asm/bar.S The value of each GENERATE line is a command line or part of it. Configure places no rules on the command line, except the the first item muct be the generator file. It is, however, entirely up to the build file template to define exactly how those command lines should be handled, how the output is captured and so on. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07Add a function to detect if we have async or notMatt Caswell
Add the ASYNC_is_capable() function and use it in speed. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07GH804: Fix unused-result warnings in dasyncAlessandro Ghedini
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-03-07documentation and duplicate goto statementsBilly Brumley
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-03-07move ifdef statementsBilly Brumley
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>