summaryrefslogtreecommitdiffstats
path: root/util
AgeCommit message (Collapse)Author
2020-10-15Update copyright yearMatt Caswell
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13144)
2020-10-15Rename OPENSSL_CTX prefix to OSSL_LIB_CTXDr. Matthias St. Pierre
Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix, e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER. The OPENSSL_CTX type stands out a little by using a different prefix. For consistency reasons, this type is renamed to OSSL_LIB_CTX. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12621)
2020-10-15Make evp_pkey_ctx_get0_libctx/propq public APIMatt Caswell
These were previously added as an internal API. But since the CMS code needs them, other code might do too. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13088)
2020-10-12Document how deprecation should be doneRichard Levitte
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13074)
2020-10-12OpenSSL::ParseC: handle OSSL_CORE_MAKE_FUNCRichard Levitte
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13074)
2020-10-12Add PEM declaration macros that take attributesRichard Levitte
This makes it possible to easily deprecated selections of PEM functions. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13074)
2020-10-12Add ASN1 declaration macros that take attributesRichard Levitte
This makes it possible to easily deprecated selections of ASN1 functions. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13074)
2020-10-12Make OpenSSL::ParseC and OpenSSL::Ordinals treat deprecation consistentlyRichard Levitte
The triggering macro that decides if a symbol is to be considered deprecated is OPENSSL_NO_DEPRECATEDIN_x_y[_z]. OpenSSL::ParseC renames any OPENSSL_NO_DEPRECATED_x_y[_z] by inserting "IN". Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13074)
2020-10-10ENCODER / DECODER: Add functions to encode/decode to/from a bufferRichard Levitte
This adds OSSL_ENCODER_to_data() and OSSL_DECODER_from_data(). These functions allow fairly simple rewrites of type-specific i2d and d2i calls. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13094)
2020-10-09make ordinalsRichard Levitte
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13092)
2020-10-09Modify util/mknum.pl to drop new symbols that don't exist any moreRichard Levitte
This makes use of the writer filters in OpenSSL::Ordinals. Fixes #10395 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13092)
2020-10-09OpenSSL::Ordinals: Add options for the writing functionsRichard Levitte
OpenSSL::Ordinals::rewrite() and OpenSSL::Ordinals::write() now take options, that are simply passed to OpenSSL::Ordinals::items(). The 'sort' option is forbidden, though, since write() already uses it, but that means it's possible to filter the output. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13092)
2020-10-08Expose PKCS7_get_octet_string and PKCS7_type_is_otherJordan Montgomery
Add PKCS7_get_octet_string() and PKCS7_type_is_other() to the public interface. Fixes #11139 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13059)
2020-10-06Test.pm: Add result_dir and export both result_dir and result_fileDr. David von Oheimb
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12934)
2020-10-03Configuration: add initial NonStop values in OpenSSL::configRichard Levitte
This makes Configure work it's automatic config detection, at least for the simple straightforward cases. Fixes #12972 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12973)
2020-10-01Fix some things the rename script didn't quite get rightMatt Caswell
The previous commit ran an automated rename throughout the codebase. There are a small number of things it didn't quite get right so we fix those in this commit. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12970)
2020-10-01Perl util to do with_libctx renamingMatt Caswell
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12970)
2020-09-30check-format.pl: Allow nested indentation of labels (not only at line pos 1)Dr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13019)
2020-09-30check-format.pl: Extend exceptions for no SPC after trailing ';' in 'for (...;)'Dr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13019)
2020-09-30check-format.pl: Document how to run positive and negative self-testsDr. David von Oheimb
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13019)
2020-09-26en EVP_PKEY_CTX_set_rsa_keygen_pubexp() BIGNUM managementjwalch
Fixes #12635 As discussed in the issue, supporting the set0-like semantics long-term is not necessarily desirable, although necessary for short-term compatibility concerns. So I've deprecated the original method and added an equivalent that is explicitly labelled as set1. I tried to audit existing usages of the (now-deprecated) API and update them to use set1 if that appeared to align with their expectations. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12917)
2020-09-26Remove openssl provider appShane Lontis
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12943)
2020-09-25Build: Make NonStop shared libraries only export selected symbolsRichard Levitte
We can now re-enable test/recipes/01-test_symbol_presence.t for NonStop. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12962)
2020-09-25EVP: Enforce that EVP_PKEY_set_alias_type() only works with legacy keysRichard Levitte
This also deprecates the function, as it is not necessary any more, and should fall out of use. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12920)
2020-09-25Hide ECX_KEY againRichard Levitte
ECX_KEY was not meant for public consumption, it was only to be accessed indirectly via EVP routines. However, we still need internal access for our decoders. This partially reverts 7c664b1f1b5f60bf896f5fdea5c08c401c541dfe Fixes #12880 Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12956)
2020-09-24Test.pm: Some clarifications added to the documentationDr. David von Oheimb
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12893)
2020-09-24Simplify the tarball generating scriptsHu Keping
As per discussed in issue #12364 [1], since the format of git archive is inferred from the output file, it's safe to remove the pipe for gzip. [1] https://github.com/openssl/openssl/issues/12364 Fixes #12364 Signed-off-by: Hu Keping <hukeping@huawei.com> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12841)
2020-09-23kdf/mac: add name query calls for KDFs and MACsPauli
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12931)
2020-09-21Fix merge error with libcrypto.numShane Lontis
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12929)
2020-09-20util/find-doc-nits: Add a regexp for C symbols and use itRichard Levitte
Our matching of C symbols here was inconsistent and could therefore give false negatives when the SYNOPSIS was parsed. Now we have $C_symbol, which is a simple regexp that matches the common C symbol. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12873)
2020-09-20DECODER: Some cleanups, and aligning with OSSL_ENCODERRichard Levitte
Mostly source nits, but also removing a couple of OSSL_DECODER_PARAM macros that are never used or even make sense. Also, some function names weren't quite consistent. They were made a bit more consistent in the OSSL_ENCODER API, now we bring that back to OSSL_DECODER. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12873)
2020-09-20TEST: Adapt applicable tests to the changed OSSL_ENCODER_CTX_new_by_EVP_PKEY()Richard Levitte
This adds the convenience function EVP_PKEY_typenames_do_all(), which does the same as EVP_KEYMGMT_names_do_all(), but without having to expose all the internal ways to find out if the internal EVP_PKEY key is legacy or provider-native. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12873)
2020-09-20ENCODER: Refactor the OSSL_ENCODER API to be more like OSSL_DECODERRichard Levitte
OSSL_ENCODER was developed before OSSL_DECODER, so the idea of chaining and the resulting API came later. This series of changes brings the same sort of API and functionality back to OSSL_ENCODER, making the two APIs more consistent with each other. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12873)
2020-09-20Deprecate ASN1_STRING_length_set in OpenSSL 3.0.David Benjamin
Fixes #12885 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> GH: #12922
2020-09-19util/mkerr.h: Restore header file renameRichard Levitte
With '-internal', we commonly write the reason code macros to header file renamed 'name.h' to 'nameerr.h'. That renaming was removed by mistake, this restores it. Fixes #12891 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12910)
2020-09-19Add KEM (Key encapsulation mechanism) support to providersShane Lontis
SP800-56Br2 requires support for the RSA primitives for RSASVE generate and recover. As these are simple KEM operations another operation type has been added that can support future extensions. Added public functions EVP_PKEY_encapsulate_init(), EVP_PKEY_encapsulate(), EVP_PKEY_decapsulate_init() and EVP_PKEY_decapsulate() Added EVP_KEM_* functions. Added OSSL_FUNC_kem_* dispatch functions Added EVP_PKEY_CTX_set_kem_op() so that different types of KEM can be added in the future. This value must currently be set to "RSASVE" after EVP_PKEY_encapsulate_init() & EVP_PKEY_decapsulate_init() as there is no default value. This allows the existing RSA key types, keymanagers, and encoders to be used with the encapsulation operations. The design of the public API's resulted from contributions from @romen & @levitte. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12750)
2020-09-18Fix some doc-nits and make update errorsMatt Caswell
The new lhash changes have confused some of the perl scripts so we add some fixes. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12860)
2020-09-18Provide basis for fixing lhash codeMatt Caswell
Following on from the earlier safestack work we provide the basis for fixing the lhash code such that unused static inline functions do not cause linker errors for applications including those headers. This brings the lhash code into line with the safestack code. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12860)
2020-09-17EC_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/12683)
2020-09-17Correctly display the signing/hmac algorithm in the dgst appMatt Caswell
In OpenSSL 1.1.1 doing an HMAC operation with (say) SHA1 would produce output like this: HMAC-SHA1(README.md)= 553154e4c0109ddc320bb495735906ad7135c2f1 Prior to this change master would instead display this like so: SHA1(README.md)= 553154e4c0109ddc320bb495735906ad7135c2f1 The problem is that dgst was using EVP_PKEY_asn1_get0_info() to get the algorithm name from the EVP_PKEY. This doesn't work with provider based keys. Instead we introduce a new EVP_PKEY_get0_first_alg_name() function, and an equivalent EVP_KEYMGMT_get0_first_name() function. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12850)
2020-09-16undeprecate EVP_PKEY_cmp and EVP_PKEY_cmp_parametersTim Hudson
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12013)
2020-09-16OpenSSL::ParseC: recognise inline function bodiesRichard Levitte
Function bodies in headers weren't a thing when OpenSSL::ParseC was created, at least not as clearly as they are nowadays. This module must evolve to recognise them (and promptly ignore them). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12882)
2020-09-14prov/drbg: cleanup some RAND_DRBG leftoversDr. Matthias St. Pierre
These are leftovers from the RAND_DRBG removal (#12509). Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12866)
2020-09-13Don't complain about stack related macrosMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
2020-09-13Make 'make errors' work againRichard Levitte
util/mkerr.pl detects if a header is now a '.in' template, and adjusts the header file it reads accordingly. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12781)
2020-09-13util/mknum.pl: Fix file openingRichard Levitte
'or' has lower priority than '||' in perl, which affects evaluation order. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12781)
2020-09-13Streamline the safestack generated codeMatt Caswell
The safestack code generation was generating a little too much. Some of it could be done with a normal macro. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
2020-09-13Remove some safestack things that are no longer neededMatt Caswell
... and add SKM_DEFINE_STACK_OF_INTERNAL Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
2020-09-13Fix stacks of OPENSSL_STRING, OPENSSL_CSTRING and OPENSSL_BLOCKMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
2020-09-13Fix safestack issues in ssl.hMatt Caswell
We fix 3 problems with safestack: - Including an openssl header file without linking against libcrypto can cause compilation failures (even if the app does not otherwise need to link against libcrypto). See issue #8102 - Recent changes means that applications in no-deprecated builds will need to include additional macro calls in the source code for all stacks that they need to use - which is an API break. This changes avoids that necessity. - It is not possible to write code using stacks that works in both a no-deprecated and a normal build of OpenSSL. See issue #12707. Fixes #12707 Contains a partial fix for #8102. A similar PR will be needed for hash to fully fix. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)