summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-12-19 19:13:00 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-12-20 22:23:20 +0100
commit4995e0669da0e499743b21c60da1ca8b14a1c78c (patch)
tree351323cc563eb6a1917d4457c24dcc02a9841cb1 /external
parent39f21446c0f0e9872f8871ab88233f5cbaa5eacc (diff)
tdf#105844 offapi,package,sfx2: use Argon2 for wholesome ODF encryption
https://www.rfc-editor.org/rfc/rfc9106.html * add css::xml::crypto::KDFID constant group * add "KeyDerivationFunction" to setEncryptionAlgorithms sequence * Argon2 is used by default for wholesome ODF encryption, but $LO_ARGON2_DISABLE can be set to use PBKDF2 * extend various structs in package * use 3 new ODF attributes "loext:argon2-iterations" "loext:argon2-memory" "loext:argon2-lanes" to store the arguments * use this URL for now: "urn:org:documentfoundation:names:experimental:office:manifest:argon2id" * use default arguments according to second recommendation from "7.4. Recommendations" of RFC9106; 64 MiB RAM should hopefully not be too much even for 32 bit builds Change-Id: I683118cc5e0706bd6544db6fb909096768ac9920 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161009 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 2f512aaa6c39390a5a0eb1d1e37f070127d068a4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161024
Diffstat (limited to 'external')
-rw-r--r--external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch32
-rw-r--r--external/argon2/UnpackedTarball_argon2.mk6
2 files changed, 38 insertions, 0 deletions
diff --git a/external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch b/external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch
new file mode 100644
index 000000000000..538b41e3ec9f
--- /dev/null
+++ b/external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch
@@ -0,0 +1,32 @@
+From 48829f87ebafbb9938d23a8f0bff4d11d770690e Mon Sep 17 00:00:00 2001
+From: Patrick Steinhardt <ps@pks.im>
+Date: Thu, 20 Feb 2020 17:37:32 +0100
+Subject: [PATCH] Fix possible compiler error due to undefined _MSC_VER
+
+In order to determine how to set up the ARGON2_PUBLIC and ARGON2_LOCAL
+macros, we check for various different environments via preprocessor
+defines. For Microsoft Visual Studio, we check that the macro _MSC_VER
+evaluates to non-zero via `#elif _MSC_VER`. This may raise a compile
+error when compiling with "-Werror=undef" if the variable isn't defined.
+
+Fix the issue by using `#elif defined(_MSC_VER)` instead.
+---
+ include/argon2.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/argon2.h b/include/argon2.h
+index fc8682c..1b471f6 100644
+--- a/include/argon2.h
++++ b/include/argon2.h
+@@ -30,7 +30,7 @@ extern "C" {
+ #ifdef A2_VISCTL
+ #define ARGON2_PUBLIC __attribute__((visibility("default")))
+ #define ARGON2_LOCAL __attribute__ ((visibility ("hidden")))
+-#elif _MSC_VER
++#elif defined(_MSC_VER)
+ #define ARGON2_PUBLIC __declspec(dllexport)
+ #define ARGON2_LOCAL
+ #else
+--
+2.43.0
+
diff --git a/external/argon2/UnpackedTarball_argon2.mk b/external/argon2/UnpackedTarball_argon2.mk
index 1d314cfb08d9..0b35c2f58caf 100644
--- a/external/argon2/UnpackedTarball_argon2.mk
+++ b/external/argon2/UnpackedTarball_argon2.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,argon2))
$(eval $(call gb_UnpackedTarball_set_tarball,argon2,$(ARGON2_TARBALL)))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,argon2,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,argon2,\
+ external/argon2/0001-Fix-possible-compiler-error-due-to-undefined-_MSC_VE.patch \
+))
+
# vim: set noet sw=4 ts=4: