summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Move ASN1_BROKEN macrosRich Salz2019-03-192-7/+6
| | | | | | | | They're only used in one place, and only for a legacy datatype. Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8302)
* EVP_PKEY_get0_engine documentationDmitry Belyavskiy2019-03-191-1/+4
| | | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8329)
* Providing missing accessor to EVP_PKEY.engineDmitry Belyavskiy2019-03-193-0/+7
| | | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8329)
* apps/speed.c: properly address NO_EC2M on systems without SIGALRMVitezslav Cizek2019-03-191-30/+39
| | | | | | | | | | | | | | | | | | The ecdh_c array is allocated of the same size as ecdh_choices, whose size depends on whether the support for binary curves is enabled or not. (The same goes for ecdsa_c). On systems without SIGALRM, ecdh_c is indexed by predefined constants intended for representing the index of the ciphers in the ecdh_choices array. However, in case of NO_EC2M some of the #defined constants won't match and would actually access the ecdh_c out-of-bounds. Use enum instead of a macro to define the curve indexes so they're within the bounds of the ecdh_c array. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8422)
* apps/speed.c: skip binary curves when compiling with OPENSSL_NO_EC2MVitezslav Cizek2019-03-191-0/+6
| | | | | | | | | | openssl speed doesn't take into account that the library could be compiled without the support for the binary curves and happily uses them, which results in EC_GROUP_new_by_curve_name() errors. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8422)
* Add documentation for the -sigopt option.Pauli2019-03-194-4/+23
| | | | | Reviewed-by: Paul Yang <yang.yang@baishancloud.com> (Merged from https://github.com/openssl/openssl/pull/8520)
* Configure: untabify indentationDr. Matthias St. Pierre2019-03-191-597/+597
| | | | | | | | | | | | | | | The indentation in the Configure file is currently very strange when viewed in an editor with a tab width of four spaces, because it has mixed tab-and-whitespace indentation, which was apparently done with a tab width of eight spaces. This commit converts all tabs to spaces using expand(1) with default settings. To verify that there are only whitespace changes, use git show --ignore-space-change <this commit> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8492)
* Fix resource leak coverity 1443711.Pauli2019-03-191-5/+4
| | | | | | | Free the allocated pointer on error. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8503)
* Fix compiling error for mips32r6 and mips64r6Hua Zhang2019-03-192-2/+2
| | | | | | | | | | | | | | There are some compiling errors for mips32r6 and mips64r6: crypto/bn/bn-mips.S:56: Error: opcode not supported on this processor: mips2 (mips2) `mulu $1,$12,$7' crypto/mips_arch.h: Assembler messages: crypto/mips_arch.h:15: Error: junk at end of line, first unrecognized character is `&' Signed-off-by: Hua Zhang <hua.zhang1974@hotmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8464)
* Add missing '.text' in crypto/bn/asm/ppc.plRichard Levitte2019-03-191-0/+1
| | | | | | | Fixes #8495 Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8496)
* Fix no-posix-ioRichard Levitte2019-03-191-7/+2
| | | | | | | | | | | | | | | | 'openssl pkeyutl' uses stat() to determine the file size when signing using Ed25519/Ed448, and this was guarded with OPENSSL_NO_POSIX_IO. It is however arguable if stat() is a POSIX IO function, considering that it doesn't use file descriptors, and even more so since we use stat() elsewhere without that guard. This will allow test/recipes/20-test_pkeyutl.t to be able to do its work for Ed25519/Ed448 signature tests. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8498)
* Added NULL check to BN_clear() & BN_CTX_end()Shane Lontis2019-03-1916-54/+31
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8518)
* Fix strict-warnings build on FreeBSDBenjamin Kaduk2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | The 'key' member of the (system-defined!) struct session op is of type c_caddr_t, which can be (signed) char, so inter-casting with the unsigned char* input to cipher_init() causes -Wpointer-sign errors, and we can't change the signature of cipher_init() due to the function pointer type required by EVP_CIPHER_meth_set_init(). As the least-bad option, introduce a void* cast to quell the following warning: engines/e_devcrypto.c:356:36: error: passing 'c_caddr_t' (aka 'const char *') to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign] return cipher_init(to_ctx, cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx), ^~~~~~~~~~~~~~~~~~~~ engines/e_devcrypto.c:191:66: note: passing argument to parameter 'key' here static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8509)
* doc/man3/OSSL_PARAM_TYPE.pod: modify Example 2 to allow unspecified paramsRichard Levitte2019-03-191-3/+11
| | | | | | | | | | A parameter requestor is never obligated to ask for all available parameters on an object. Unfortunately, Example 2 showed a code pattern that introduced such an obligation, and therefore needed a small adjustment. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8523)
* Add -new and -subj options to x509 app for direct cert generationDavid von Oheimb2019-03-194-23/+113
| | | | | | | | Complete and improve error output of parse_name() in apps/apps.c Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8193)
* Clear the point S before freeing in ec_scalar_mul_ladderBernd Edlinger2019-03-181-1/+1
| | | | | | | | The secret point R can be recovered from S using the equation R = S - P. The X and Z coordinates should be sufficient for that. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8504)
* Clear the secret point in ecdh_simple_compute_keyBernd Edlinger2019-03-181-1/+1
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8501)
* add 'Signature Value:' line and correct indentation when printing X.509 ↵David von Oheimb2019-03-184-48/+54
| | | | | | | | signature value Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
* update reference output of test_x509 in test/certs/cyrillic.*David von Oheimb2019-03-182-4/+2
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
* remove 'keyid:' when printing simple X509 authority keyID (without issuer ↵David von Oheimb2019-03-181-1/+1
| | | | | | | | and serial) Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
* remove needless empty lines when printing certificatesDavid von Oheimb2019-03-189-20/+33
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
* Add generic EVP method fetcherRichard Levitte2019-03-184-1/+444
| | | | | | | | | | | | | | This is an interface between Core dispatch table fetching and EVP_{method}_fetch(). All that's needed from the diverse method fetchers are the functions to create a method structure from a dispatch table, a function that ups the method reference counter and a function to free the method (in case of failure). This routine is internal to the EVP API andis therefore only made accessible within crypto/evp, by including evp_locl.h Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8341)
* Replumbing: better reference counter control in ossl_method_construct()Richard Levitte2019-03-182-13/+33
| | | | | | | | Fully assume that the method constructors use reference counting. Otherwise, we may leak memory, or loose track and do a double free. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8341)
* Replumbing: pass callback data to the algo destructor tooRichard Levitte2019-03-182-3/+3
| | | | | | | | | All relevant OSSL_METHOD_CONSTRUCT_METHOD callbacks got the callback data passed to them, except 'destruct'. There's no reason why it shouldn't get that pointer passed, so we make a small adjustment. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8341)
* PPC assembly pack: fix copy-paste error in CTR modeDaniel Axtens2019-03-181-2/+2
| | | | | | | | | | | | | | | | | | | There are two copy-paste errors in handling CTR mode. When dealing with a 2 or 3 block tail, the code branches to the CBC decryption exit path, rather than to the CTR exit path. This can lead to data corruption: in the Linux kernel we have a copy of this file, and the bug leads to corruption of the IV, which leads to data corruption when we call the encryption function again later to encrypt subsequent blocks. Originally reported to the Linux kernel by Ondrej Mosnáček <omosnacek@gmail.com> CLA: trivial Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8510)
* coverity fixes for bntest.cShane Lontis2019-03-181-174/+212
| | | | | | Reviewed-by: Paul Yang <yang.yang@baishancloud.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8508)
* EVP_PBE_scrypt() handles salt=NULL as salt=""Victor Stinner2019-03-171-0/+4
| | | | | | | | | | | | | | | Modify EVP_PBE_scrypt() to maintain OpenSSL 1.1.1 behavior: salt=NULL is now handled as salt="" (and saltlen=0). Commit 5a285addbf39f91d567f95f04b2b41764127950d changed the behavior of EVP_PBE_scrypt(salt=NULL). Previously, salt=NULL was accepted, but the function now fails with KDF_R_MISSING_SALT. CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8483)
* test/params_api_test.c: fix size_t assumptionsRichard Levitte2019-03-171-2/+2
| | | | | | | | | size_t isn't always as large as a int64_t, so the compiler complains about possible data loss. In this case, we are in control, so a simple cast will do. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8497)
* Update to xenialBernd Edlinger2019-03-161-49/+15
| | | | | | | [extended tests] Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8411)
* Configurations/windows-makefile.tmpl: small fixesRichard Levitte2019-03-151-2/+2
| | | | | | | Fixes #8467 #8478 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8468)
* Guard some SM2 functions with OPENSSL_NO_SM2Matt Caswell2019-03-152-2/+4
| | | | | | | Fixes the no-ec build Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8481)
* trace: update the documentationDr. Matthias St. Pierre2019-03-153-13/+78
| | | | | | | | | | | This commit adds some missing symbols and other minor enhancements. In particular, it establishes the term 'channel' as a synonym for a BIO object attached to a trace category, and introduces the concept of a 'simple' channel versus a 'callback' channel. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8463)
* trace: ensure correct groupingDr. Matthias St. Pierre2019-03-152-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is important that output to the trace channels occurs only inside a trace group. This precondtion is satisfied whenever the standard TRACE macros are used. It can be violated only by a bad programming mistake, like copying the 'trc_out' pointer and using it outside the trace group. This commit enforces correct pairing of the OSSL_TRACE_CTRL_BEGIN and OSSL_TRACE_CTRL_END callbacks, and checks that OSSL_TRACE_CTRL_WRITE callbacks only occur within such groups. While implementing it, it turned out that the group assertion failed apps/openssl.c:152: OpenSSL internal error: \ Assertion failed: trace_data->ingroup because the set_trace_data() function invokes some callbacks which generate trace output, but the correct channel type was set only after the set_trace_data() call. To fix the failed assertions, the correct channel type is now set inside the set_trace_data() call, instead of doing it afterwards. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8463)
* trace: don't leak the line prefixDr. Matthias St. Pierre2019-03-153-22/+18
| | | | | | | | | | | | | | | | | | | | | | | The openssl app registers trace callbacks which automatically set a line prefix in the OSSL_TRACE_CTRL_BEGIN callback. This prefix needs to be cleared in the OSSL_TRACE_CTRL_END callback, otherwise a memory leak is reported when openssl is built with crypto-mdebug enabled. This leak causes the tests to fail when tracing and memory debugging are enabled. The leak can be observed by any command that produces trace output, e.g. by OPENSSL_TRACE=ANY util/shlib_wrap.sh apps/openssl version ... [00:19:14] 4061 file=apps/bf_prefix.c, line=152, ... 26 bytes leaked in 1 chunks Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8463)
* trace: rename the trace channel typesDr. Matthias St. Pierre2019-03-151-7/+7
| | | | | | | | | | | | Since the term 'channel' is already used as synonym for a BIO object attached to a trace category, having a 't_channel' channel type and a 't_callback' channel type somehow overburdens this term. For that reason the type enum constants are renamed to 'SIMPE_CHANNEL' and 'CALLBACK_CHANNEL'. (The conversion to capital letters was done to comply to the coding style.) Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8463)
* trace: remove some magic numbersDr. Matthias St. Pierre2019-03-151-15/+22
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8463)
* VMS: only use the high precision on VMS v8.4 and upDr. Matthias St. Pierre2019-03-151-0/+4
| | | | | | | | | Fixes #8487 Amends #7230 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8488)
* internal/refcount.h: allow non-atomic buildRichard Levitte2019-03-141-20/+29
| | | | | | | | | | Configure with -DOPENSSL_DEV_NO_ATOMICS and you get refcount without atomics. This is intended for internal development only, to check the refcounting is properly coded. It should never become a configuration option, hence the name of the macro. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8479)
* crypto/provider_core.c: correct definition and use of lockRichard Levitte2019-03-141-12/+8
| | | | | | | Fixes #8476 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8477)
* Enable pkeyutl to use Ed448 and Ed25519Matt Caswell2019-03-143-67/+161
| | | | | | | | | | With the recent addition of the -rawin option it should be possible for pkeyutl to sign and verify with Ed448 and Ed2559. The main remaining stumbling block is that those algorirthms only support "oneshot" operation. This commit enables pkeyutl to handle that. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8431)
* Configure: disable new trace api by defaultDr. Matthias St. Pierre2019-03-145-10/+22
| | | | | | | Fixes #8472 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8474)
* Don't fail when tracing is disabledRichard Levitte2019-03-141-16/+17
| | | | | | | | When tracing is disabled, don't generate errors, especially during init. Instead, just pretend the everything is fine. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8475)
* Fix memory leak in ectestNicola Tuveri2019-03-131-0/+1
| | | | | | | Fixes #8462 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8466)
* test/params_test.c: use TEST_double_eq to check doublesRichard Levitte2019-03-131-3/+3
| | | | | | | | TEST_ulong_eq was used previously because TEST_double_eq didn't exist at the time. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8469)
* test/params_test.c: make more global variables staticRichard Levitte2019-03-131-2/+2
| | | | | | | Again, compilers that don't like them being undeclared... Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8469)
* test/params_test.c: make construct_api_params() staticRichard Levitte2019-03-131-1/+1
| | | | | | | | With enough warning flags, compilers complain when a non-static function hasn't been properly declared... Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/8469)
* prevent app_get_pass() from revealing cleartext password on syntax errorDavid von Oheimb2019-03-131-1/+13
| | | | | | | | | | | | When the argument for '-pass' was badly formed, that argument got displayed in full. This turns out to not be such a good idea if the user simply forgot to start the argument with 'pass:', or spellt the prefix incorrectly. We therefore change the display to say that a colon is missing or only showing the incorrect prefix. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6218)
* test/params_test.c: Add run-time constructed OSSL_PARAM variantRichard Levitte2019-03-131-29/+111
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8396)
* test/params_test.c: Add API test case, and mixed methodsRichard Levitte2019-03-131-3/+85
| | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8396)
* test/params_test.c: Add "real world" parameter testingRichard Levitte2019-03-133-1/+406
| | | | | | | | | | | | | | test/params_test.c is a program that tries to mimic how a provider and an application would or could handle OSSL_PARAM arrays. For the moment, this program tests a very raw way of handling OSSL_PARAM arrays. It is, however, written in a way that will hopefully make it possible to extend with other methods as APIs arise, and to set up test cases where a "provider" handles the array one way while the "application" handles it another way. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8396)