-
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix imports with oversized source #204
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
Conversation
dorssel
commented
Oct 29, 2025
- also improve marshalling
✅MegaLinter analysis: Success
See detailed reports in MegaLinter artifacts You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 867 861 -6
Branches 77 79 +2
=========================================
- Hits 867 861 -6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the XMSS public key handling by:
- Replacing unsafe pointer operations with
MemoryMarshalAPIs for safer memory management - Adding support for oversized input handling in import methods
- Improving validation logic for ASN.1 encoded keys
Key Changes
- Refactored export methods to use
MemoryMarshal.WriteandMemoryMarshal.Castinstead of unsafe fixed pointer operations - Modified
DecodeXmssPublicKeyto handle both exact-size and oversized inputs with improved validation - Updated
DecodeAsnPublicKeyto validate ASN.1 encoding size and key data size separately - Added comprehensive test coverage for oversized input scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Xmss/Xmss.cs | Refactored public key export/import methods to use MemoryMarshal APIs; improved input validation for oversized keys; renamed unused variables from publicKeyPtr to publicKeyPin |
| UnitTests/UnitTests/ImportTests.cs | Added test cases for importing oversized RFC and ASN.1 public keys to verify correct handling and bytesRead tracking |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- also improve marshalling
