-
Notifications
You must be signed in to change notification settings - Fork 175
gss-api: change NegHints::hint_name to GeneralStringRef type
#1779
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
Merged
tarcieri
merged 7 commits into
RustCrypto:master
from
dishmaker:dishmaker/gss_api_generalstringref
Apr 25, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f5a480f
gss-api: change `NegHints::hint_name` to GeneralStringRef type
dishmaker c7dc16e
remove TODO
dishmaker c2b95a0
der: add minimal GeneralStringRef type
dishmaker 9f5391d
der: docs GeneralStringRef
dishmaker e37e4a8
der: change GeneralStringRef.__contents to &[u8]
dishmaker 36e100b
gss-api: use __contents in test
dishmaker a3b26cc
der: change GeneralStringRef.inner to BytesRef
dishmaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| use crate::{BytesRef, DecodeValue, EncodeValue, FixedTag, Header, Length, Reader, Tag, Writer}; | ||
|
|
||
| /// This is currently `OctetStringRef` internally, as `GeneralString` is not fully implemented yet | ||
| #[derive(Clone, Copy, Debug, Eq, PartialEq)] | ||
| pub struct GeneralStringRef<'a> { | ||
| /// Raw contents, unchecked | ||
| #[doc(hidden)] | ||
| pub __contents: &'a [u8], | ||
| } | ||
| impl FixedTag for GeneralStringRef<'_> { | ||
| const TAG: Tag = Tag::GeneralString; | ||
| } | ||
| impl<'a> DecodeValue<'a> for GeneralStringRef<'a> { | ||
| type Error = crate::Error; | ||
|
|
||
| fn decode_value<R: Reader<'a>>(reader: &mut R, header: Header) -> Result<Self, Self::Error> { | ||
| Ok(Self { | ||
| __contents: BytesRef::decode_value(reader, header)?.as_slice(), | ||
| }) | ||
| } | ||
| } | ||
| impl EncodeValue for GeneralStringRef<'_> { | ||
| fn value_len(&self) -> crate::Result<Length> { | ||
| BytesRef::new(self.__contents)?.value_len() | ||
| } | ||
|
|
||
| fn encode_value(&self, encoder: &mut impl Writer) -> crate::Result<()> { | ||
| BytesRef::new(self.__contents)?.encode_value(encoder) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.