diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2024-01-05 21:43:19 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2024-01-20 19:25:18 +0100 |
commit | eefe8cd88076d268a4fab16f683902cb29914725 (patch) | |
tree | 6ee6ae3a1c26dac72669dd4bfec14f1393debc76 /package/source/manifest | |
parent | 40fe6989be3a1e2b2b18664095413e32076c1a83 (diff) |
tdf#105844 package: ManifestImport: handle argon2 attributes in ...
... standard namespace too.
Change-Id: I46804795da2009dfd8bb95b9286933728a132e5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161785
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit bac43054e2997235ce98432bc9cb6c434120e4b2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161764
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'package/source/manifest')
-rw-r--r-- | package/source/manifest/ManifestDefines.hxx | 9 | ||||
-rw-r--r-- | package/source/manifest/ManifestImport.cxx | 12 |
2 files changed, 15 insertions, 6 deletions
diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx index dbe7b985b8c0..c2f5e2778a30 100644 --- a/package/source/manifest/ManifestDefines.hxx +++ b/package/source/manifest/ManifestDefines.hxx @@ -70,9 +70,12 @@ inline constexpr OUString ELEMENT_KEY_DERIVATION = u"manifest:key-derivation"_us inline constexpr OUString ATTRIBUTE_KEY_DERIVATION_NAME = u"manifest:key-derivation-name"_ustr; inline constexpr OUString ATTRIBUTE_SALT = u"manifest:salt"_ustr; inline constexpr OUString ATTRIBUTE_ITERATION_COUNT = u"manifest:iteration-count"_ustr; -inline constexpr OUString ATTRIBUTE_ARGON2_T_LO= u"loext:argon2-iterations"_ustr; -inline constexpr OUString ATTRIBUTE_ARGON2_M_LO= u"loext:argon2-memory"_ustr; -inline constexpr OUString ATTRIBUTE_ARGON2_P_LO= u"loext:argon2-lanes"_ustr; +inline constexpr OUString ATTRIBUTE_ARGON2_T = u"manifest:argon2-iterations"_ustr; +inline constexpr OUString ATTRIBUTE_ARGON2_M = u"manifest:argon2-memory"_ustr; +inline constexpr OUString ATTRIBUTE_ARGON2_P = u"manifest:argon2-lanes"_ustr; +inline constexpr OUString ATTRIBUTE_ARGON2_T_LO = u"loext:argon2-iterations"_ustr; +inline constexpr OUString ATTRIBUTE_ARGON2_M_LO = u"loext:argon2-memory"_ustr; +inline constexpr OUString ATTRIBUTE_ARGON2_P_LO = u"loext:argon2-lanes"_ustr; /// OFFICE-3708: wrong URL cited in ODF 1.2 and used since OOo 3.4 beta inline constexpr OUString SHA256_URL_ODF12 = u"http://www.w3.org/2000/09/xmldsig#sha256"_ustr; diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx index f6f4ce36f4a2..0218ac07a5d2 100644 --- a/package/source/manifest/ManifestImport.cxx +++ b/package/source/manifest/ManifestImport.cxx @@ -242,11 +242,17 @@ void ManifestImport::doKeyDerivation(StringHashMap &rConvertedAttribs) { aSequence[PKG_MNFST_KDF].Value <<= xml::crypto::KDFID::Argon2id; - aString = rConvertedAttribs[ATTRIBUTE_ARGON2_T_LO]; + aString = rConvertedAttribs.find(ATTRIBUTE_ARGON2_T) != rConvertedAttribs.end() + ? rConvertedAttribs[ATTRIBUTE_ARGON2_T] + : rConvertedAttribs[ATTRIBUTE_ARGON2_T_LO]; sal_Int32 const t(aString.toInt32()); - aString = rConvertedAttribs[ATTRIBUTE_ARGON2_M_LO]; + aString = rConvertedAttribs.find(ATTRIBUTE_ARGON2_M) != rConvertedAttribs.end() + ? rConvertedAttribs[ATTRIBUTE_ARGON2_M] + : rConvertedAttribs[ATTRIBUTE_ARGON2_M_LO]; sal_Int32 const m(aString.toInt32()); - aString = rConvertedAttribs[ATTRIBUTE_ARGON2_P_LO]; + aString = rConvertedAttribs.find(ATTRIBUTE_ARGON2_P) != rConvertedAttribs.end() + ? rConvertedAttribs[ATTRIBUTE_ARGON2_P] + : rConvertedAttribs[ATTRIBUTE_ARGON2_P_LO]; sal_Int32 const p(aString.toInt32()); if (0 < t && 0 < m && 0 < p) { |