summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Generate dependency informationTanzinul Islam2021-04-195-11/+23
| | | | | | | | | | | | | | | | The Clang-based `bcc32c.exe` doesn't implement the `-Hp` option, so we have to use [`cpp32.exe`][1] instead. Therefore, change the dependency- emitting command to use `$(CPP)` instead of `$(CC)`, which which also uncovered the [existing bug of `2>&1` before `> $dep`][2]. Also C++Builder's `make.exe` doesn't implement `2>&1` in its command runner, so wrap the whole line in a `cmd /C`. [1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/CPP32.EXE,_the_C_Compiler_Preprocessor [2]: https://ss64.com/nt/syntax-redirection.html Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Avoid more MSVC-specific C runtime library functionsTanzinul Islam2021-04-196-6/+8
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Build resource filesTanzinul Islam2021-04-196-15/+32
| | | | | | | | | | | | | We need to compile with [brcc32.exe][1] and link with [ilink32.exe][2]. The latter expects the `.res` files to be given in the final comma- separated section in the command line (after the `.def` file). [1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/BRCC32.EXE,_the_Resource_Compiler [2]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_ILINK32_and_ILINK64_on_the_Command_Line#Command-Line_Elements Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Support DLL builds + Fix C RTL variantsTanzinul Islam2021-04-195-23/+42
| | | | | | | | | | | | | | | We need to generate a import library without the version in the filename. MSVC's `link.exe` accommodates this with the [`/implib:` option][1], while C++Builder needs a separate run of [`implib.exe`][2]. Also fix the variants of the [C runtime library and startup objects][3]. [1]: https://docs.microsoft.com/en-us/cpp/build/reference/implib-name-import-library?view=msvc-160 [2]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/IMPLIB.EXE,_the_Import_Library_Tool_for_Win32 [3]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Static_Runtime_Libraries Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Ensure cw32mt.lib and import32.lib are linked to in no-sock modeTanzinul Islam2021-04-191-3/+2
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Document C++Builder usage in NOTES-WINDOWS.mdTanzinul Islam2021-04-191-0/+28
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Replace "ld_wildcard_args" with "bin_lflags"Tanzinul Islam2021-04-193-8/+8
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Add explanation + bugtracker link for quoted dependency workaroundsTanzinul Islam2021-04-191-0/+4
| | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Use cmd.exe to export env vars before commandsTanzinul Islam2021-04-191-11/+4
| | | | | | | | | | | | Microsoft NMake runs the entire command block in a single `cmd.exe` session, so environment variables exported with `set` are seen by the following commands. C++Builder's `make.exe` doesn't use `cmd.exe` but executes each command line separately. While it emulates only certain shell features itself, `set` isn't one of them. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Resurrect and modernize C++Builder configTanzinul Islam2021-04-194-2/+41
| | | | | | | | | | | | | | Similar configuration to what was deleted in 8e56a422, updated for the unified build scheme. Use the [Clang-based `bcc32c.exe`][1] to avoid a [bug][2] with the old one, and increase the `tlib.exe` page size to 256. Also avoid MSVC-specific C runtime library functions. [1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Win32_Clang-enhanced_Compilers [2]: https://quality.embarcadero.com/browse/RSP-31630 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Avoid redirection to quoted filenameTanzinul Islam2021-04-191-1/+1
| | | | | | | | | C++Builder's `make.exe` cannot handle a command output redirection to a quoted filename, saying: "The system cannot find the file specified." Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Generalize link rule in windows-makefile.tmplTanzinul Islam2021-04-192-14/+13
| | | | | | | | | | | | | | | | | | C++Builder's [`ilink32.exe`][1] expects its different types of input / output files to be in a particular sequence and comma-separated -- even in the response file as experimentation revealed, contrary to what is documented. The lines of the response file need to end with `+`. Also [`setargv.obj`][2] is MSVC-specific. The C++Builder equivalent is [`wildargs.obj`][3]. [1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_ILINK32_and_ILINK64_on_the_Command_Line [2]: https://docs.microsoft.com/en-us/cpp/c-language/expanding-wildcard-arguments?view=msvc-160 [3]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Wildcard_Arguments Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Ensure at least one command if no dependenciesTanzinul Islam2021-04-191-1/+5
| | | | | | | | | | C++Builder's `make.exe` complains if a target has no dependencies (e.g. after variable expansion) and no lines of commands. Ensure there is a blank command line if the dependency list is entirely made of variables. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Avoid quoting dependency filepaths in build treeTanzinul Islam2021-04-191-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++Builder's `make.exe` has a bug in finding the rule of a quoted dependency that doesn't exist in the filesystem. So for example: A: "src\B" "out\C" touch $@ out\C: mkdir out touch $@ leads to: Fatal: '"out\C"' does not exist - don't know how to make it This happens even with the `-N` option, and is different behavior from Microsoft NMake which documents the feature of [quoted filepaths][1]. Commit cb663908 quoted all dependency filepaths, in case they are used in a out-of-source build. The quoting is not done for target names, however, which implies that the build directory is still expected to not have spaces. It follows that we only need to quote non-generated source files in dependency lists, since generated source files will be created in the build directory. Change the logic accordingly as a workaround, so that it works at least for in-source builds with C++Builder's `make.exe`. [1]: https://docs.microsoft.com/cpp/build/reference/long-filenames-in-a-makefile?view=msvc-160 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Generalize delimiter in archiver response fileTanzinul Islam2021-04-192-1/+2
| | | | | | | | | | | | | While [`lib.exe` of MSVC][1] expects newline-delimited response file lines, [`tlib.exe` of C++Builder][2] expects lines to end with `&` in order to read the next line. [1]: https://docs.microsoft.com/cpp/build/reference/running-lib?view=msvc-160#lib-command-files [2]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/TLIB.EXE,_the_Library_Manager#Response_Files Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Avoid space between "-I" and include directoryTanzinul Islam2021-04-191-4/+4
| | | | | | | | | The space is problematic with C++Builder (`bcc32.exe`). MSVC (`cl.exe`) doesn't care. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Move VS Tools configuration to VC-common targetTanzinul Islam2021-04-192-7/+6
| | | | | | | | | | | | The Windows toolchain is composed of utilites from both the Windows SDK and the Visual Studio Build Tools. Move the configuration of the latter utilities into the `VC-common` template inside `10-main.conf`, while leaving the former utilities in `BASE_Windows`. This allows for other Windows compilers to be configured inheriting from `BASE_Windows`. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Avoid "&&" in windows-makefile.tmplTanzinul Islam2021-04-191-6/+9
| | | | | | | | | | | | | The `make.exe` utility shipped with Embarcadero C++Builder has a special meaning for the [`&&` operator in commands][1]. This meaning is retained even in Microsoft NMake compatibility mode (`make -N`). Split all commands using this shell (`cmd.exe`) operator into two commands. [1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/MAKE_Rules_(Explicit_and_Implicit)_and_Commands#MAKE_Command_Operators Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/13540)
* Add test for the IV handling of DES based ciphersTomas Mraz2021-04-191-2/+110
| | | | | Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14882)
* Do IV reset also for DES and 3DES implementationsTomas Mraz2021-04-192-0/+9
| | | | | | | Fixes #14704 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14882)
* Change the default MANSUFFIXMatt Caswell2021-04-192-2/+6
| | | | | | | | | | We now use the MANSUFFIX "ossl" by default. Fixes #14318 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14847)
* Add DHX FIPS 186-4 domain parameter validation exampleTomas Mraz2021-04-192-11/+53
| | | | | | | Fixes #14369 Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14896)
* CORE: pre-populate the namemap with legacy OIDs tooRichard Levitte2021-04-181-3/+56
| | | | | | | | | | This also pre-populates the namemap with names derived from the internal EVP_PKEY_ASN1_METHODs. This requires attention, as they contain aliases that we may want (RSA == rsaEncryption), as well as aliases that we absolutely do not want (SM2 == EC). Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* TEST: Use OSSL_MAX_NAME_SIZE instead of arbitrary number of mdnameRichard Levitte2021-04-181-1/+1
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* CORE: Register all legacy "names" when generating the initial namemapRichard Levitte2021-04-181-18/+18
| | | | | | | | | | | | | | | When generating the initial namemap from EVP cipher and digest names, we din't do it quite as thoroughly as necessary, which meant that so called "long names" weren't necessarily registered, and if anyone ever tried to check the algorithm of an EVP_CIPHER or EVP_MD using a so called "long name" would fail. This doesn't deal with the fact that "long names" have a distinct role as human readable descriptors, useful for printouts. Further changes are necessary to deal with this. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* Modify OBJ_nid2sn(OBJ_obj2nid(...)) occurences to use OBJ_obj2txt()Richard Levitte2021-04-1813-60/+76
| | | | | | | | | | | The intention is to allow for OIDs for which libcrypto has no information, but are still fetchable for OSSL_ALGORITHM implementations that specify an OID amongst their names. Fixes #14278 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* TEST: Modify how the retrieved digest name for SM2 digestsign is checkedRichard Levitte2021-04-181-17/+36
| | | | | | | | | | Because of aliases, retrieved names won't always match one specific string. A safer way to check is to fetch the digest from the retrieved name and check it's the expected one with the help of EVP_MD_is_a(). Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* TEST: Modify testutil's run_tests to display NOSUBTEST cases individuallyRichard Levitte2021-04-181-23/+36
| | | | | | | | | When test cases were added with ADD_ALL_TESTS_NOSUBTEST(), all those iteration verdicts were summarized as if it was one single case. This modification gets each iteration verdict displayed separately instead. Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* TEST: Modify test/evp_fetch_prov_test.c to also fetch by OIDRichard Levitte2021-04-181-54/+178
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* PROV: Add OIDs we know to all provider applicable algorithmsRichard Levitte2021-04-186-411/+716
| | | | | | | | | | | The OIDs were extracted with the help of libcrypto's ASN1 OID database. While doing this, we move all the names strings to macro definitions, to avoid duplication and conflicting names declarations. Those macros are all in providers/implementations/include/prov/names.h Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14498)
* Add "origin" field to EVP_CIPHER, EVP_MDRich Salz2021-04-1857-112/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a "where did this EVP_{CIPHER,MD} come from" flag: global, via fetch, or via EVP_{CIPHER,MD}_meth_new. Update EVP_{CIPHER,MD}_free to handle all three origins. The flag is deliberately right before some function pointers, so that compile-time failures (int/pointer) will occur, as opposed to taking a bit in the existing "flags" field. The "global variable" flag is non-zero, so the default case of using OPENSSL_zalloc (for provider ciphers), will do the right thing. Ref-counting is a no-op for Make up_ref no-op for global MD and CIPHER objects Deprecate EVP_MD_CTX_md(). Added EVP_MD_CTX_get0_md() (same semantics as the deprecated function) and EVP_MD_CTX_get1_md(). Likewise, deprecate EVP_CIPHER_CTX_cipher() in favor of EVP_CIPHER_CTX_get0_cipher(), and add EVP_CIPHER_CTX_get1_CIPHER(). Refactor EVP_MD_free() and EVP_MD_meth_free() to call new common evp_md_free_int() function. Refactor EVP_CIPHER_free() and EVP_CIPHER_meth_free() to call new common evp_cipher_free_int() function. Also change some flags tests to explicit test == or != zero. E.g., if (flags & x) --> if ((flags & x) != 0) if (!(flags & x)) --> if ((flags & x) == 0) Only done for those lines where "get0_cipher" calls were made. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14193)
* Standard style for all EVP_xxx_free routinesRich Salz2021-04-1810-88/+93
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14193)
* Fix typo in aesccm.cNan Xiao2021-04-181-1/+1
| | | | | | | | CLA: trivial Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14894)
* apps/cmp.c: Fix TLS hostname checking in case -server provides more than ↵Dr. David von Oheimb2021-04-171-10/+10
| | | | | | | hostname Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14889)
* OSSL_CMP_CTX_new(): Fix distinction of out-of-memory and other errorsDr. David von Oheimb2021-04-171-3/+4
| | | | | Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14889)
* Fix naming for EVP_RAND_CTX_gettable functions.Pauli2021-04-1711-36/+36
| | | | | | | | | | | | | | | Change: EVP_RAND_gettable_ctx_params -> EVP_RAND_CTX_gettable_params EVP_RAND_settable_ctx_params -> EVP_RAND_CTX_settable_params Which brings them in line with the other similar functions for other algorithm types. Fixes #14880 Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14893)
* Sanity check provider up-callsMatt Caswell2021-04-163-60/+57
| | | | | | | | | | | | | When we store references to up-calls for future reference we run a sanity check to make sure we either previously haven't set these values or they are the same as last time. We don't support the scenario where an application is linked against multiple versions of libcrypto but using a shared fips.so file. This would result in different up-calls for different calls to OSSL_provider_init(), which we currently can't handle. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14814)
* Store some FIPS global variables in the FIPS_GLOBAL structureMatt Caswell2021-04-1612-115/+171
| | | | | | | | | | | | | We had some FIPS global variables that were based on values from the config file. In theory if two instances of the fips module are loaded they could be based on different config files which would cause this to fail. Instead we store them in the FIPS_GLOBAL structure. Fixes #14364 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14814)
* lifecycle: update master lifecycle transition spreadsheet fixing the ettable ↵Pauli2021-04-161-0/+0
| | | | | | | issue Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14867)
* lifecycle: correct [sg]ettable to [sg]etPauli2021-04-161-4/+4
| | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14867)
* demos: Add clean target for bio/MakefileNan Xiao2021-04-161-0/+3
| | | | | | | | CLA: trivial Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14661)
* Add more negative checks for integers passed to OPENSSL_malloc().Shane Lontis2021-04-1618-8/+49
| | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14830)
* SipHash: Fix CTRL API for the digest size.Pauli2021-04-162-1/+15
| | | | | | | | | | Adds a mapping from "digestsize" to "size" for setting a param. Fixes #14370 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14850)
* Github workflows: re-implement a no-shared buildRichard Levitte2021-04-151-0/+14
| | | | | | | We do this both on Ubuntu and MacOS X Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14753)
* Add EVP_PKEY_todata() and EVP_PKEY_export() functions.Shane Lontis2021-04-1511-5/+478
| | | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14800)
* Add OID for mdc2WithRSASignature and remove related TODO 3.0Tomas Mraz2021-04-153-28/+48
| | | | | | | | Fixes #14366 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14874)
* Rename EVP_PKEY_get0_first_alg_name to EVP_PKEY_get0_type_nameTomas Mraz2021-04-159-27/+30
| | | | | | | | | | | | | | | We use type elsewhere and documenting the 'first' in the name of the call is a little bit superfluous making the name too mouthful. Also rename EVP_PKEY_typenames_do_all to EVP_PKEY_type_names_do_all to keep the words separated by underscore. Fixes #14701 Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14868)
* changes: note that some ctrl calls have a different error return.Pauli2021-04-151-0/+6
| | | | | | | | | | Providers do not distinguish between invalid and other errors via the return code. Fixes #14442 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14864)
* Do not allow creating empty RSA keys by duplicationTomas Mraz2021-04-154-8/+7
| | | | | | | Also avoid crashing in rsa_get_params on empty keys. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14793)
* Remove keymgmt_copy function from the provider APITomas Mraz2021-04-158-63/+20
| | | | | | | It is superceded by the keymgmt_dup. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14793)