tdf#84881: Timestamp the right data (Win32 version)

Desktop / LibreOffice - Tor Lillqvist [collabora.com] - 27 February 2015 09:25 UTC

Now Adobe Reader is satisfied with the signature timestamp also for a PDF signed and timestamped on Windows.

My gleeful commit comment from yesterday about how much simpler the Win32 crypto API was to use for this task was not entirely true. It is simpler than using NSS and curl, but not as simple as I had hoped. Oh well, I am not really surprised.

I now use the "low-level" message functions instead of the single "simplified" CryptSignMessage(). And just like with NSS, I need to create the message twice; first to get the signature to timestamp, and then a second time to attach the timestamp. But now I wonder whether doing CryptSignMessage() twice would work too. Anyway, won't touch the code now for a while.

I am actually a bit surprised that the code works... Must have been my lucky day. Or then I just am good at making educated guesses at what an API does, even if the documentation doesn't make it perfectly clear. Especially, I am a bit surprised that calling CryptMsgGetParam(hMsg, CMSG_BARE_CONTENT_PARAM) returns (just) the signature. OTOH, what else would it return?

2c78736 tdf#84881: Timestamp the right data (Win32 version)
vcl/source/gdi/pdfwriter_impl.cxx | 348 +++++++++++++++++++++++++------------
1 file changed, 241 insertions(+), 107 deletions(-)

Upstream: cgit.freedesktop.org


  • Share