To be able to sign externally, we need a way to know what is the
document hash that would be passed to
NSS_CMSSignedData_SetDigestValue(), without actually performing the
signing.
Note that svl::crypto::SigningContext already gives us a way to expose
the time that would be used for signing.
Expose the hash in a similar way: the format is a SHA-256 hash in base64
form.
This adapts both places dealing with time: vcl::PDFWriter::GetDateTime()
and svl::crypto::Signing::Sign, to make sure they use the same time,
otherwise the hash would potentially depend on two times, which would be
hard to reproduce later when we serialize the signature we get.
Change-Id: Ib039db4cdd043c8117215c31cb5bc83397693820
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176470
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
After commit df3483fa74 "tdf#130857
VclBuilder: Make MenuAndId a template", 2024-11-10
[CXX] vcl/jsdialog/executor.cxx
C:\lo\core\include\rtl/ref.hxx(126): error C2027: use of undefined type 'PopupMenu'
C:\lo\core\include\vcl/builder.hxx(41): note: see declaration of 'PopupMenu'
C:\lo\core\include\rtl/ref.hxx(126): note: the template instantiation context (the oldest one first) is
C:\lo\core\include\vcl/toolkit/menubtn.hxx(40): note: see reference to class template instantiation 'VclPtr<PopupMenu>' being compiled
C:\lo\core\include\vcl/vclptr.hxx(64): note: see reference to class template instantiation 'rtl::Reference<reference_type>' being compiled
with
[
reference_type=PopupMenu
]
C:\lo\core\include\rtl/ref.hxx(123): note: while compiling class template member function 'rtl::Reference<reference_type>::~Reference(void)'
with
[
reference_type=PopupMenu
]
C:\lo\core\include\vcl/vclptr.hxx(217): note: see the first reference to 'rtl::Reference<reference_type>::~Reference' in 'VclPtr<PopupMenu>::~VclPtr'
with
[
reference_type=PopupMenu
]
Change-Id: Ifa2f8e55135faf8864a157aeddcf2764f4b2db4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176471
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
V1037 Two or more case-branches perform the same actions. Check lines: 981, 1008
V1037 Two or more case-branches perform the same actions. Check lines: 1018, 1025
Change-Id: Iea6f6edc65490587cb974f6d3baa17d3a337a0c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175217
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
V1037 Two or more case-branches perform the same actions. Check lines: 921, 924
V1037 Two or more case-branches perform the same actions. Check lines: 1003, 1160
Change-Id: I42e78f2960b97a67625bfdb524b7f615833332ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175230
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
V1037 Two or more case-branches perform the same actions. Check lines: 697, 700
V1037 Two or more case-branches perform the same actions. Check lines: 714, 717
Change-Id: Icb62ded0f40561215abb2bbe571f94c72409916b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175341
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
V1037 Two or more case-branches perform the same actions. Check lines: 36, 186
V1037 Two or more case-branches perform the same actions. Check lines: 51, 266
V1037 Two or more case-branches perform the same actions. Check lines: 86, 281
V1037 Two or more case-branches perform the same actions. Check lines: 96, 116
V1037 Two or more case-branches perform the same actions. Check lines: 101, 121
V1037 Two or more case-branches perform the same actions. Check lines: 136, 211
V1037 Two or more case-branches perform the same actions. Check lines: 141, 171
V1037 Two or more case-branches perform the same actions. Check lines: 146, 176
V1037 Two or more case-branches perform the same actions. Check lines: 151, 161
V1037 Two or more case-branches perform the same actions. Check lines: 156, 166
V1037 Two or more case-branches perform the same actions. Check lines: 236, 251
Change-Id: I34e62bf931da669e35a0b8e0e25b50402a334c27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175224
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Change-Id: Ic54a8e009f68ab992831ba849ae1349a6235bedd
V1037: Two or more case-branches perform the same actions. Check lines: 1276 and 1408, 1434 and 1510
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175149
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Change-Id: Icb29cacf3888421843c958a4f157d1079343cc9e
V1037: Two or more case-branches perform the same actions. Check lines: 1173, 1176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175053
Tested-by: Jenkins
Reviewed-by: David Gilbert <freedesktop@treblig.org>
V1037 Two or more case-branches perform the same actions. Check lines: 544, 552
V1037 Two or more case-branches perform the same actions. Check lines: 923, 929
V1037 Two or more case-branches perform the same actions. Check lines: 993, 1001
Change-Id: I373ccdb56bee8d446e2aec3295ba9c0fb23ff82a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175229
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
V1037 Two or more case-branches perform the same actions. Check lines: 1051, 1124
Change-Id: Iffebecc9ae82633734fd585e40fe51b30fde56b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175211
Reviewed-by: David Gilbert <freedesktop@treblig.org>
Tested-by: Jenkins
V656 Variables 'aOldSet', 'aNewSet' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'pOldAttrs->GetItemSet()' expression. Check lines: 1181, 1182.
Change-Id: I44b7be1bfb53872109b39323f909d5e1fcc1a809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176405
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
intended for use with crashtesting to detect when we export something we
can't import
Change-Id: I80c2f5198f8695c00a68cf09d4512d56c5a537a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176412
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
The final goal of this API is to give time & hash information about the
PDF signature, so once a 3rd-party produces the PKCS#7 signature, that
can be added to the document and the actual PDF sign can be re-run with
the same parameters.
This commit continues the replacement of XCertificate with
svl::crypto::SigningContext up to the point that the timestamp used in
svl/ can be exposed on the LOK API.
This is done by updating DocumentSignatureManager::add(),
PDFSignatureHelper::SetX509Certificate(),
vcl::filter::PDFDocument::Sign() and finally the svl::crypto::Signing
ctor to work with the signing context instead of an XCertificate
directly.
Time reporting works now, so add a test for that. The digest part still
needs doing.
Change-Id: I83f1274cd420b67194b7caf12b1027e623d4f7fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176404
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins