Otherwise things break in case of a Python venv, where the python.exe
is in a different location, or in a test suite, where an uninstalled
exe is run in the build directory.
Fixes#16129
This should not change anything in openssl.
The leak fixes synced in were already fixed in openssl,
and single_path_relocation() is the same as the custom code
in openssl.
This changes the full directories reference to prefixed path.
For example, the output of 'openssl.exe version -a' becomes
Before:
OPENSSLDIR: D:/a/msys64/ucrt64/etc/ssl
ENGINESDIR: D:/a/msys64/ucrt64/lib/engines-3
MODULESDIR: D:/a/msys64/ucrt64/lib/ossl-modules
After:
OPENSSLDIR: /ucrt64/etc/ssl
ENGINESDIR: /ucrt64/lib/engines-3
MODULESDIR: /ucrt64/lib/ossl-modules
openssl 3 added a new path from which DLLs can be loaded at runtime,
currently the "legacy.dll".
This code path was missing the relocation support and looking for
the CI build path instead, resulting in code that tried to load
the legacy providers to fail (examples: python-cryptography, transmission)
It can also be reproduced via:
openssl list -provider legacy -providers
Add relocation support to MODULESDIR to fix this.
Some UB results in broken code starting with Clang 14. This only
affects the no-asm case, which is only used for our arm64 build.
This resulted in runtime errors such as:
19560:error:1012606B:elliptic curve routines:EC_POINT_set_affine_coordinates:point is not on curve:../openssl-1.1.1o/crypto/ec/ec_lib.c:813:
19560:error:100AF010:elliptic curve routines:ec_group_new_from_data:EC lib:../openssl-1.1.1o/crypto/ec/ec_curve.c:3083:
19560:error:100AE081:elliptic curve routines:EC_GROUP_new_by_curve_name:unknown group:../openssl-1.1.1o/crypto/ec/ec_curve.c:3159:
19560:error:100D7010:elliptic curve routines:eckey_pub_decode:EC lib:../openssl-1.1.1o/crypto/ec/ec_ameth.c:168:
19560:error:0B09407D:x509 certificate routines:x509_pubkey_decode:public key decode error:../openssl-1.1.1o/crypto/x509/x_pubkey.c:125:
These are packages that were part of "bootstrapping" clang prefixes.
For #9295. I don't know if their dependencies auso need rebuilding, but
this is a start.
Just like `mingw-w64-curl`, `mingw-w64-openssl` is now also built with a
literal copy of `mingw-w64-pathtools`' source code.
This adds the `get_dll_path()` function (which is unused by the
`openssl` code), and it also forward-ports the patch where we now
preserve UNC paths when normalizing/simplifying paths.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Prefer memmove over memcpy for overlapping memory regions, otherwise it
triggers the address sanitizer with:
ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [x,y) and [a,b) overlap