Skip to content

Conversation

@dorssel
Copy link
Owner

@dorssel dorssel commented Oct 29, 2025

  • also improve marshalling

@dorssel dorssel requested a review from Copilot October 29, 2025 20:48
@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 8 0 0 0.13s
✅ C cppcheck 1 0 0 0.03s
✅ C cpplint 1 0 0 0.32s
✅ CSS stylelint 1 0 0 1.4s
✅ EDITORCONFIG editorconfig-checker 150 0 0 0.59s
✅ HTML djlint 2 0 0 1.1s
✅ HTML htmlhint 2 0 0 0.27s
✅ JSON jsonlint 4 0 0 0.16s
✅ JSON prettier 4 0 0 0.52s
✅ MARKDOWN markdownlint 2 0 0 0.68s
✅ MARKDOWN markdown-table-formatter 2 0 0 0.25s
✅ REPOSITORY gitleaks yes no no 1.45s
✅ REPOSITORY git_diff yes no no 0.03s
✅ REPOSITORY grype yes no no 30.97s
✅ REPOSITORY secretlint yes no no 1.57s
✅ REPOSITORY syft yes no no 2.76s
✅ REPOSITORY trivy-sbom yes no no 0.83s
✅ REPOSITORY trufflehog yes no no 4.29s
✅ XML xmllint 16 0 0 1.02s
✅ YAML prettier 19 0 0 0.99s
✅ YAML v8r 19 0 0 10.44s
✅ YAML yamllint 19 0 0 0.69s

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 FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx [email protected] --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,C_CPPCHECK,C_CPPLINT,CSS_STYLELINT,EDITORCONFIG_EDITORCONFIG_CHECKER,HTML_DJLINT,HTML_HTMLHINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,XML_XMLLINT,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (58d70b7) to head (0b59b09).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

Copy link

Copilot AI left a 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 MemoryMarshal APIs 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.Write and MemoryMarshal.Cast instead of unsafe fixed pointer operations
  • Modified DecodeXmssPublicKey to handle both exact-size and oversized inputs with improved validation
  • Updated DecodeAsnPublicKey to 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
@dorssel dorssel merged commit cac83f0 into main Nov 14, 2025
17 checks passed
@dorssel dorssel deleted the fix_import branch November 14, 2025 14:22
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