Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cool#9992 doc electronic sign: send the hash to be signed #10593

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

vmiklos
Copy link
Contributor

@vmiklos vmiklos commented Nov 25, 2024

Once the hash is extracted from the document, we need to send it to the
3rd-party for signing.

Given that we don't want to send the entire document, our signature
container should not be an entire PDF file, we just want this for the
signature binary itself (PKCS#7 blob), set the file type to "cades",
which does exactly this.

This requires passing the API URL, and credentials to
L.Control.ESignature.

Finally allow communicating with these hosts in the CSP headers.
Initially I attempted to take the URL from CheckFileInfo, but we seem to
decide this when serving cool.html, so that order doesn't allow making
the CSP headers depend on the CheckFileInfo response. In practice only 2
public servers implement this protocol (production and test), so just
allow them for now, similar to Zotero. If there is a need for a custom
server later, it can be always added to net.content_security_policy in
coolwsd.xml.

Signed-off-by: Miklos Vajna vmiklos@collabora.com
Change-Id: If1dfa50defb37205e54b2f3708f7bdaeab22afce

Once the hash is extracted from the document, we need to send it to the
3rd-party for signing.

Given that we don't want to send the entire document, our signature
container should not be an entire PDF file, we just want this for the
signature binary itself (PKCS#7 blob), set the file type to "cades",
which does exactly this.

This requires passing the API URL, and credentials to
L.Control.ESignature.

Finally allow communicating with these hosts in the CSP headers.
Initially I attempted to take the URL from CheckFileInfo, but we seem to
decide this when serving cool.html, so that order doesn't allow making
the CSP headers depend on the CheckFileInfo response. In practice only 2
public servers implement this protocol (production and test), so just
allow them for now, similar to Zotero. If there is a need for a custom
server later, it can be always added to net.content_security_policy in
coolwsd.xml.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If1dfa50defb37205e54b2f3708f7bdaeab22afce
@vmiklos
Copy link
Contributor Author

vmiklos commented Nov 25, 2024

https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-24.04/3436/console failed in:

unit-save-torture

but

./run-wsdunit unit-save-torture

passes for me, retry.

@vmiklos vmiklos requested a review from caolanm November 25, 2024 08:46
@vmiklos
Copy link
Contributor Author

vmiklos commented Nov 25, 2024

@caolanm could you please review this? Thanks.

This is step 2 -- still need to sort out hash signing, getting that signature and serialize. And then cover everything with a cypress test to make sure the lot of steps don't fall apart. :-)

@vmiklos vmiklos merged commit b09b204 into master Nov 25, 2024
13 checks passed
@vmiklos vmiklos deleted the private/vmiklos/master branch November 25, 2024 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants