-
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
Smart card credentials handling #206
Merged
TheBestTvarynka
merged 20 commits into
winscard-rs-impl
from
feature/winscard-credentials
Feb 7, 2024
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
f7a2844
feat(ffi): sspi: add logs to handle emulated smart card creds
TheBestTvarynka 9bfba4b
feat(winscard): derive Debug and Clone for SmartCard and ScardState
TheBestTvarynka 5a9a7e2
feat(winscard): add SmartCardContext::auth_pk_pe field. Derive Debug …
TheBestTvarynka 3134205
feat(sspi): add private key to smart card creds;
TheBestTvarynka e696f98
refactor(sspi): format code
TheBestTvarynka f904eba
feat(sspi): improve smart card creds passing. replaced winapi scard w…
TheBestTvarynka 40a2003
feat(ffi): implement emulated smart card credentials collecting
TheBestTvarynka 1a8370a
feat(winscard): env macro available only if std feature is turned on
TheBestTvarynka 6ac8e4f
feat(scard): add pi verification during the as-req pa-datas generation
TheBestTvarynka 61f9bb7
refactor(sspi-ffi): added verfication of the requested package to Acq…
TheBestTvarynka 0e0ca33
fix(kerberos): fixed sensitive data leakage in logs
TheBestTvarynka 7baf5af
fix(ffi): clippy error. refactor(sspi): remove unneeded logs
TheBestTvarynka 36054d9
feat(ffi): fix clippy warning
TheBestTvarynka e9ccbcf
feat(winscard): rename PIV_AUTHENTICATION_KEY into PIV_DIGITAL_SIGNAT…
TheBestTvarynka ba45274
refactor(ffi): improve comments
TheBestTvarynka 22b48a4
refactor(sspi): kerberos: remove unneeded log
TheBestTvarynka b2854b0
feat(winscard): improve cert file reading
TheBestTvarynka c1c0c04
feat(sspi): kerberos: add FIXME comment about problem with flags
TheBestTvarynka f1924fa
feat(ffi): sspi: improve comments when reading credentials
TheBestTvarynka 713e27b
feat(sspi): add comment about unused code
TheBestTvarynka 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#[cfg(feature = "std")] | ||
macro_rules! env { | ||
($name:expr) => {{ | ||
std::env::var($name).map_err(|_| { | ||
|
This file contains 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 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 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 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 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
nitpick: I recommend writing "proper sentences" to create a more appropriate frame of mind when writing comments. The expectation is to write down more of the context you had in mind when writing this code.
For instance, in this case what I really want to know as someone not familiar with the smart card protocol is "why we need to remove the null terminator at this place?" or "why is there a null terminator", etc. It’s okay to not always explain when it’s just a C-style UTF-16 string → Rust string conversion, but this is not what it is. (And if it was, using the appropriate function would be explicit enough.)
This comment can be applied at several places, but I leave you decide if and how much you do it.
(All that being said, the code you wrote is generally well documented, thank you again.)
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.
I agree with you. Can you check it again? I updated some comments
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.
It’s looking much better! For this place specifically, I would like something more like that:
The conversion itself is a detail, and what is important is the surroundings, the things we can’t see just by looking at the code.
(Again, I’m really being pedantic here.)
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.
I can understand you and I like it 😃.
I added more comprehensive explanations