Skip to content

Fix use of newer Bouncycastle library#1065

Closed
raymens wants to merge 4 commits intoNethereum:masterfrom
raymens:fix-use-of-newer-bouncycastle
Closed

Fix use of newer Bouncycastle library#1065
raymens wants to merge 4 commits intoNethereum:masterfrom
raymens:fix-use-of-newer-bouncycastle

Conversation

@raymens
Copy link
Contributor

@raymens raymens commented Jan 8, 2025

The previous implementation contained an issue, that might actually be part of Bouncycastle itself.
The Close method that was being called on the legacy versions was no longer part of the DerSequenceGenerator in the newer version.

After some additional digging it seems to have been replaced by a Finish method, however that method has the protected accessibility modifier and it thus not available by default.

To fix that I introduced a CompatibleDerSequenceGenerator class that doesn't do much except for adding back the Close method and calling on the protected Finish in case of the newer version.

To make sure this Invalid DER Signature exception was tested I've added additional frameworks to the Nethereum.Signer.Unittests project.

@juanfranblanco
Copy link
Member

Fixed another way. Many thanks. It is in 5.0.0 release.

@raymens raymens deleted the fix-use-of-newer-bouncycastle branch November 11, 2025 22:43
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