summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-01-22Refactor config - @MK1MF_Builds out, general build scheme inRichard Levitte
Time to get rid of @MK1MF_Builds and introduce a more flexible 'build_scheme' configuration key. Its value may be a string or an array of strings, meaning we need to teach resolve_config how to handle ARRAY referenses. The build scheme is a word that selects a function to create the appropriate result files for a certain configuration. Currently valid build schemes aer "mk1mf" and "unixmake", the plan is however to add at least one other for a more universal build scheme. Incidently, this also adds the functions 'add' and 'add_before', which can be used in a configuration, so instead of having to repeatedly write a sub like this: key1 => sub { join(" ", @_, "myvalues"); }, key2 => sub { join(" ", "myvalues", @_); }, one could write this: key1 => add(" ", "myvalues"), key2 => add_before(" ", "myvalues"), The good point with 'add' and 'add_before' is that they handle inheritances where the values are a misture of scalars and ARRAYs. If there are any ARRAY to be found, the resulting value will be an ARRAY, otherwise it will be a scalar with all the incoming valued joined together with the separator given as first argument to add/add_before. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-22Refactor config - move templates and template docs to ConfigurationsRichard Levitte
Move the documentation of the target configuration form to Configurations/README. Move initial assembler object templates to Configurations/00-BASE-templates.conf. Furthermore, remove all variables containing the names of the non-assembler object files and make a BASE template of them instead. The values from this templates are used as defaults as is. The remaining manipulation of data when assembler modules are used is done only when $no_asm is false. While doing this, clean out some other related variables that aren't used anywhere. Also, we had to move the resolution of the chosen target a bit, or the function 'asm' would never catch a true $no_asm... this hasn't mattered before we've moved it all to the BASE template, but now it does. At the same time, add the default for the 'unistd' key to the BASE template. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-22Refresh the thinking of --prefix and --openssldirRichard Levitte
--prefix is now exclusively used for software and manual installation. --openssldir is not exclusively used as a default location for certs, keys and the default openssl.cnf. This change is made to bring clarity, to have the two less intertwined, and to be more compatible with the usual ways of software installation. Please change your habits and scripts to use --prefix rather than --openssldir for installation location now. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-21RT3863 ECC: Add missing NULL check. Set a flagBilly Brumley
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-21Refactor config - throw away the last remains of '--test-sanity'Richard Levitte
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-21Refactor config - consolidate handling of disabled stuffRichard Levitte
It's time to refactor the handling of %disabled so that all information of value is in the same place. We have so far had a few cascading disable rules in form of code, far away from %disabled. Instead, bring that information to the array @disable_cascade, which is a list of pairs of the form 'test => descendents'. The test part can be a string, and it's simply checked if that string is a key in %disabled, or it can be a CODEref to do a more complex test. If the test comes true, then all descendents are disabled. This check is performed until there are no more things that need to be disabled. Also, $default_depflags is constructed from the information in %disabled instead of being a separate string. While a string of its own is visually appealing, it's much too easy to forget to update it when something is changed in %disabled. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-21Refactor config - rewrite handling of "reconf"Richard Levitte
The way the "reconf"/"reconfigure" argument is handled is overly complicated. Just grep for it first, and if it is there in the current arguments, get the old command line arguments from Makefile. While we're at it, make the Makefile variable CONFIGURE_ARGS hold the value as a perl list of strings. This makes things much safer in case one of the arguments would contain a space. Since CONFIGURE_ARGS is used for nothing else, there's no harm in this. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20Multiple -trusted/-untrusted/-CRLfile options in verifyViktor Dukhovni
It is sometimes useful (especially in automated tests) to supply multiple trusted or untrusted certificates via separate files rather than have to prepare a single file containing them all. To that end, change verify(1) to accept these options zero or more times. Also automatically set -no-CAfile and -no-CApath when -trusted is specified. Improve verify(1) documentation, which could still use some work. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Refactor apps load_certs/load_crls to work incrementallyViktor Dukhovni
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20More X509_verify_cert() tests via verify(1).Viktor Dukhovni
Still need tests for trusted-first and tests that probe construction of alternate chains. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Reject when explicit trust EKU are set and none match.Viktor Dukhovni
Returning untrusted is enough for for full chains that end in self-signed roots, because when explicit trust is specified it suppresses the default blanket trust of self-signed objects. But for partial chains, this is not enough, because absent a similar trust-self-signed policy, non matching EKUs are indistinguishable from lack of EKU constraints. Therefore, failure to match any trusted purpose must trigger an explicit reject. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Commit pre-generated test_verify certsViktor Dukhovni
These can be re-generated via: cd test/certs; ./setup.sh if need be. The keys are all RSA 2048-bit keys, but it is possible to change that via environment variables. cd test/certs rm -f *-key.pem *-key2.pem OPENSSL_KEYALG=rsa OPENSSL_KEYBITS=3072 ./setup.sh cd test/certs rm -f *-key.pem *-key2.pem OPENSSL_KEYALG=ecdsa OPENSSL_KEYBITS=secp384r1 ./setup.sh ... Keys are re-used if already present, so the environment variables are only used when generating any keys that are missing. Hence the "rm -f" Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Scripts to generate verify test certsViktor Dukhovni
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Check Suite-B constraints with EE DANE recordsViktor Dukhovni
When DANE-EE(3) matches or either of DANE-EE/PKIX-EE fails, we don't build a chain at all, but rather succeed or fail with just the leaf certificate. In either case also check for Suite-B violations. As unlikely as it may seem that anyone would enable both DANE and Suite-B, we should do what the application asks. Took the opportunity to eliminate the "cb" variables in x509_vfy.c, just call ctx->verify_cb(ok, ctx) Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-20Refactor config - split read_config into read_config and resolve_configRichard Levitte
Split the read_config function into read_config that ONLY reads the configuration files but doesn't try to resolve any of the inheritances, and resolve_config which resolves the inheritance chain of a given target. Move them to the bottom of Configure, with the rest of the helpers. Have a new small hash table, %target, which will hold the values for the target the user requested. This also means that all access to the current target data can be reduced from '$table{$target}->{key}' to a mere '$target{key}'. While we're at it, the old string formatted configurations are getting obsolete, so they may as well get deprecated entirely. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-20Refactor config - throw away '--test-sanity'Richard Levitte
Get rid of the --test-sanity option. Since we no longer have string based configurations, we don't have the problem with miscounting colons any more. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-20Refactor config - a small cosmetic touchup of ConfigureRichard Levitte
Start simple, removed some unused variables and change all '<<EOF' to '<<"EOF"'. The latter is because some code colorizers (notably, in emacs) cannot recognise the here document end marker unless it's quoted and therefore assume the rest of the file is part of the here document. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-20Add an engine destructor to eng_cryptodev.Richard Levitte
Reviewed-by: Ben Laurie <ben@openssl.org>
2016-01-20Adapt BSD cryptodev engine to opaque EVP_MD_CTX, EVP_CIPHER_CTX, etcRichard Levitte
Reviewed-by: Ben Laurie <ben@openssl.org>
2016-01-20Remove update tagsRich Salz
Also remove depend/local_depend. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Consolidate "make update"Rich Salz
Rename 'update' to 'generate'. Rather than recurse, just explicitly call the three generate targets directly. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-20Handle SSL_shutdown while in init more appropriatelyMatt Caswell
Calling SSL_shutdown while in init previously gave a "1" response, meaning everything was successfully closed down (even though it wasn't). Better is to send our close_notify, but fail when trying to receive one. The problem with doing a shutdown while in the middle of a handshake is that once our close_notify is sent we shouldn't really do anything else (including process handshake/CCS messages) until we've received a close_notify back from the peer. However the peer might send a CCS before acting on our close_notify - so we won't be able to read it because we're not acting on CCS messages! Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-20make EVP_PKEY opaqueDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-19Remove the GOST engineMatt Caswell
The GOST engine is now out of date and is removed by this commit. An up to date GOST engine is now being maintained in an external repository. See: https://wiki.openssl.org/index.php/Binaries Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-19Fix BSD -rpath parameterRichard Levitte
For BSD systems, Configure adds a shared_ldflags including a reference to the Makefile variable LIBRPATH, but since it must be passed down to Makefile.shared, care must be taken so the value of LIBRPATH doesn't get expanded too early, or it ends up giving an empty string. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-19API compat for SSLeay_add_ssl_algorithmsViktor Dukhovni
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-19Validate ClientHello session_id field length and send alert on failureAlessandro Ghedini
RT#4080 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19prf redirection build fixesDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-19Update license year range to 2016Prayag Verma
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-19Support disabling any or all TLS or DTLS versionsViktor Dukhovni
Some users want to disable SSL 3.0/TLS 1.0/TLS 1.1, and enable just TLS 1.2. In the future they might want to disable TLS 1.2 and enable just TLS 1.3, ... This commit makes it possible to disable any or all of the TLS or DTLS protocols. It also considerably simplifies the SSL/TLS tests, by auto-generating the min/max version tests based on the set of supported protocols (425 explicitly written out tests got replaced by two loops that generate all 425 tests if all protocols are enabled, fewer otherwise). Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-19Add documentation for EVP_PKEY_TLS1_PRFDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19add TLS1-PRF testsDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19Add TLS1-PRF test support to evp_testDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19use TLS PRFDr. Stephen Henson
Modify libssl to use EVP_PKEY TLS PRF. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19Add TLS PRF method.Dr. Stephen Henson
Add EVP_PKEY algorithm for TLS1 PRF. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-19Fix GOST2012-NULL-GOST12Dmitry Belyavsky
Fix a typo in the definition of the GOST2012-NULL-GOST12 ciphersuite. RT#4213 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-18Drop cached certificate signature validity flagViktor Dukhovni
It seems risky in the context of cross-signed certificates when the same certificate might have multiple potential issuers. Also rarely used, since chains in OpenSSL typically only employ self-signed trust-anchors, whose self-signatures are not checked, while untrusted certificates are generally ephemeral. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-18Don't use "grep -q", "-q" is not POSIX, and fails on Solaris.Kristian Amlie
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-18Add some extra Cygwin targets as aliases for Cygwin-x86Richard Levitte
Cygwin was used for x86 before, so let's keep it around for those who still use it (it make Configure reconf possible). Cygwin-i[3456]86 for those that might generate and pass a target name directly to Configure. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-18Adjust the configuration target name from Cygwin-i686 to Cygwin-x86Richard Levitte
This is to reflect that it's not limited to just i686. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-01-18Fix configuration system to support different architectures on Cygwin.Corinna Vinschen
This patch allows to recognize the architectures supported by Cygwin and to choose the right configuration from there. Drop -march to use default architecture on 32 bit x86. Drop pre-Cygwin-1.3 recognition since it's long gone and there's no valid configuration for this anymore. Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-18Don't strip object files on CygwinCorinna Vinschen
Building for the Cygwin distro requires to be able to build debuginfo files. This in turn requires to build object files without stripping. The stripping is performed by the next step after building which creates the debuginfo files. Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-18Use POSIX functions on Cygwin, not Win32 functionCorinna Vinschen
Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-17Fix build break; restore missing targetRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-17Fix function declarations.Rich Salz
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-17Accessor update; fix API, document one.Rich Salz
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-01-17Remove some old makefile targetsRich Salz
Remove lint, tags, dclean, tests. This is prep for a new makedepend scheme. This is temporary pending unified makefile, and might help it. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-17Add some accessors.Rich Salz
Author: Remi Gacogne <rgacogne-github@coredump.fr> GH334: Add an OCSP_SINGLERESP_get0_id() accessor to the OCSP_CERTID of a OCSP_SINGLERESP. It is possible to do it the other way around using OCSP_resp_find(), but this is more efficient when you have a tree indexed by OCSP_CERTID, like haproxy does. (This is also RT4251) Author: Marek Klein <kleinmrk@gmail.com> GH556: OCSP_resp_get_produced_at() accessor to the producedAt of a OCSP_BASICRESP GH555: TS_STATUS_INFO_get_status(), TS_STATUS_INFO_get_text() and TS_STATUS_INFO_get_failure_info() accessors for a TS_STATUS_INFO Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-17RT4247: Add missing patchRich Salz
Missed the camellia EVP update. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-01-17The TLSProxy tests can't run if no-engine has been configuredRichard Levitte
Make sure they detect that. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>