summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/source/manifest/ManifestDefines.hxx4
-rw-r--r--package/source/manifest/ManifestExport.cxx4
-rw-r--r--package/source/manifest/ManifestImport.cxx3
-rw-r--r--package/source/manifest/ManifestImport.hxx1
4 files changed, 9 insertions, 3 deletions
diff --git a/package/source/manifest/ManifestDefines.hxx b/package/source/manifest/ManifestDefines.hxx
index 3db4a0b584bc..968aed648e6a 100644
--- a/package/source/manifest/ManifestDefines.hxx
+++ b/package/source/manifest/ManifestDefines.hxx
@@ -52,7 +52,9 @@
#define ATTRIBUTE_SALT "manifest:salt"
#define ATTRIBUTE_ITERATION_COUNT "manifest:iteration-count"
-#define SHA256_URL "http://www.w3.org/2000/09/xmldsig#sha256"
+/// OFFICE-3708: wrong URL cited in ODF 1.2 and used since OOo 3.4 beta
+#define SHA256_URL_ODF12 "http://www.w3.org/2000/09/xmldsig#sha256"
+#define SHA256_URL "http://www.w3.org/2001/04/xmlenc#sha256"
#define SHA1_NAME "SHA1"
#define SHA1_URL "http://www.w3.org/2000/09/xmldsig#sha1"
diff --git a/package/source/manifest/ManifestExport.cxx b/package/source/manifest/ManifestExport.cxx
index 2c12b5f574d1..ebb87f6d47d9 100644
--- a/package/source/manifest/ManifestExport.cxx
+++ b/package/source/manifest/ManifestExport.cxx
@@ -81,6 +81,7 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
const OUString sWhiteSpace ( " " );
+ const OUString sSHA256_URL_ODF12 ( SHA256_URL_ODF12 );
const OUString sSHA256_URL ( SHA256_URL );
const OUString sSHA1_Name ( SHA1_NAME );
@@ -350,7 +351,8 @@ ManifestExport::ManifestExport( uno::Reference< xml::sax::XDocumentHandler > xHa
*pStartKeyAlg >>= nStartKeyAlgID;
if ( nStartKeyAlgID == xml::crypto::DigestID::SHA256 )
{
- sStartKeyAlg = sSHA256_URL;
+ sStartKeyAlg = sSHA256_URL_ODF12; // TODO use sSHA256_URL
+ (void) sSHA256_URL;
aBuffer.append( (sal_Int32)32 );
sStartKeySize = aBuffer.makeStringAndClear();
}
diff --git a/package/source/manifest/ManifestImport.cxx b/package/source/manifest/ManifestImport.cxx
index 7cc28660d783..0bf9819d2a1e 100644
--- a/package/source/manifest/ManifestImport.cxx
+++ b/package/source/manifest/ManifestImport.cxx
@@ -70,6 +70,7 @@ ManifestImport::ManifestImport( vector < Sequence < PropertyValue > > & rNewManV
, sStartKeyAlgProperty ( "StartKeyAlgorithm" )
, sDigestAlgProperty ( "DigestAlgorithm" )
+ , sSHA256_URL_ODF12 ( SHA256_URL_ODF12 )
, sSHA256_URL ( SHA256_URL )
, sSHA1_Name ( SHA1_NAME )
, sSHA1_URL ( SHA1_URL )
@@ -228,7 +229,7 @@ void ManifestImport::doStartKeyAlg(StringHashMap &rConvertedAttribs)
throw( uno::RuntimeException )
{
OUString aString = rConvertedAttribs[sStartKeyAlgNameAttribute];
- if ( aString.equals( sSHA256_URL ) ) {
+ if (aString.equals(sSHA256_URL) || aString.equals(sSHA256_URL_ODF12)) {
aSequence[PKG_MNFST_STARTALG].Name = sStartKeyAlgProperty;
aSequence[PKG_MNFST_STARTALG].Value <<= xml::crypto::DigestID::SHA256;
} else if ( aString.equals( sSHA1_Name ) || aString.equals( sSHA1_URL ) ) {
diff --git a/package/source/manifest/ManifestImport.hxx b/package/source/manifest/ManifestImport.hxx
index 19484969cb75..4e25499f5629 100644
--- a/package/source/manifest/ManifestImport.hxx
+++ b/package/source/manifest/ManifestImport.hxx
@@ -93,6 +93,7 @@ protected:
const OUString sStartKeyAlgProperty;
const OUString sDigestAlgProperty;
+ const OUString sSHA256_URL_ODF12;
const OUString sSHA256_URL;
const OUString sSHA1_Name;
const OUString sSHA1_URL;