summaryrefslogtreecommitdiffstats
path: root/util
AgeCommit message (Collapse)Author
2020-08-01DESERIALIZER: Refactor the constructor setting APIRichard Levitte
It's not the best idea to set a whole bunch of parameters in one call, that leads to functions that are hard to update. Better to re-model this into several function made to set one parameter each. This also renames "finalizer" to "constructor", which was suggested earlier but got lost at the time. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12544)
2020-08-01DESERIALIZER: Add deserializers for the rest of our asymmetric key typesRichard Levitte
To be able to implement this, there was a need for the standard EVP_PKEY_set1_, EVP_PKEY_get0_ and EVP_PKEY_get1_ functions for ED25519, ED448, X25519 and X448, as well as the corresponding EVP_PKEY_assign_ macros. There was also a need to extend the list of hard coded names that EVP_PKEY_is_a() recognise. Along with this, OSSL_FUNC_keymgmt_load() are implemented for all those key types. The deserializers for these key types are all implemented generically, in providers/implementations/serializers/deserializer_der2key.c. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12544)
2020-08-01DESERIALIZER: Rethink password handlingRichard Levitte
The OSSL_DESERIALIZER API makes the incorrect assumption that the caller must cipher and other pass phrase related parameters to the individual desserializer implementations, when the reality is that they only need a passphrase callback, and will be able to figure out the rest themselves from the input they get. We simplify it further by never passing any explicit passphrase to the provider implementation, and simply have them call the passphrase callback unconditionally when they need, leaving it to libcrypto code to juggle explicit passphrases, cached passphrases and actual passphrase callback calls. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12544)
2020-07-30Add OSSL_CMP_MSG_write(), use it in apps/cmp.cDr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12421)
2020-07-30Export ossl_cmp_msg_load() as OSSL_CMP_MSG_read(), use it in apps/cmp.cDr. David von Oheimb
Fixes #12403 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12421)
2020-07-30Export crm_new() of cmp_msg.c under the name OSSL_CMP_CTX_setup_CRM()Dr. David von Oheimb
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12431)
2020-07-30Streamline the CMP request session API, adding the generalized ↵Dr. David von Oheimb
OSSL_CMP_exec_certreq() Fixes #12395 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12431)
2020-07-24SERIALIZER: Add functions to deserialize into an EVP_PKEYRichard Levitte
EVP_PKEY is the fundamental type for provider side code, so we implement specific support for it, in form of a special context constructor. This constructor looks up and collects all available KEYMGMT implementations, and then uses those names to collect deserializer implementations, as described in the previous commit. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12410)
2020-07-24DESERIALIZER: Add foundation for deserializersRichard Levitte
This adds a method OSSL_DESERIALIZER, a deserializer context and basic support to use a set of serializers to get a desired type of data, as well as deserializer chains. The idea is that the caller can call OSSL_DESERIALIZER_CTX_add_serializer() to set up the set of desired results, and to add possible chains, call OSSL_DESERIALIZER_CTX_add_extra(). All these deserializers are pushed on an internal stack. The actual deserialization is then performed using functions like OSSL_DESERIALIZER_from_bio(). When performing deserialization, the inernal stack is walked backwards, keeping track of the deserialized data and its type along the way, until the data kan be processed into the desired type of data. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12410)
2020-07-24Add X509 related libctx changes.Shane Lontis
- In order to not add many X509_XXXX_with_libctx() functions the libctx and propq may be stored in the X509 object via a call to X509_new_with_libctx(). - Loading via PEM_read_bio_X509() or d2i_X509() should pass in a created cert using X509_new_with_libctx(). - Renamed some XXXX_ex() to XXX_with_libctx() for X509 API's. - Removed the extra parameters in check_purpose.. - X509_digest() has been modified so that it expects a const EVP_MD object() and then internally it does the fetch when it needs to (via ASN1_item_digest_with_libctx()). - Added API's that set the libctx when they load such as X509_STORE_new_with_libctx() so that the cert chains can be verified. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12153)
2020-07-22EVP: deprecate the EVP_X_meth_ functions.Pauli
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11082)
2020-07-22Align documentation with recommendations of Linux Documentation ProjectGustaf Neumann
This change applies the recommendation of the Linux Documentation Project to the documentation files of OpenSSL. Additionally, util/find-doc-nits was updated accordingly. The change follows a suggestion of mspncp on https://github.com/openssl/openssl/pull/12370 and incoporates the requested changes on the pull request 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/12460)
2020-07-21util/find-doc-nits: Relax check of function declarations in name_synopsis()Richard Levitte
The relaxation allows spaces between function name and argument list, to allow line breaks like this when there are very long names: int (fantastically_long_name_breaks_80char_limit) (fantastically_long_name_breaks_80char_limit *something); This revealed some other intricaties, such as documented internal structures with function pointers inside, so a check of open structures was also added, and they are now simply skipped over. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12494)
2020-07-20check-format.pl: Report empty lines only if -s (--sloppy-spc) is not usedDr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
2020-07-20check-format.pl: Add check for essentially empty line at beginning of fileDr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
2020-07-20check-format.pl: Add check for multiples essentially empty lines in a rowDr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
2020-07-20check-format.pl: Allow comment start '/*' after opening '(','[','{'Dr. David von Oheimb
On this occasion fix uses of the word 'nor'. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12270)
2020-07-19util/find-doc-nits: relax some SYNOPSIS checksRichard Levitte
- The check that disallowed space before the argument list in a function typedef is tentatively removed, allowing this kind of construction: typedef int (fantastically_long_name_breaks_80char_limit) (fantastically_long_name_breaks_80char_limit *something); - Accept the following style of function signature: typedef TYPE (NAME)(args...) - Accept space between '#' and 'defined' / 'undef' - Accept other spaces than SPC in argument list comma check, allowing declaration with line breaks. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12452)
2020-07-19util/find-doc-nits: read full declarations as one line in name_synopsis()Richard Levitte
name_synopsis was reading physical SYNOPSIS lines. This changes it to consider a declaration at a time, so we treat a C declaration that's been broken up in several lines as one. This makes it mandatory to end all C declarations in the SYNOPSIS with a semicolon. Those can be detected in two ways: 1. Parsing an individual .pod file outputs this error: doc/man3/SOMETHING.pod:1: Can't parse rest of synopsis: int SOMETHING_status(SOMETHING *s) int SOMETHING_start(SOMETHING *s) (declarations not ending with a semicolon (;)?) 2. Errors like this: doc/man3/SOMETHING.pod:1: SOMETHING_status missing from SYNOPSIS doc/man3/SOMETHING.pod:1: SOMETHING_start missing from SYNOPSIS Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12452)
2020-07-19Remove util/openssl-update-copyrightRichard Levitte
It was useful at the time for a one-time run. However, since it does its work based on file modification time stamps, and those are notoriously untrustable in a git checkout, it ends up being harmful. There is a replacement in OpenSSL's tools repository, which relies on git history. Fixes #12462 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12466)
2020-07-16util/mktar.pl: Change 'VERSION' to 'VERSION.dat'Richard Levitte
This was forgotten when that file changed name, and that unfortunately disrupts releases. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12464)
2020-07-16Revert "kdf: make function naming consistent."Matt Caswell
The commit claimed to make things more consistent. In fact it makes it less so. Revert back to the previous namig convention. This reverts commit 765d04c9460a304c8119f57941341a149498b9db. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12186)
2020-07-16Revert "The EVP_MAC functions have been renamed for consistency. The ↵Matt Caswell
EVP_MAC_CTX_*" The commit claimed to make things more consistent. In fact it makes it less so. Revert back to the previous namig convention. This reverts commit d9c2fd51e2e278bc3f7793a104ff7b4879f6d63a. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12186)
2020-07-16libcrypto.num: engine deprecation updatesPauli
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12226)
2020-07-16Add SSL_get[01]_peer_certificate()Todd Short
Deprecate SSL_get_peer_certificte() and replace with SSL_get1_peer_certificate(). Add SSL_get0_peer_certificate. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/8730)
2020-07-14DRBG: rename the DRBG taxonomy.Pauli
The existing wording didn't capture the reality of the default setup, this new nomenclature attempts to improve the situation. Reviewed-by: Mark J. Cox <mark@awe.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12366)
2020-07-05util/markdownlint.rb: Add two rule exceptions: MD023 and MD026Dr. David von Oheimb
exclude_rule 'MD023' # Headers must start at the beginning of the line exclude_rule 'MD026' # Trailing punctuation in header Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12109)
2020-07-05Fix typos and repeated wordsGustaf Neumann
CLA: trivial 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/12320)
2020-07-04Configuration and build: Fix solaris tagsRichard Levitte
The shared_target attrribute for Solaris built with gcc wasn't right and shared libraries couldn't be properly built. Fixes #12356 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12360)
2020-07-04util/perl/OpenSSL/config.pm: Fix /armv[7-9].*-.*-linux2/Richard Levitte
This entry added the macro B_ENDIAN when it shouldn't have. Fixes #12332 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12335)
2020-07-04util/perl/OpenSSL/config.pm: move misplaced Windows and VMS entriesRichard Levitte
OpenSSL::config::guess_system() is supposed to return system triplets. However, for Windows and VMS, it returned the final OpenSSL config target instead. We move the entries for them to the table that OpenSSL::config::map_guess() uses, so it can properly convert the input triplet to an OpenSSL config target. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12339)
2020-07-01Add X509_self_signed(), extending and improving documenation and testsDr. David von Oheimb
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10587)
2020-06-28util/perl/OpenSSL/config.pm: refactor guess_system()Richard Levitte
There's no reason to have two different tables, when we can simply detect if the tuple elements are code or scalar. Furthermore, order is important in some cases, and that order is harder not to say impossible when maintaining two tables. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28util/perl/OpenSSL/config.pm: remove expand() and use evalRichard Levitte
The strings we expand contain other variable references than just ${MACHINE}. Instead of having to remember what to expand, we simply evaluate the string as a, well, string. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28util/perl/OpenSSL/config.pm: refactor map_guess()Richard Levitte
map_guess() is now table driven, just like get_system(). Additionally, it now takes a config hash table and returns one of its own. This way, 'Configure' can pass whatever it has already found to OpenSSL::config::get_platform(), and easily merge the returned hash table into its %config. This also gets rid of variables that we no longer need. That includes $PERL and all the $__CNF_ environment variables. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28util/perl/OpenSSL/config.pm, Configure: move check of target with compilerRichard Levitte
Previously, ./config would check if "$target-$CC", then "$target" exists and choose the one that does. This is now moved to Configure. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28util/perl/OpenSSL/config.pm: Rework determining compiler informationRichard Levitte
determine_compiler_settings() has been refactored to: - find a compiler if none has been given by the user - allow platform specific overrides, but only when the user didn't already specify a desired compiler - figure out the compiler vendor and version, making sure that the version number is deterministic - gather platform specific compiler information Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28Remove OpenSSL::config::main(), it's not necessaryRichard Levitte
This also remove all option parsing. We leave that to Configure. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28util/perl/OpenSSL/config.pm: Prefer POSIX::uname() over piping the commandRichard Levitte
POSIX::uname() has the advantage to work on non-POSIX systems as well, such as the Windows command prompt and VMS. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28util/perl/OpenSSL/config.pm: Don't detect removed directories inRichard Levitte
This is much better handled in Configure. [There's another PR moving this to Configure, so this commit should eventually disappear because rebase] Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28Initial rewrite of config as a Perl moduleRich Salz
- Use $^X; to find perl. - Big re-ordering: Put all variables at the top, move most inline code into functions. The heart of the script now basically just calls functions to do its work. - Unify warning text, add -w option - Don't use needless (subshells) - Ensure Windows gets a VC-xxx option - Make config a perl module - Top-level "config" command-line is a dummy that just calls the module. Added module stuff so that it can be called from Configure. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11230)
2020-06-28CORE: Add OPENSSL_CTX_set0_default(), to set a default library contextRichard Levitte
Applications may want to set their own default library context, possibly per-thread. OPENSSL_CTX_set0_default() does that. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12228)
2020-06-24evp_rand: documentationPauli
EVP_RAND, the RNGs and provider-rand. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
2020-06-24params: add OSSL_PARAM helpers for time_t.Pauli
POSIX mandates that time_t is a signed integer but it doesn't specify the lenght. Having wrappers lets uses ignore this. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
2020-06-24rand: core APIs for provider friendly random.Pauli
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
2020-06-22Missing documentation missing, let's note that downRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12125)
2020-06-22util/find-doc-nits: Modernise printem()Richard Levitte
It wasn't up to date with the new variables used to track information on what's documented, what's in the .num files and what's in the "missing" files. Fixes #12117 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12125)
2020-06-22util/find-doc-nits: Do not read "missing" files when -u is givenRichard Levitte
Fixes #12117 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12125)
2020-06-22Fix CMP -days option range checking and test failing with enable-ubsanDr. David von Oheimb
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12175)
2020-06-19Add more complete support for libctx/propq in the EC codeMatt Caswell
Renames some "new_ex" functions to "new_with_libctx" and ensures that we pass around the libctx AND the propq everywhere. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12159)