Skip to content

Fix for validating ECDSA signature.#41

Open
azure-hu wants to merge 1 commit intoitext:developfrom
azure-hu:develop
Open

Fix for validating ECDSA signature.#41
azure-hu wants to merge 1 commit intoitext:developfrom
azure-hu:develop

Conversation

@azure-hu
Copy link
Copy Markdown

Inside AcroFields.VerifySignature() a new PdfPKCS7 object has to be initialized, and it fails when signature is created with ECDSA. PdfPKCS7 ctor. calls InitSignature() which calls GetDigestAlgorithm() which calls GetEncryptionAlgorithm(). Because EncryptionAlgorithm.algorithmNames missing ECDSA related OIDs, therefore GetDigestAlgorithm() returns an unknown algorithm, e.g.: in case of ECDSA with SHA-512, the result is: "Sha512With1.2.840.10045.4.3.4".
This can be easily fixed by "backporting" some OIDs found in SignatureMechanisms class from itext-dotnet ver.7+ (https://github.com/itext/itext-dotnet/blob/develop/itext/itext.sign/itext/signatures/SignatureMechanisms.cs).

@iText-CI
Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants