summaryrefslogtreecommitdiff
path: root/engines
Commit message (Collapse)AuthorAgeFilesLines
...
* Drop OPENSSL_NO_RSA everywhereRichard Levitte2020-12-201-2/+0
| | | | | | | | The configuration option 'no-rsa' was dropped with OpenSSL 1.1.0, so this is simply a cleanup of the remains. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13700)
* MSBLOB & PVK: Make it possible to write EVP_PKEYs with provided internal keyRichard Levitte2020-12-171-0/+1
| | | | | | | | | | | | | | | So far, the MSBLOB and PVK writers could only handle EVP_PKEYs with legacy internal keys. Specially to be able to compile the loader_attic engine, we use the C macro OPENSSL_NO_PROVIDER_CODE to avoid building the provider specific things when we don't need them. The alternative is to suck half of crypto/evp/ into loader_attic, and that's just not feasible. Fixes #13503 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13661)
* Remove unnecessary guards around MSBLOB and PVK readers and writersRichard Levitte2020-12-131-8/+0
| | | | | | | | The OPENSSL_NO_RC4 guard remain around protected PVK tests in test/endecoder_test.c. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13648)
* Add test to demonstrate the app's new engine key loadingRichard Levitte2020-12-021-0/+44
| | | | | | | | | | This adds a bit of functionality in ossltest, so it can now be used to load PEM files. It takes the file name as key ID, but just to make sure faults aren't ignored, it requires all file names to be prefixed with 'ot:'. Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/13570)
* ERR: Rebuild all generated error headers and source filesRichard Levitte2020-11-2413-22/+26
| | | | | | | This is the result of 'make errors ERROR_REBUILD=-rebuild' Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13390)
* e_loader_attic.c: Improve result handling of file_load_try_decode()Dr. David von Oheimb2020-11-191-1/+4
| | | | | Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/4930)
* Allow for PKCS#12 input without MAC in p12_kiss.c and e_loader_attic.cDr. David von Oheimb2020-11-191-1/+2
| | | | | Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/4930)
* e_loader_attic.c: Remove redundant 'pass phrase' sub-string from ↵Dr. David von Oheimb2020-11-191-1/+1
| | | | | | | try_decode_PKCS12() Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/4930)
* Avoid duplicate ends_with_dirsep functionsTomas Mraz2020-11-111-15/+1
| | | | | | | | Refactor them into inline ossl_ends_with_dirsep function in internal/cryptlib.h. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13306)
* Don't clear the whole error stack when loading enginesMatt Caswell2020-11-065-5/+56
| | | | | | | | | | | | | Loading the various built-in engines was unconditionally clearing the whole error stack. During config file processing processing a .include directive which fails results in errors being added to the stack - but we carry on anyway. These errors were then later being removed by the engine loading code, meaning that problems with the .include directive never get shown. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13311)
* afalg: add a NULL pointer checkPauli2020-10-291-0/+3
| | | | | | | Fixes #13260 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13261)
* Unexport internal MSBLOB and PVK functionsRichard Levitte2020-10-212-2/+2
| | | | | | | | | | | | | | | | The following internal functions are affected: ossl_do_blob_header ossl_do_PVK_header ossl_b2i ossl_b2i_bio This is reflected by moving include/internal/pem.h to include/crypto/pem.h engines/e_loader_attic gets the source code added to it to have continued access to those functions. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13195)
* Rename OPENSSL_CTX prefix to OSSL_LIB_CTXDr. Matthias St. Pierre2020-10-151-11/+11
| | | | | | | | | | | | 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)
* Fix some things the rename script didn't quite get rightMatt Caswell2020-10-011-1/+1
| | | | | | | | | 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)
* Run the withlibctx.pl scriptMatt Caswell2020-10-011-6/+5
| | | | | | | | Automatically rename all instances of _with_libctx() to _ex() as per our coding style. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12970)
* Fix typo in bind_loader_attic commentDaniel Bevenius2020-09-171-1/+1
| | | | | | Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12890)
* Fix safestack issues in x509.hMatt Caswell2020-09-132-4/+0
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12781)
* STORE: Move the built-in 'file:' loader to become an engine moduleRichard Levitte2020-09-036-1/+1941
| | | | | | | | | | | | | | | | | | | | From this point on, this engine must be specifically specified. To replace the internal EMBEDDED hack with something unique for the new module, functions to create application specific OSSL_STORE_INFO types were added. Furthermore, the following function had to be exported: ossl_do_blob_header() ossl_do_PVK_header() asn1_d2i_read_bio() Finally, evp_pkcs82pkey_int() has become public under a new name, EVP_PKCS82PKEY_with_libctx() Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12587)
* engines: fixed to work with EVP_*_meth calls deprecatedPauli2020-07-223-3/+3
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11082)
* Update copyright yearRichard Levitte2020-07-161-1/+1
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/12463)
* deprecate enginesPauli2020-07-166-2/+17
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12226)
* Update copyright yearMatt Caswell2020-05-151-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11839)
* In OpenSSL builds, declare STACK for datatypes ...Rich Salz2020-04-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | ... and only *define* them in the source files that need them. Use DEFINE_OR_DECLARE which is set appropriately for internal builds and not non-deprecated builds. Deprecate stack-of-block Better documentation Move some ASN1 struct typedefs to types.h Update ParseC to handle this. Most of all, ParseC needed to be more consistent. The handlers are "recursive", in so far that they are called again and again until they terminate, which depends entirely on what the "massager" returns. There's a comment at the beginning of ParseC that explains how that works. {Richard Levtte} Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10669)
* Update copyright yearMatt Caswell2020-04-234-4/+4
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
* Deprecate the low level RSA functions.Pauli2020-02-202-84/+191
| | | | | | | | Use of the low level RSA functions has been informally discouraged for a long time. We now formally deprecate them. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11063)
* Fix misspelling errors and typos reported by codespellDr. Matthias St. Pierre2020-02-061-1/+1
| | | | | | | Fixes #10998 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/11000)
* Deprecate the low level SHA functions.Pauli2020-01-192-41/+54
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10791)
* Deprecate the low level AES functionsMatt Caswell2020-01-061-0/+6
| | | | | | | | | | | | Use of the low level AES functions has been informally discouraged for a long time. We now formally deprecate them. Applications should instead use the EVP APIs, e.g. EVP_EncryptInit_ex, EVP_EncryptUpdate, EVP_EncryptFinal_ex, and the equivalently named decrypt functions. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10580)
* Update source files for deprecation at 3.0Richard Levitte2019-11-074-4/+4
| | | | | | | | | | | | | | | Previous macros suggested that from 3.0, we're only allowed to deprecate things at a major version. However, there's no policy stating this, but there is for removal, saying that to remove something, it must have been deprecated for 5 years, and that removal can only happen at a major version. Meanwhile, the semantic versioning rule is that deprecation should trigger a MINOR version update, which is reflected in the macro names as of this change. Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10364)
* Explicitly test against NULL; do not use !p or similarRich Salz2019-10-091-3/+4
| | | | | | | | Also added blanks lines after declarations in a couple of places. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9916)
* Fix header file include guard namesDr. Matthias St. Pierre2019-09-285-10/+10
| | | | | | | | | | | | | Make the include guards consistent by renaming them systematically according to the naming conventions below For the public header files (in the 'include/openssl' directory), the guard names try to match the path specified in the include directives, with all letters converted to upper case and '/' and '.' replaced by '_'. For the private header files files, an extra 'OSSL_' is added as prefix. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* Add support for io_pgetevents_time64 syscallAlistair Francis2019-09-181-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | 32-bit architectures that are y2038 safe don't include syscalls that use 32-bit time_t. Instead these architectures have suffixed syscalls that always use a 64-bit time_t. In the case of the io_getevents syscall the syscall has been replaced with the io_pgetevents_time64 syscall instead. This patch changes the io_getevents() function to use the correct syscall based on the avaliable syscalls and the time_t size. We will only use the new 64-bit time_t syscall if the architecture is using a 64-bit time_t. This is to avoid having to deal with 32/64-bit conversions and relying on a 64-bit timespec struct on 32-bit time_t platforms. As of Linux 5.3 there are no 32-bit time_t architectures without __NR_io_getevents. In the future if a 32-bit time_t architecture wants to use the 64-bit syscalls we can handle the conversion. This fixes build failures on 32-bit RISC-V. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9819)
* Unify all assembler file generatorsRichard Levitte2019-09-162-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They now generally conform to the following argument sequence: script.pl "$(PERLASM_SCHEME)" [ C preprocessor arguments ... ] \ $(PROCESSOR) <output file> However, in the spirit of being able to use these scripts manually, they also allow for no argument, or for only the flavour, or for only the output file. This is done by only using the last argument as output file if it's a file (it has an extension), and only using the first argument as flavour if it isn't a file (it doesn't have an extension). While we're at it, we make all $xlate calls the same, i.e. the $output argument is always quoted, and we always die on error when trying to start $xlate. There's a perl lesson in this, regarding operator priority... This will always succeed, even when it fails: open FOO, "something" || die "ERR: $!"; The reason is that '||' has higher priority than list operators (a function is essentially a list operator and gobbles up everything following it that isn't lower priority), and since a non-empty string is always true, so that ends up being exactly the same as: open FOO, "something"; This, however, will fail if "something" can't be opened: open FOO, "something" or die "ERR: $!"; The reason is that 'or' has lower priority that list operators, i.e. it's performed after the 'open' call. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9884)
* build.info: For all assembler generators, remove all argumentsRichard Levitte2019-09-161-3/+2
| | | | | | | | Since the arguments are now generated in the build file templates, they should be removed from the build.info files. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9884)
* Replace FUNCerr with ERR_raise_dataRich Salz2019-08-021-8/+8
| | | | | | Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9496)
* Avoid using ERR_put_error() directly in OpenSSL codeRichard Levitte2019-07-314-4/+8
| | | | | | | | | | | | | | | | If compiled with 'no-deprecated', ERR_put_error() is undefined. We had one spot where we were using it directly, because the file and line information was passed from elsewhere. Fortunately, it's possible to use ERR_raise() for that situation, and call ERR_set_debug() immediately after and thereby override the information that ERR_raise() stored in the error record. util/mkerr.pl needed a small adjustment to not generate code that won't compile in a 'no-deprecated' configuration. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9452)
* Use OPENSSL_strlcpy instead of strncpy in e_afalg.cBernd Edlinger2019-07-301-10/+4
| | | | | | | | | | | | | | | | | This avoids a spurious gcc warning: ./config enable-asan --strict-warnings => In function 'afalg_create_sk', inlined from 'afalg_cipher_init' at engines/e_afalg.c:545:11: engines/e_afalg.c:376:5: error: '__builtin_strncpy' output may be truncated copying 63 bytes from a string of length 63 [-Werror=stringop-truncation] 376 | strncpy((char *) sa.salg_name, ciphername, ALG_MAX_SALG_NAME); | ^~~~~~~ [extended tests] Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9478)
* Deprecate SYSerr, add new FUNCerr macroRich Salz2019-07-221-8/+8
| | | | | | Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9072)
* Add ERR_put_func_error, and use it.Rich Salz2019-07-221-8/+8
| | | | | | | | | | Change SYSerr to have the function name; remove SYS_F_xxx defines Add a test and documentation. Use get_last_socket_err, which removes some ifdef's in OpenSSL code. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9072)
* Regenerate mkerr filesRich Salz2019-07-1612-120/+79
| | | | | | Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9058)
* Fix TyposAntoine Cœur2019-07-021-1/+1
| | | | | | | | CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/9288)
* Move padlock_asm_src file information to build.info filesRichard Levitte2019-06-171-3/+17
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9166)
* Fix CHECK_BSD_STYLE_MACROS for OpenBSD and cryptodev-linuxRetropotenza2019-05-311-1/+1
| | | | | | | | | | CLA: trivial Fixes #8911 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/8866)
* Build cleanup: don't use SHARED_SOURCE with modulesRichard Levitte2019-04-021-6/+6
| | | | | | | | | | | | | SHARED_SOURCE is reserved for products that are expected to come in dual shared / non-shared form, i.e. the routine libraries like libcrypto and libssl, to distinguish source that should only appear in their shared form. Modules are always shared, so there's no need for them to have this type of distinction. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8623)
* Ensure that the struct msghdr is properly zeroed.Pauli2019-03-291-1/+2
| | | | | | | This is probably harmless but best to properly initialise things. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8611)
* 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)
* padlock: generate assembler source for static libraries tooRichard Levitte2019-03-051-3/+3
| | | | | | | | | | | The GENERATE lines for generating the padlock assembler source were wrongly placed in such a way that they only applied to the shared library build. [extended tests] Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/8412)
* Deprecate the "hw" configuration options, make "padlockeng" disablableRichard Levitte2019-03-052-67/+66
| | | | | | | | | | | | | | | | | | | The "hw" and "hw-.*" style options are historical artifacts, sprung from the time when ENGINE was first designed, with hardware crypto accelerators and HSMs in mind. Today, these options have largely lost their value, replaced by options such as "no-{foo}eng" and "no-engine". This completes the transition by making "hw" and "hw-.*" deprecated, but automatically translated into more modern variants of the same. In the process, we get rid of the last regular expression in Configure's @disablables, a feature that was ill supported anyway. Also, padlock now gets treated just as every other engine. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8380)
* Make the padlock engine build correctlyRichard Levitte2019-02-271-3/+3
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8220)
* engines/dasync: add explaining comments about AES-128-CBC-HMAC-SHA1Dr. Matthias St. Pierre2019-02-221-0/+16
| | | | | | | | | | | | | | | | | Fixes #7950 It was reported that there might be a null pointer dereference in the implementation of the dasync_aes_128_cbc_hmac_sha1() cipher, because EVP_aes_128_cbc_hmac_sha1() can return a null pointer if AES-NI is not available. It took some analysis to find out that this is not an issue in practice, and these comments explain the reason to comfort further NPD hunters. Detected by GitHub user @wurongxin1987 using the Sourcebrella Pinpoint static analyzer. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8305)