summaryrefslogtreecommitdiffstats
path: root/util
AgeCommit message (Collapse)Author
2021-08-24Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org>
2021-03-30Print correct error message in utils/mkdir-p.plAlex Yursha
Commit 70a56b914772e6b21cda2a5742817ae4bb7290f1 introduced a regression. If utils/mkdir-p.pl fails to create a target dir because of insufficient file system permissions, the subsequent test for dir existence always fails and overwrites the system error. As a result, a user is presented with a misleading error message. E.g. if a user tries to create a dir under /usr/local and does not have permissions for it, the reported error message is "Cannot create directory /usr/local/lib: No such file or directory", whereas the expected error message is "Cannot create directory /usr/local/lib: Permission denied". This commit introduces a fix by declaring an additional local variable to cache the original error message from mkdir. If -d check fails and overwrites the system error, the user is still presented with the original error from mkdir. CLA: Trivial Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14487) (cherry picked from commit af2e1e9c81110ca1a156430686e2f171e80ebfa0)
2021-03-25Update copyright yearMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org>
2021-03-25Teach TLSProxy how to encrypt <= TLSv1.2 ETM recordsMatt Caswell
Previously TLSProxy only knew how to "repack" messages for TLSv1.3. Most of the handshake in <= TLSv1.2 is unencrypted so this hasn't been too much of restriction. However we now want to modify reneg handshakes which are encrypted so we need to add that capability. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org>
2020-09-22Update copyright yearMatt Caswell
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/12949)
2020-09-21EC_KEY: add EC_KEY_decoded_from_explicit_params()Tomas Mraz
The function returns 1 when the encoding of a decoded EC key used explicit encoding of the curve parameters. Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12909)
2020-05-15If SOURCE_DATE_EPOCH is defined, use it for copyright yearNicolas Vigier
Using the date from SOURCE_DATE_EPOCH instead of the current date makes it possible to reproduce a build that was built on a different year: https://reproducible-builds.org/specs/source-date-epoch/ This is fixing an issue we had while building Tor Browser: https://trac.torproject.org/projects/tor/ticket/33535 CLA: trivial Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Ben Kaduk <kaduk@mit.edu> (Merged from https://github.com/openssl/openssl/pull/11296) (cherry picked from commit 11d7d903447ab866d037fb8bba4ceb49c7d89191)
2020-04-21Add setter equivalents to X509_REQ_get0_signatureDirk-Willem van Gulik
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10563) (cherry picked from commit c72e59349f50ee00a1bf8605ada17dfccb8b3b1a)
2020-03-17Update copyright yearMatt Caswell
Reviewed-by: Paul Yang <kaishen.yy@antfin.com> (Merged from https://github.com/openssl/openssl/pull/11344)
2020-03-06DOC: Add documentation related to X509_LOOKUPsRichard Levitte
Most of all, the base X509_LOOKUP functionality is now documented. Furthermore, the names X509_LOOKUP_METHOD and X509_STORE are added for reference. Some functions were moved from X509_LOOKUP_meth_new.pod Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11120)
2020-01-27OpenSSL::Test: bring back the relative pathsRichard Levitte
Because there was a bug in File::Spec::Unix' abs2rel when it was given relative paths as both PATH and BASE arguments, the directories we deal with were made to be all absolute. Unfortunately, this meant getting paths in our verbose test output which are difficult to use anywhere else (such as a separate test build made for comparison), due to the constant need to edit all the paths all the time. We're therefore getting back the relative paths, by doing an extra abs2rel() in __srctop_file, __srctop_dir, __bldtop_file and __bldtop_dir, with a 'Cwd::getcwd' call as BASE argument. Fixes #10628 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10913) (cherry picked from commit 612539e8a678c6099131dfd0e5e4b85fa774eb1a)
2019-12-16Backport the RSA_get0_pss_params() function from masterMatt Caswell
This is a missing accessor in order to obtain PSS parameters from an RSA key, which should also be available in 1.1.1. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10568)
2019-12-15util/mkerr.pl: revert accidental change of header guardsDr. Matthias St. Pierre
This change was backported accidentally from master in commit fbbfd128c9aa. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/10623)
2019-12-11Fix some typosVeres Lajos
Reported-by: misspell-fixer <https://github.com/vlajos/misspell-fixer> CLA: trivial Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10544) (cherry picked from commit 79c44b4e3044aee9dc9618850d4f1ce067757b4b)
2019-11-17Add missing EVP_PKEY_METHOD accessors for digestsign and digestverifyAnthony Hu
Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10388) (cherry picked from commit 2555285fa5e4248ad4a5a0bc14ae4606443856c2)
2019-10-15Document and add macros for additional DSA optionsDavid Benjamin
EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS and EVP_PKEY_CTRL_DSA_PARAMGEN_MD are only exposed from EVP_PKEY_CTX_ctrl, which means callers must write more error-prone code (see also issue #1319). Add the missing wrapper macros and document them. Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit a97faad76a1be22eadd6c1a39972ad5e095d9e80) Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10094)
2019-10-15Ignore duplicated undocumented thingsRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Yang <yang.yang@baishancloud.com> (cherry picked from commit ee4afacd96f5bfbe7662c8f0ec4464c6eee4c450) Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/10094)
2019-09-27Add util/fix-includes scriptDr. Matthias St. Pierre
This script contains all adjustments to header files which were made during the reorganization of the header files. It is meant as an aid for other contributors which encounter preprocessor #include errors after rebasing over this pull request. Simply running util/fix-includes from the root of the source directory should hopefully fix the problem. Note: such #include errors are expected only for pull requests which add a lot of new code, in particular new compilation modules. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9681)
2019-09-27Fix header file include guard namesDr. Matthias St. Pierre
Make the include guards consistent by renaming them systematically according to the naming conventions below The public header files (in the 'include/openssl' directory) are not changed in 1.1.1, because it is a stable release. For the private header files files, the guard names try to match the path specified in the include directives, with all letters converted to upper case and '/' and '.' replaced by '_'. An extra 'OSSL_' is added as prefix. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9681)
2019-09-10Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9847)
2019-09-06Teach TLSProxy how to parse CertificateRequest messagesMatt Caswell
We also use this in test_tls13messages to check that the extensions we expect to see in a CertificateRequest are there. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/9780) (cherry picked from commit dc5bcb88d819de55eb37460c122e02fec91c6d86)
2019-08-19Fix some pod-page ordering nitsRich Salz
Backport of https://github.com/openssl/openssl/pull/9602 Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9632)
2019-08-01Add missing accessors for X509 AuthorityKeyIdentifierDr. Matthias St. Pierre
Complements commit b383aa208146, which added X509_get0_authority_key_id(). const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x); [NEW] const ASN1_INTEGER *X509_get0_authority_serial(X509 *x); [NEW] Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9494)
2019-07-31Fix TyposAntoine Cœur
CLA: trivial Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9295)
2019-07-24Remove external HEADER_SYMHACKS_H include guardDr. Matthias St. Pierre
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/9365)
2019-07-02Adding Test.pm with workaround for Perl abs2rel bugMartin Peylo
If SRCTOP != BLDTOP, and SRCTOP is given in relative form, e.g. "./config ../openssl", then a bug in Perl's abs2rel may trigger that directory- rewriting in __cwd results in wrong entries in %directories under certain circumstances, e.g. when a test executes run(app(["openssl"]) after indir. There should not be any need to go to a higher directory from BLDDIR or SRCDIR, so it should be OK to use them in their absolute form, also resolving all possible symlinks, right from the start. Following the File::Spec::Functions bug description (reported to perl.org): When abs2rel gets a path argument with ..s that are crossing over the ..s trailing the base argument, the result is wrong. Example PATH: /home/goal/test/.. BASE: /home/goal/test/../../base Good result: ../goal Bad result: ../.. Bug verified with File::Spec versions - 3.6301 - 3.74 (latest) Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7031) (cherry picked from commit 7a2027240e1d01f7f5b209998d1de36af221b34b)
2019-07-02util/mkerr.pl: Add an inclusion of symhacks.h in all error filesRich Salz
This does no harm, and ensures that the inclusion isn't mistakenly removed in the generated *err.h where it's actually needed. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit b53c4fe3f92e3d2c5bd9fca1a171cd24f66ef14d) Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9281)
2019-07-01Fix TyposAntoine Cœur
CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9275)
2019-05-23Add the NIST CAVS test vectors for CCMMatt Caswell
This imports all of the NIST CAVS test vectors for CCM (SP800-38C) and coverts them for use within evp_test. This commit also adds a script to convert the .rsp CAVS files into the evp_test format. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8981) (cherry picked from commit ecb0f148a94c9b0076240ca1d7904ab50a7dc9a4)
2019-04-15Add a check for history section location to find-doc-nitsJoshua Lock
Check that the HISTORY section is located after the SEE ALSO section, this is a much more frequent order in OpenSSL manual pages (and UNIX manual pages in general). Also check that SEE ALSO comes after EXAMPLES, so that the tool can ensure the correct manual section sequence. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 573ac8f2228241771f727ecd8ff10f54073536d3) Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8736)
2019-04-15Make check_example_location() in find-doc-nits genericJoshua Lock
Change to check_section_location(), a generic function to ensure that section SECTION appears before section BEFORE in the man pages. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 95f92d57755a9bfc83135a585da69d497f7293d9) Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8736)
2019-04-15Add section order check in util/find-doc-nitsPaul Yang
This patch checks if the EXAMPLES section in a pod file is placed before the RETURN VALUES section. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit cc838ee2d66f7295bf7a7e6695aab1080d6791e9) Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/8736)
2019-03-21Providing missing accessor to EVP_PKEY.engineDmitry Belyavskiy
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8526)
2019-02-26Update copyright yearMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8347)
2019-02-05Remove unnecessary trailing whitespaceSam Roberts
Trim trailing whitespace. It doesn't match OpenSSL coding standards, AFAICT, and it can cause problems with git tooling. Trailing whitespace remains in test data and external source. Backport-of: https://github.com/openssl/openssl/pull/8092 Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8134)
2019-02-04Fix Invalid Argument return code from IP_Factory in connect_to_server().Matthias Kraft
Fixes #7732 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8158) (cherry picked from commit 66a60003719240399f6596e58c239df0465a4f70)
2019-01-07More configurable crypto and ssl library initializationViktor Dukhovni
1. In addition to overriding the default application name, one can now also override the configuration file name and flags passed to CONF_modules_load_file(). 2. By default we still keep going when configuration file processing fails. But, applications that want to be strict about initialization errors can now make explicit flag choices via non-null OPENSSL_INIT_SETTINGS that omit the CONF_MFLAGS_IGNORE_RETURN_CODES flag (which had so far been both undocumented and unused). 3. In OPENSSL_init_ssl() do not request OPENSSL_INIT_LOAD_CONFIG if the options already include OPENSSL_INIT_NO_LOAD_CONFIG. 4. Don't set up atexit() handlers when called with opts equal to OPENSSL_INIT_BASE_ONLY (this flag should only be used alone). Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7969)
2019-01-07Add a test for correct handling of the cryptopro bug extensionMatt Caswell
This was complicated by the fact that we were using this extension for our duplicate extension handling tests. In order to add tests for cryptopro bug the duplicate extension handling tests needed to change first. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/7984) (cherry picked from commit 9effc496ad8a9b0ec737c69cc0fddf610a045ea4)
2018-11-24Have util/mktar.sh display the absolute path to the tarballRichard Levitte
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7696) (cherry picked from commit 3be389435fc7b94623d972b622dbd9f0cd5c34f7)
2018-11-24Document the removed 'dist' targetRichard Levitte
Also adds missing copyright boilerplate to util/mktar.sh Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7696) (cherry picked from commit b42922ea2f605fd6c42faad1743fb27be5f7f1f3)
2018-11-23Change tarball making procedureRichard Levitte
Since recently, OpenSSL tarballs are produced with 'make tar' rather than 'make dist', as the latter has turned out to be more troublesome than useful. The next step to look at is why we would need to configure at all to produce a Makefile just to produce a tarball. After all, the tarball should now only contain source files that are present even without configuring. Furthermore, the current method for producing tarballs is a bit complex, and can be greatly simplified with the right tools. Since we have everything versioned with git, we might as well use the tool that comes with it. Added: util/mktar.sh, a simple script to produce OpenSSL tarballs. It takes the options --name to modify the prefix of the distribution, and --tarfile tp modify the tarball file name specifically. This also adds a few entries in .gitattributes to specify files that should never end up in a distribution tarball. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7692) (cherry picked from commit 8c209eeef426ded66ce99048f535f35d08b88462)
2018-11-14Fix typo in util/perl/OpenSSL/Test.pmRichard Levitte
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/7633) (cherry picked from commit 2dc37bc2b4c678462a24d2904604e58c0c5ac1cb)
2018-11-14Fix rpath-related Linux "test_shlibload" failure.Richard Levitte
When libssl and libcrypto are compiled on Linux with "-rpath", but not "--enable-new-dtags", the RPATH takes precedence over LD_LIBRARY_PATH, and we end up running with the wrong libraries. This is resolved by using full (or at least relative, rather than just the filename to be found on LD_LIBRARY_PATH) paths to the shared objects. Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7626) (cherry picked from commit 18289399743da6c3db462f37fc8797738e8acf7c)
2018-11-12Added missing signature algorithm reflection functionsViktor Dukhovni
SSL_get_signature_nid() -- local signature algorithm SSL_get_signature_type_nid() -- local signature algorithm key type SSL_get_peer_tmp_key() -- Peer key-exchange public key SSL_get_tmp_key -- local key exchange public key Aliased pre-existing SSL_get_server_tmp_key(), which was formerly just for clients, to SSL_get_peer_tmp_key(). Changed internal calls to use the new name. Reviewed-by: Matt Caswell <matt@openssl.org>
2018-11-07util/add-depends.pl: go through shared_sources tooRichard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7545) (cherry picked from commit 3866b2247fb7904a4e660593a16365147f479415)
2018-10-17EVP module documentation passAntoine Salon
Replace ECDH_KDF_X9_62() with internal ecdh_KDF_X9_63() Signed-off-by: Antoine Salon <asalon@vmware.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/7345) (cherry picked from commit ffd89124bdfc9e69349492c3f15383bb35520a11)
2018-10-10crypto/rand: fix some style nit'sFdaSilvaYY
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7378) (cherry picked from commit c2e33a05b1eb9dda988aebdeaa529973d7c22142)
2018-10-04Small cleanup (util/mkdef.pl, crypto/bio/bss_log.c, include/openssl/ocsp.h)Richard Levitte
BIO_s_log() is declared for everyone, so should return NULL when not actually implemented. Also, it had explicit platform limitations in util/mkdef.pl that didn't correspond to what was actually in code. While at it, a few other hard coded things that have lost their relevance were removed. include/openssl/ocsp.h had a few duplicate declarations. Reviewed-by: Paul Yang <yang.yang@baishancloud.com> (Merged from https://github.com/openssl/openssl/pull/7331) (cherry picked from commit 7e09c5eaa57295f87453286ffe25277c2f2bc73f)
2018-09-24Document OPENSSL_VERSION_TEXT macroDaniel Bevenius
This commit documents the OPENSSL_VERSION_TEXT which is currently missing in the man page. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7301) (cherry picked from commit 7c69495712e3dc9aa8db38271f0c3faeb2037165)
2018-09-20util/mkdef.pl, util/add-depends.pl: don't lowercase file namesRichard Levitte
It turns out to be detrimental on some file systems that may or may not be case sensitive (such as NTFS, which has a case sensitive mode). Fixes #7172 Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7172) (cherry picked from commit d3c72e392ab72d418ea5147857701a8730def3fd)