-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(sspi): add SECBUFFER_READONLY_WITH_CHECKSUM
flag support
#357
Conversation
…FFER_READONLY_WITH_CHECKSUM` buffer flags. refactor all dependent code (exept tests);
…DONLY_WITH_CHECKSUM buffers;
…DONLY_WITH_CHECKSUM buffers;
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.
Nice work!
src/security_buffer.rs
Outdated
/// A special security buffer type is used for the data decryption. Basically, it's almost the same | ||
/// as `OwnedSecurityBuffer` but for decryption. |
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.
thought: What about SecurityBuffer
for the owned version, and SecurityBufferRef
for the borrowing version? It’s a common naming I’m seeing more and more. (Follow up in a separate PR.)
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.
Good idea! Your naming suggestions are good as always. Somewhat I didn't think about the -Ref
postfix.
Done
src/security_buffer.rs
Outdated
#[non_exhaustive] | ||
pub enum SecurityBuffer<'data> { | ||
pub enum SecurityBufferType<'data> { |
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.
naming: What do you think of UntaggedSecurityBuffer
? Does it make sense in this context?
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.
Actually, it is tagged because each enum variant represents a different buffer type. It lacks only buffer flags, so I renamed it to UnflaggedSecurityBuffer
. What do you think?
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.
Sounds good
src/security_buffer.rs
Outdated
} | ||
|
||
/// Returns the vector of immutable references to the [SecurityBuffer] with specified buffer type. | ||
pub fn buffers_with_type<'a>( |
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.
naming: of
instead of with
is clearer. Same suggestion for the other filtered iterators.
pub fn buffers_with_type<'a>( | |
pub fn buffers_of_type<'a>( |
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.
done
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.
LGTM!
Hi,
I added
SECBUFFER_READONLY
andSECBUFFER_READONLY_WITH_CHECKSUM
flags support. It is related to #120This PR affects many files because I changed the security buffer structure to add those flags.
Docs & reference:
SecBuffer
structure (sspi.h).