summaryrefslogtreecommitdiffstats
path: root/crypto
AgeCommit message (Collapse)Author
2016-02-10poly1305/poly1305.c: work around -Wshadow warnings with POLY1305_ASM.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10x86[_64] assembly pack: add ChaCha20 and Poly1305 modules.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10VMS getnameinfo() seems to have a bug with returned service stringRichard Levitte
It seems like it gives back gibberish. If we asked for a numeric service, it's easy to check for a digit in the first position, and if there isn't any, rewrite it using older methods. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10Make sure to always include string.h so memset gets declared.Richard Levitte
memset() is used by CRYPTO_secure_zalloc(), which isn't hidden away behind IMPLEMENTED. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Don't run RC4 test with no-rc4Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Use NON_EMPTY_TRANSLATION_UNIT, consistently.Rich Salz
This also closes RT 4123 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Make some global variables staticMatt Caswell
Make some global variables that are only ever accessed from one file static. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09NULL the thread_local_inits_st pointer after useMatt Caswell
After the final use of the thread_local_inits_st we should ensure it is set to NULL, just in case OPENSSL_INIT_thread_stop gets called again and it tries to use garbage. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Stop library before checking for mem leaksMatt Caswell
With the new init framework resources aren't released until the process exits. This means checking for mem leaks before that point finds a lot of things! We should explicitly close down the library if we're checking for mem leaks. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-09Portability fixRich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-09s390x assembly pack: add ChaCha20 and Poly1305 modules.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-09Updates for auto init/deinit review commentsMatt Caswell
Fixes for the auto-init/deinit code based on review comments Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Correct copyright date for internal header fileMatt Caswell
The newly added internal async.h header file had last years date in it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Update build.info files for auto-init/de-initMatt Caswell
Various Makefile.in files have changes for auto-init/de-init. Make the equivalent changes in build.info. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Avoid a race condition in loading config settingsMatt Caswell
A race condition can occur when sending config settings to OPENSSL_INIT_crypto_library_start() Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Add an OPENSSL_NO_AUTOERRINIT optionMatt Caswell
This option disables automatic loading of the crypto/ssl error strings in order to keep statically linked executable file size down Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Provide a thread stop APIMatt Caswell
Add the OPENSSL_INIT_thread_stop() function. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Auto init/deinit libcryptoMatt Caswell
This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-09Provide framework for auto initialise/deinitialise of the libraryMatt Caswell
This commit provides the basis and core code for an auto initialisation and deinitialisation framework for libcrypto and libssl. The intention is to remove the need (in many circumstances) to call explicit initialise and deinitialise functions. Explicit initialisation will still be an option, and if non-default initialisation is needed then it will be required. Similarly for de-initialisation (although this will be a lot easier since it will bring all de-initialisation into a single function). Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08Small fixesRichard Levitte
- One typo fixed in crypto/bio/b_addr.c - Add a comment in doc/crypto/BIO_parse_hostserv.pod to explain the blank lines with one lonely space each. Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-08add missing file p12_lcl.hDr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-08Suppress DANE TLSA reflection when verification failsViktor Dukhovni
As documented both SSL_get0_dane_authority() and SSL_get0_dane_tlsa() are expected to return a negative match depth and nothing else when verification fails. However, this only happened when verification failed during chain construction. Errors in verification of the constructed chain did not have the intended effect on these functions. This commit updates the functions to check for verify_result == X509_V_OK, and no longer erases any accumulated match information when chain construction fails. Sophisticated developers can, with care, use SSL_set_verify_result(ssl, X509_V_OK) to "peek" at TLSA info even when verification fail. They must of course first check and save the real error, and restore the original error as quickly as possible. Hiding by default seems to be the safer interface. Introduced X509_V_ERR_DANE_NO_MATCH code to signal failure to find matching TLSA records. Previously reported via X509_V_ERR_CERT_UNTRUSTED. This also changes the "-brief" output from s_client to include verification results and TLSA match information. Mentioned session resumption in code example in SSL_CTX_dane_enable(3). Also mentioned that depths returned are relative to the verified chain which is now available via SSL_get0_verified_chain(3). Added a few more test-cases to danetest, that exercise the new code. Resolved thread safety issue in use of static buffer in X509_verify_cert_error_string(). Fixed long-stating issue in apps/s_cb.c which always sets verify_error to either X509_V_OK or "chain to long", code elsewhere (e.g. s_time.c), seems to expect the actual error. [ The new chain construction code is expected to correctly generate "chain too long" errors, so at some point we need to drop the work-arounds, once SSL_set_verify_depth() is also fixed to propagate the depth to X509_STORE_CTX reliably. ] Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08Following the PKCS#12 update, update crypto/pkcs12/build.info as wellRichard Levitte
Reviewed-by: Stephen Henson <steve@openssl.org>
2016-02-08fix various formatting issuesDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08use new function namesDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08Add p12_sbag.c to Makefile.inDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08Reorganise functions.Dr. Stephen Henson
Move all PKCS12_SAFEBAG functions into new file p12_sbag.c. Move MAC functions into p12_mutl.c Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08Use new namesDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08Rename PKCS12 functionDr. Stephen Henson
Rename ancient PKCS12 functions to use more logical names. Include defines from old to new name. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08pkcs12 accessorsDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08more PKCS12 opacityDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08New PKCS12 accessors, change macros to functions.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08Make PKCS12 structures opaqueDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08GH641: Don't care openssl_zmallocRich Salz
Don't cast malloc-family return values. Also found some places where (a) blank line was missing; and (b) the *wrong* return value was checked. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08bio/b_sock.c: cleanup obsolete stuff.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08bn/Makefile.in: remove obsolete rules.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08avoid crash if hostserv is with host part onlyRoumen Petrov
(if priority is set to host) Signed-off-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08GH322 revisited: remove unused function.Rich Salz
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-06if no comparison function set make sk_sort no opDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-06Enhance and clear the support of linker flagsRichard Levitte
Some time ago, we had a ex_libs configuration setting that could be divided into lflags and ex_libs. These got divided in two settings, lflags and ex_libs, and the former was interpreted to be general linking flags. Unfortunately, that conclusion wasn't entirely accurate. Most of those linking were meant to end up in a very precise position on the linking command line, just before the spec of libraries the linking depends on. Back to the drawing board, we're diving things further, now having lflags, which are linking flags that aren't depending on command line position, plib_lflags, which are linking flags that should show up just before the spec of libraries to depend on, and finally ex_libs, which is the spec of extra libraries to depend on. Also, documentation is changed in Configurations/README. This was previously forgotten. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05Add a BIO_ADDR_clear functionMatt Caswell
Adds a new function BIO_ADDR_clear to reset a BIO_ADDR back to an unitialised state, and to set the family to AF_UNSPEC. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-05GH601: Various spelling fixes.FdaSilvaYY
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-05Ensure correct chain depth for policy checks with DANE bare key TAViktor Dukhovni
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-02-05Long overdue cleanup of X509 policy tree verificationViktor Dukhovni
Replace all magic numbers with #defined constants except in boolean functions that return 0 for failure and 1 for success. Avoid a couple memory leaks in error recovery code paths. Code style improvements. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-02-05Fix return code in CRYPTO_mem_leaks_fp()Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-05VMS lacks socklen_t, give it oneRichard Levitte
Fortunately, we only use socklen_t internally Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-05Initialize variableRichard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-05Add EC_KEY_priv2buf()Dr. Stephen Henson
Add new function EC_KEY_priv2buf() to allocated and encode private key octet in one call. Update and simplify ASN.1 and print routines. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-05Allocate ASN1_bn_print buffer internally.Dr. Stephen Henson
Don't require an application to work out the appropriate buffer size for ASN1_bn_print(), which is unsafe. Ignore the supplied buffer and allocate it internally instead. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-05Use BN_bn2binpadDr. Stephen Henson
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>