aboutsummaryrefslogtreecommitdiffstats
path: root/apps/speed.c
Commit message (Collapse)AuthorAgeFilesLines
* speed.c: fix segfault with unrecognized algorithmsCristian Stoica2016-05-311-1/+5
| | | | | | | | | | | | | | When an unrecognized algorithm is given on command line together with -async_jobs, speed_main will jump to clean-up and run ASYNC_cleanup_thread without calling ASYNC_init_thread first. Example: openssl speed -async_jobs 4 ras2048 Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1084)
* Copyright consolidation 01/10Rich Salz2016-05-171-54/+7
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Fix error in the loop of ECDHAndrea Grandi2016-05-091-14/+14
| | | | | | | | The tests was incorrectly repeated multiple times when using the async_jobs options Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Rename some lowercase API'sRich Salz2016-04-181-3/+3
| | | | | | | | | Make OBJ_name_cmp internal Rename idea_xxx to IDEA_xxx Rename get_rfc_xxx to BN_get_rfc_xxx Rename v3_addr and v3_asid functions to X509v3_... Reviewed-by: Richard Levitte <levitte@openssl.org>
* Signed/unsigned compare.Ben Laurie2016-04-181-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove OPENSSL_NO_AES guardsMatt Caswell2016-04-131-25/+4
| | | | | | | no-aes is no longer a Configure option and therefore the OPENSSL_NO_AES guards can be removed. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Deprecate RAND_cleanup() and make it a no-opMatt Caswell2016-04-131-10/+0
| | | | | | | | RAND_cleanup() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix conditional compile logic in speed.cMatt Caswell2016-04-131-1/+1
| | | | | | | | The conditional compile logic wasn't quite right in speed.c for when both OPENSSL_NO_DSA and OPENSSL_NO_EC are defined. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add a check of the FD_SETSIZE before the call to select()Andrea Grandi2016-04-061-0/+10
| | | | | Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix no-dsaMatt Caswell2016-03-211-4/+13
| | | | | | Misc fixes for no-dsa. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix no-desMatt Caswell2016-03-181-0/+2
| | | | | | Numerous fixes for no-des. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove Netware and OS/2Rich Salz2016-03-171-5/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix names of the #define used for platform specific codeAndrea Grandi2016-03-081-2/+2
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add empty line after local variablesAndrea Grandi2016-03-081-0/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix error with wait set of fds for the select()Andrea Grandi2016-03-081-75/+24
| | | | | | | It also makes the call to select blocking to reduce CPU usage Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add a function to detect if we have async or notMatt Caswell2016-03-071-27/+15
| | | | | | | 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>
* Add support to ASYNC_WAIT_CTX to speedAndrea Grandi2016-03-071-18/+97
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove unnecessary memset() to 0 and check for NULL before OPENSSL_free()Andrea Grandi2016-03-071-25/+7
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix the error with RSA and the daysnc engine in async mode.Andrea Grandi2016-03-071-152/+211
| | | | | | | | | Move RSA struct in the job local struct. The change is applied also to other crypto operations (e.g. DSA) to make things consistent. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Add support for async jobs in OpenSSL speedAndrea Grandi2016-03-071-454/+1064
| | | | | | | | | | | | | | | | | | | Summary of the changes: * Move the calls to the crypto operations inside wrapper functions. This is required because ASYNC_start_job takes a function as an argument. * Add new function run_benchmark() that manages the jobs for all the operations. In the POSIX case it uses a select() to receive the events from the engine and resume the jobs that are paused, while in the WIN case it uses PeekNamedPipe() * Add new option argument async_jobs to enable and specify the number of async jobs Example: openssl speed -engine dasync -elapsed -async_jobs 32 rsa2048 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* add ecdhx25519 option to speedDr. Stephen Henson2016-02-281-5/+11
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Remove unused parameters from internal functionsRich Salz2016-02-221-4/+4
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* apps/speed.c: initialize c[D_GHASH][i].Andy Polyakov2016-02-131-0/+1
| | | | | | RT#4230 Reviewed-by: Richard Levitte <levitte@openssl.org>
* RT3755: Remove duplicate #includeRich Salz2016-01-311-3/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use POSIX functions on Cygwin, not Win32 functionCorinna Vinschen2016-01-181-9/+1
| | | | | | | Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Adapt all EVP_CIPHER users for it becoming opaqueRichard Levitte2016-01-121-3/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Adapt all EVP_CIPHER_CTX users for it becoming opaqueRichard Levitte2016-01-121-21/+19
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* remove ecdsa.h headerDr. Stephen Henson2015-12-091-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* remove ecdh.h headerDr. Stephen Henson2015-12-091-1/+0
| | | | | | Remove redundant ecdh.h header and any references to it. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Adapt the rest of the source to the opaque HMAC_CTXRichard Levitte2015-12-071-7/+11
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Have the few apps that accessed EVP_MD directly use accessors insteadRichard Levitte2015-12-071-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Adapt HMAC to the EVP_MD_CTX changesRichard Levitte2015-12-071-1/+1
| | | | | | | | | | | | | This change required some special treatment, as HMAC is intertwined with EVP_MD. For now, all local HMAC_CTX variables MUST be initialised with HMAC_CTX_EMPTY, or whatever happens to be on the stack will be mistaken for actual pointers to EVP_MD_CTX. This will change as soon as HMAC_CTX becomes opaque. Also, since HMAC_CTX_init() can fail now, its return type changes from void to int, and it will return 0 on failure, 1 on success. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Replace "SSLeay" in API with OpenSSLRich Salz2015-10-301-4/+4
| | | | | | | All instances of SSLeay (any combination of case) were replaced with the case-equivalent OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Centralise loading default apps config fileMatt Caswell2015-10-121-3/+0
| | | | | | | | | | | | | | | | | Loading the config file after processing command line options can cause problems, e.g. where an engine provides new ciphers/digests these are not then recoginised on the command line. Move the default config file loading to before the command line option processing. Whilst we're doing this we might as well centralise this instead of doing it individually for each application. Finally if we do it before the OpenSSL_add_ssl_algorithms() call then ciphersuites provided by an engine (e.g. GOST) can be available to the apps. RT#4085 RT#4086 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix -Wshadow warnings in mingw builds.Andy Polyakov2015-09-291-3/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Small typoRichard Levitte2015-09-201-1/+1
| | | | | | OPENSSL_NO_ECA changed to OPENSSL_NO_EC Reviewed-by: Stephen Henson <steve@openssl.org>
* Enable -Wmissing-variable-declarations andBen Laurie2015-09-111-1/+1
| | | | | | | -Wincompatible-pointer-types-discards-qualifiers (the latter did not require any code changes). Reviewed-by: Rich Salz <rsalz@openssl.org>
* apps/speed.c: fix memory leakEmilia Kasper2015-09-011-4/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Restore previous behaviour of only running one algorithm when -evp alg is used.Tim Hudson2015-08-171-1/+1
| | | | | Submitted by: Eric Young <eay@pobox.com> Reviewed-by: Ben Laurie <ben@openssl.org>
* restore usage of -elapsed that was disabled in the ifdef reorgTim Hudson2015-08-171-5/+0
| | | | Reviewed-by: Ben Laurie <ben@openssl.org>
* GH365: Missing #ifdef rename.Rich Salz2015-08-101-2/+2
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Use bio_err not stderr in apps.Rich Salz2015-06-091-6/+6
| | | | | | Except for VMS startup code. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Standardize handling of #ifdef'd options.Rich Salz2015-06-021-8/+8
| | | | | | | | | | | | | | | | | | Here are the "rules" for handling flags that depend on #ifdef: - Do not ifdef the enum. Only ifdef the OPTIONS table. All ifdef'd entries appear at the end; by convention "engine" is last. This ensures that at run-time, the flag will never be recognized/allowed. The next two bullets entries are for silencing compiler warnings: - In the while/switch parsing statement, use #ifdef for the body to disable it; leave the "case OPT_xxx:" and "break" statements outside the ifdef/ifndef. See ciphers.c for example. - If there are multiple options controlled by a single guard, OPT_FOO, OPT_BAR, etc., put a an #ifdef around the set, and then do "#else" and a series of case labels and a break. See OPENSSL_NO_AES in cms.c for example. Reviewed-by: Matt Caswell <matt@openssl.org>
* Restore module loadingRichard Levitte2015-05-291-0/+3
| | | | | | | The module loading feature got broken a while ago, so restore it, but have it a bit more explicit this time around. Reviewed-by: Stephen Henson <steve@openssl.org>
* Add missing terminating NULL to speed_options table.Kurt Cancemi2015-05-111-0/+1
| | | | | | | | | This would cause memory corruption in opt_init() because it relies on the terminating NULL. RT#3842 Reviewed-by: Rich Salz <rsalz@openssl.org>
* Use "==0" instead of "!strcmp" etcRich Salz2015-05-061-6/+6
| | | | | | | For the various string-compare routines (strcmp, strcasecmp, str.*cmp) use "strcmp()==0" instead of "!strcmp()" Reviewed-by: Tim Hudson <tjh@openssl.org>
* Use safer sizeof variant in mallocRich Salz2015-05-041-1/+1
| | | | | | | | | | | | | For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* more OSSL_NELEM casesDr. Stephen Henson2015-05-041-1/+1
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* free null cleanup finaleRich Salz2015-05-011-4/+2
| | | | | | Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* Sanity check EVP_CTRL_AEAD_TLS_AADMatt Caswell2015-04-301-2/+3
| | | | | | | | | | The various implementations of EVP_CTRL_AEAD_TLS_AAD expect a buffer of at least 13 bytes long. Add sanity checks to ensure that the length is at least that. Also add a new constant (EVP_AEAD_TLS1_AAD_LEN) to evp.h to represent this length. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org>