summaryrefslogtreecommitdiffstats
path: root/external/xmlsec/BCryptKeyDerivation.patch.1
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
commita2baea7faff31d26459dab3668a39eae85e4991b (patch)
treeeaa2048ce9c715481f932dcfe20368e252b77d2f /external/xmlsec/BCryptKeyDerivation.patch.1
parentAdding upstream version 4:24.2.0. (diff)
downloadlibreoffice-a2baea7faff31d26459dab3668a39eae85e4991b.tar.xz
libreoffice-a2baea7faff31d26459dab3668a39eae85e4991b.zip
Adding upstream version 4:24.2.1.upstream/4%24.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'external/xmlsec/BCryptKeyDerivation.patch.1')
-rw-r--r--external/xmlsec/BCryptKeyDerivation.patch.151
1 files changed, 51 insertions, 0 deletions
diff --git a/external/xmlsec/BCryptKeyDerivation.patch.1 b/external/xmlsec/BCryptKeyDerivation.patch.1
new file mode 100644
index 0000000000..3747915f87
--- /dev/null
+++ b/external/xmlsec/BCryptKeyDerivation.patch.1
@@ -0,0 +1,51 @@
+tdf#159519 Windows 7 does not have BCryptKeyDerivation
+
+It just occurred to me that these functions would of course not be called
+by LibreOffice so this is untested.
+
+--- xmlsec/src/mscng/pbkdf2.c.orig 2024-02-21 19:02:56.539534152 +0100
++++ xmlsec/src/mscng/pbkdf2.c 2024-02-21 19:01:03.282270354 +0100
+@@ -318,7 +318,20 @@
+ }
+
+ /* generate the output key */
++#if 1 // _WIN32_WINNT <= 0x0601
++ typedef NTSTATUS (WINAPI * BCryptKeyDerivationPtr)(
++ BCRYPT_KEY_HANDLE, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG);
++ HMODULE hBCrypt = GetModuleHandle("bcrypt.dll");
++ BCryptKeyDerivationPtr pBCryptKeyDerivation =
++ (BCryptKeyDerivationPtr) GetProcAddress(hBCrypt, "BCryptKeyDerivation");
++ if(NULL == pBCryptKeyDerivation) {
++ xmlSecMSCngNtError("BCryptKeyDerivation", NULL, status);
++ goto done;
++ }
++ status = (*pBCryptKeyDerivation)(
++#else
+ status = BCryptKeyDerivation(
++#endif
+ hKey,
+ &paramsPBKDF2,
+ pbOut,
+--- xmlsec/src/mscng/concatkdf.c.orig 2024-02-21 19:02:37.962490885 +0100
++++ xmlsec/src/mscng/concatkdf.c 2024-02-21 19:01:37.961351134 +0100
+@@ -318,7 +318,20 @@
+ }
+
+ /* generate the output key */
++#if 1 // _WIN32_WINNT <= 0x0601
++ typedef NTSTATUS (WINAPI * BCryptKeyDerivationPtr)(
++ BCRYPT_KEY_HANDLE, BCryptBufferDesc *, PUCHAR, ULONG, ULONG *, ULONG);
++ HMODULE hBCrypt = GetModuleHandle("bcrypt.dll");
++ BCryptKeyDerivationPtr pBCryptKeyDerivation =
++ (BCryptKeyDerivationPtr) GetProcAddress(hBCrypt, "BCryptKeyDerivation");
++ if(NULL == pBCryptKeyDerivation) {
++ xmlSecMSCngNtError("BCryptKeyDerivation", NULL, status);
++ goto done;
++ }
++ status = (*pBCryptKeyDerivation)(
++#else
+ status = BCryptKeyDerivation(
++#endif
+ hKey,
+ &paramsCONCATKDF2,
+ pbOut,