Makefile.fetch | 1 RepositoryExternal.mk | 29 ++++++++++++++++ config_host.mk.in | 3 + configure.ac | 8 ++++ download.lst | 5 ++ external/Module_external.mk | 1 external/argon2/ExternalPackage_argon2.mk | 18 ++++++++++ external/argon2/ExternalProject_argon2.mk | 54 ++++++++++++++++++++++++++++++ external/argon2/Makefile | 7 +++ external/argon2/Module_argon2.mk | 18 ++++++++++ external/argon2/README | 5 ++ external/argon2/UnpackedTarball_argon2.mk | 14 +++++++ readlicense_oo/license/license.xml | 6 +++ 13 files changed, 169 insertions(+)
New commits: commit 77c921302b7ef869aed28fcd0187c80095d6a766 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Mon Dec 18 20:50:05 2023 +0100 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Dec 19 17:25:05 2023 +0100 argon2: add new external library Change-Id: I81860a94b33eba95918c30b0e92b583cc2d02ff3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160969 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/Makefile.fetch b/Makefile.fetch index 3956cd4d2af0..b96cb573c2bf 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -101,6 +101,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S @date >> $(fetch_LOGFILE) $(foreach item, \ $(call fetch_Optional,ABW,ABW_TARBALL) \ + $(call fetch_Optional,ARGON2,ARGON2_TARBALL) \ $(call fetch_Optional,BOOST,BOOST_TARBALL) \ $(call fetch_Optional,BOX2D,BOX2D_TARBALL) \ $(call fetch_Optional,BREAKPAD,BREAKPAD_TARBALL) \ diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index da11a7d153f2..60499758de40 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -1553,6 +1553,35 @@ endif # SYSTEM_OPENSSL endif # ENABLE_OPENSSL +ifneq ($(SYSTEM_ARGON2),) + +define gb_LinkTarget__use_argon2 +$(call gb_LinkTarget_set_include,$(1),\ + $(ARGON2_CFLAGS) \ + $$(INCLUDE) \ +) +$(call gb_LinkTarget_add_libs,$(1),$(ARGON2_LIBS)) + +endef + +else # !SYSTEM_ARGON2 + +$(eval $(call gb_Helper_register_packages_for_install,ooo, \ + argon2 \ +)) + +define gb_LinkTarget__use_argon2 +$(call gb_LinkTarget_set_include,$(1),\ + $(ARGON2_CFLAGS) \ + $$(INCLUDE) \ +) +$(call gb_LinkTarget_add_libs,$(1),$(ARGON2_LIBS)) +$(call gb_LinkTarget_use_package,$(1),argon2) +endef + +endif # SYSTEM_ARGON2 + + ifneq ($(SYSTEM_CDR),) define gb_LinkTarget__use_cdr diff --git a/config_host.mk.in b/config_host.mk.in index 97a2b0bbbb40..e30574ff4945 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -623,6 +623,9 @@ SYSTEM_ABSEIL=@SYSTEM_ABSEIL@ export ABSEIL_CFLAGS=@ABSEIL_CFLAGS@ export ABSEIL_LIBS=@ABSEIL_LIBS@ SYSTEM_ABW=@SYSTEM_ABW@ +ARGON2_CFLAGS=$(gb_SPACE)@ARGON2_CFLAGS@ +ARGON2_LIBS=$(gb_SPACE)@ARGON2_LIBS@ +SYSTEM_ARGON2=@SYSTEM_ARGON2@ SYSTEM_BLUEZ=@SYSTEM_BLUEZ@ # FIXME: concat-deps reads SYSTEM_BOOST from env SYSTEM_BOOST=@SYSTEM_BOOST@ diff --git a/configure.ac b/configure.ac index 586e31f8bae5..e9755b9ee584 100644 --- a/configure.ac +++ b/configure.ac @@ -11206,6 +11206,14 @@ if test "$build_crypto" = yes; then fi fi +ARGON2_CFLAGS_internal="-I${WORKDIR}/UnpackedTarball/argon2/include" +if test "$COM" = "MSC"; then + ARGON2_LIBS_internal="${WORKDIR}/UnpackedTarball/argon2/vs2015/build/Argon2OptDll.lib" +else + ARGON2_LIBS_internal="${WORKDIR}/UnpackedTarball/argon2/libargon2.a" +fi +libo_CHECK_SYSTEM_MODULE([argon2],[ARGON2],[libargon2]) + dnl =================================================================== dnl Check for system redland dnl =================================================================== diff --git a/download.lst b/download.lst index 14171f07c1f7..6191a35ab4bd 100644 --- a/download.lst +++ b/download.lst @@ -8,6 +8,11 @@ ABW_TARBALL := libabw-0.1.3.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts +ARGON2_SHA256SUM := daf972a89577f8772602bf2eb38b6a3dd3d922bf5724d45e7f9589b5e830442c +ARGON2_TARBALL := phc-winner-argon2-20190702.tar.gz +# three static lines +# so that git cherry-pick +# will not run into conflicts # please repack the tarball using external/boost/repack_tarball.sh BOOST_SHA256SUM := e48ab6953fbd68ba47234bea5173e62427e9f6a7894e152305142895cfe955de BOOST_TARBALL := boost_1_82_0.tar.xz diff --git a/external/Module_external.mk b/external/Module_external.mk index 4d505991822a..e60765634ab5 100644 --- a/external/Module_external.mk +++ b/external/Module_external.mk @@ -16,6 +16,7 @@ endif $(eval $(call gb_Module_add_moduledirs,external,\ $(call gb_Helper_optional,XMLSEC,xmlsec) \ $(call gb_Helper_optional,ABW,libabw) \ + $(call gb_Helper_optional,ARGON2,argon2) \ $(call gb_Helper_optional,BOOST,boost) \ $(call gb_Helper_optional,BOX2D,box2d) \ $(call gb_Helper_optional,BREAKPAD,breakpad) \ diff --git a/external/argon2/ExternalPackage_argon2.mk b/external/argon2/ExternalPackage_argon2.mk new file mode 100644 index 000000000000..6542d7925440 --- /dev/null +++ b/external/argon2/ExternalPackage_argon2.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,argon2,argon2)) + +$(eval $(call gb_ExternalPackage_use_external_project,argon2,argon2)) + +ifeq ($(COM),MSC) +$(eval $(call gb_ExternalPackage_add_file,argon2,$(LIBO_LIB_FOLDER)/Argon2OptDll.dll,vs2015/build/Argon2OptDll.dll)) +endif # $(COM) + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/ExternalProject_argon2.mk b/external/argon2/ExternalProject_argon2.mk new file mode 100644 index 000000000000..c39fe062813b --- /dev/null +++ b/external/argon2/ExternalProject_argon2.mk @@ -0,0 +1,54 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalProject_ExternalProject,argon2)) + +$(eval $(call gb_ExternalProject_register_targets,argon2,\ + build \ +)) + +ifeq ($(COM),MSC) + +# .vcxproj needs manual SolutionDir to find header; there is a .sln file but it +# expects "x86" where we pass "Win32" + +$(call gb_ExternalProject_get_state_target,argon2,build): + $(call gb_Trace_StartRange,argon2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + MSBuild.exe vs2015/Argon2OptDll/Argon2OptDll.vcxproj \ + /p:SolutionDir="$(call gb_UnpackedTarball_get_dir,argon2)/" \ + $(gb_MSBUILD_CONFIG_AND_PLATFORM) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ + $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ + && MSBuild.exe vs2015/Argon2OptTestCI/Argon2OptTestCI.vcxproj \ + /p:SolutionDir="$(call gb_UnpackedTarball_get_dir,argon2)/" \ + $(gb_MSBUILD_CONFIG_AND_PLATFORM) \ + /p:PlatformToolset=$(VCTOOLSET) /p:VisualStudioVersion=$(VCVER) /ToolsVersion:Current \ + $(if $(filter 10,$(WINDOWS_SDK_VERSION)),/p:WindowsTargetPlatformVersion=$(UCRTVERSION)) \ + $(if $(CROSS_COMPILING),,&& time vs2015/build/Argon2OptTestCI.exe) \ + ) + $(call gb_Trace_EndRange,argon2,EXTERNAL) + +else # $(COM) + +# clear MAKEFILES because Makefile relies on built-in rules + +$(call gb_ExternalProject_get_state_target,argon2,build): + $(call gb_Trace_StartRange,argon2,EXTERNAL) + $(call gb_ExternalProject_run,build,\ + CFLAGS="$(CFLAGS) $(if $(filter-out WNT MACOSX,$(OS)),-fvisibility=hidden)" \ + MAKEFLAGS= $(MAKE) \ + OPTTARGET=$(if $(filter X86_64,$(CPUNAME)),x86-64,forcefail) \ + $(if $(CROSS_COMPILING),,&& time $(MAKE) test) \ + ) + $(call gb_Trace_EndRange,argon2,EXTERNAL) + +endif # $(COM) + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/Makefile b/external/argon2/Makefile new file mode 100644 index 000000000000..e4968cf85fb6 --- /dev/null +++ b/external/argon2/Makefile @@ -0,0 +1,7 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- + +module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) + +include $(module_directory)/../../solenv/gbuild/partial_build.mk + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/Module_argon2.mk b/external/argon2/Module_argon2.mk new file mode 100644 index 000000000000..5be66c0309bc --- /dev/null +++ b/external/argon2/Module_argon2.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_Module_Module,argon2)) + +$(eval $(call gb_Module_add_targets,argon2,\ + UnpackedTarball_argon2 \ + ExternalProject_argon2 \ + ExternalPackage_argon2 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/argon2/README b/external/argon2/README new file mode 100644 index 000000000000..e3198017e375 --- /dev/null +++ b/external/argon2/README @@ -0,0 +1,5 @@ +Argon2 password hashing function + +This is used in ODF encryption as key derivation function. + +[https://github.com/P-H-C/phc-winner-argon2] diff --git a/external/argon2/UnpackedTarball_argon2.mk b/external/argon2/UnpackedTarball_argon2.mk new file mode 100644 index 000000000000..1d314cfb08d9 --- /dev/null +++ b/external/argon2/UnpackedTarball_argon2.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,argon2)) + +$(eval $(call gb_UnpackedTarball_set_tarball,argon2,$(ARGON2_TARBALL))) + +# vim: set noet sw=4 ts=4: diff --git a/readlicense_oo/license/license.xml b/readlicense_oo/license/license.xml index 2e61d6f82e75..a8921c1abeeb 100644 --- a/readlicense_oo/license/license.xml +++ b/readlicense_oo/license/license.xml @@ -52,6 +52,12 @@ <h1 style="text-align: center;"><a id="thirdparty" name="thirdparty">Third Party Code Additional Copyright Notices and License Terms</a></h1> <h1><a id="a__Libraries" name="a__Libraries">Libraries</a></h1> + <div class="ARGON2"> + <h2>Argon2</h2> + <p>The following software may be included in this product: Argon2. Use of any of this software is governed + by the terms of the license below:</p> + <p><a href="#a__Apache_License_version_2_0">Jump to Apache License Version 2.0</a></p> + </div> <div class="BSH"> <h2>beanshell</h2> <p>The following software may be included in this product: beanshell. Use of any of this software is governed