Extended loplugin:ostr: xmlsecurity
Change-Id: I639bf4af888e5af615379515d92ad70025d8ac15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159660 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -875,14 +875,14 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdESNotype)
|
||||
// attribute", i.e. the signature without such an attribute was not preserved correctly.
|
||||
assertXPathNoAttribute(pXmlDoc,
|
||||
"/odfds:document-signatures/dsig:Signature[1]/dsig:SignedInfo/"
|
||||
"dsig:Reference[starts-with(@URI, '#idSignedProperties')]",
|
||||
"Type");
|
||||
"dsig:Reference[starts-with(@URI, '#idSignedProperties')]"_ostr,
|
||||
"Type"_ostr);
|
||||
|
||||
// New signature always has the Type attribute.
|
||||
assertXPath(pXmlDoc,
|
||||
"/odfds:document-signatures/dsig:Signature[2]/dsig:SignedInfo/"
|
||||
"dsig:Reference[starts-with(@URI, '#idSignedProperties')]",
|
||||
"Type", "http://uri.etsi.org/01903#SignedProperties");
|
||||
"dsig:Reference[starts-with(@URI, '#idSignedProperties')]"_ostr,
|
||||
"Type"_ostr, "http://uri.etsi.org/01903#SignedProperties");
|
||||
}
|
||||
|
||||
/// Creates a XAdES signature from scratch.
|
||||
@@ -929,15 +929,15 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdES)
|
||||
// Assert that the digest algorithm is SHA-256 in the bAdESCompliant case, not SHA-1.
|
||||
assertXPath(pXmlDoc,
|
||||
"/odfds:document-signatures/dsig:Signature/dsig:SignedInfo/"
|
||||
"dsig:Reference[@URI='content.xml']/dsig:DigestMethod",
|
||||
"Algorithm", ALGO_XMLDSIGSHA256);
|
||||
"dsig:Reference[@URI='content.xml']/dsig:DigestMethod"_ostr,
|
||||
"Algorithm"_ostr, ALGO_XMLDSIGSHA256);
|
||||
|
||||
// Assert that the digest of the signing certificate is included.
|
||||
assertXPath(pXmlDoc, "//xd:CertDigest", 1);
|
||||
assertXPath(pXmlDoc, "//xd:CertDigest"_ostr, 1);
|
||||
|
||||
// Assert that the Type attribute is set on all URI's that start with #idSignedProperties
|
||||
assertXPath(pXmlDoc, "//dsig:Reference[starts-with(@URI, '#idSignedProperties')]", "Type",
|
||||
"http://uri.etsi.org/01903#SignedProperties");
|
||||
assertXPath(pXmlDoc, "//dsig:Reference[starts-with(@URI, '#idSignedProperties')]"_ostr,
|
||||
"Type"_ostr, "http://uri.etsi.org/01903#SignedProperties");
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT)
|
||||
|
||||
@@ -62,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPreserveMacroSignatureODB)
|
||||
xmlDocUniquePtr pXmlDoc = parseXmlStream(pStream.get());
|
||||
|
||||
// Make sure the signature is still there
|
||||
assertXPath(pXmlDoc, "//dsig:Signature", "Id",
|
||||
assertXPath(pXmlDoc, "//dsig:Signature"_ostr, "Id"_ostr,
|
||||
"ID_00a7002f009000bc00ce00f7004400460080002f002e00e400e0003700df00e8");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user