Skip to content

OPEN-79: Support for zeroizing Asn1Encoder/WriterScope via VecOfU8#55

Open
simon-void wants to merge 2 commits intomainfrom
feature/open-79
Open

OPEN-79: Support for zeroizing Asn1Encoder/WriterScope via VecOfU8#55
simon-void wants to merge 2 commits intomainfrom
feature/open-79

Conversation

@simon-void
Copy link

support for zeroizing datatype VecOfU8.
Please check during review if throughout the code the appropriate variant of VecOfU8 is used!
Zeroizing is more secure but takes additional time (because its memory will be overriden by 0s on Drop).
NonZeroizing is less secure but faster.

Changes

  • introduces a new VecOfU8 enum with two variants Zeroizing and NonZeroizing which is used in many places instead of a Vec
  • if VecOfU8::Zeroizing is used it's underlying Vec is zeroed on drop
  • the Asn1Encoder now contains two write-functions (instead of one retrning a Vec), one returning a VecOfU8::Zeroizing and one returning a VecOfU8::NonZeroizing

Breaking Changes

  • None

Checklist

  • Tests added/updated where appropriate
  • FFI targets (swift, kotlin, ...) are updated where appropriate
  • Public API is documented
  • Docs updated (docs/, README.md) if needed
  • Release notes updated (ReleaseNotes.md) if user-facing change

}
}

let mut apdu = Vec::new();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be the same type of VecOfU8 somehow

@tobias-schwerdtfeger tobias-schwerdtfeger changed the title Feature/open 79 support for zeroizing Asn1Encoder/WriterScope via VecOfU8 OPEN-79: Support for zeroizing Asn1Encoder/WriterScope via VecOfU8 Feb 24, 2026
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