-
Notifications
You must be signed in to change notification settings - Fork 0
Slot access code management #165
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
Conversation
JMarkstrom
left a comment
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.
@virot I think this is more or less gtg now.
| { | ||
| WriteError(new ErrorRecord(ex, "RemoveYubiKeyOTPError", ErrorCategory.InvalidOperation, null)); | ||
| } | ||
| // if (ex.Message.Contains("YubiKey Operation Failed") && ex.Message.Contains("state of non-volatile memory is unchanged")) |
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.
This was commented out because the error is indistinguishable from the error on successful operation (issue #182). I have asked Yubico to prioritize that defect.
| // Create a basic HOTP configuration with access code support | ||
| var configureHOTP = otpSession.ConfigureHotp(Slot); | ||
| var hmacKey = new byte[20]; | ||
| configureHOTP.UseKey(hmacKey); |
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.
This should not be necessary (from testing with Yubico apps) but not sure how to work around it.
| // TODO: Implement Upload to YubiCloud | ||
| // @virot: upload is no longer supported. Need to output a CSV file for manual upload. | ||
| WriteWarning("Upload to YubiCloud is not implemented yet!"); | ||
| WriteWarning("Upload to YubiCloud functionality has been deprecated by Yubico."); |
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.
Functionality has been removed. Must be done manually via browser now.
| /// | ||
| /// .NOTES | ||
| /// Setting or changing the access code will overwrite the selected slot's configuration. | ||
| /// This operation cannot be undone and will erase any existing secret or configuration in the slot. |
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.
Removed this since my latest commit addresses this issue.
|
Should it be Set-YubiKeySlotAccessCode or Set-YubiKeyOTPSlotAccessCode to align with the other Cmdlets? |
|
Pls change the naming as appropriate (I’m traveling). AFAIK we can only detect locked state by catching the specific error or maybe the unlocked state by supplying an access code of all zeroes.
Regards,
Jonas
…________________________________
From: Oscar Virot ***@***.***>
Sent: Monday, June 30, 2025 4:07:56 PM
To: virot/powershellYK ***@***.***>
Cc: J.L.M ***@***.***>; Author ***@***.***>
Subject: Re: [virot/powershellYK] Slot access code management (PR #165)
[https://avatars.githubusercontent.com/u/4600486?s=20&v=4]virot left a comment (virot/powershellYK#165)<#165 (comment)>
Should it be Set-YubiKeySlotAccessCode or Set-YubiKeyOTPSlotAccessCode to align with the other Cmdlets?
Is it possible to read the lockstate? Then we could change the code to be a dynamic parameter, so it will require the code if it is set, otherwise not?
—
Reply to this email directly, view it on GitHub<#165 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANY4G4AW7AG7RD7JPCU5ATT3GFADZAVCNFSM6AAAAAB73S5OG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMJZGMYDQNZXGM>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Rename Cmdlet YubiKeySlotAccessCode -> YubiKeyOTPSlotAccessCode
Added cmlet for setting, changing and removing a slot (ShortPress, LongPress) access code.
Added access code logic to existing OTP cmdlets.
Please review carefully ;)