Merge pull request #90 from str4d/21-mgmkey-advice

Give guidance on reconfiguring YubiKeys with unprotected management keys
This commit is contained in:
str4d
2022-12-30 10:23:51 +00:00
committed by GitHub
2 changed files with 23 additions and 2 deletions
+8 -1
View File
@@ -170,7 +170,14 @@ plugin-err-pin-required = A PIN is required for {-yubikey} with serial {$yub
## Errors ## Errors
err-custom-mgmt-key = Custom unprotected management keys are not supported. err-custom-mgmt-key = Custom unprotected management keys are not supported.
rec-custom-mgmt-key =
You can use the {-yubikey} Manager CLI to change to a protected management key:
{" "}{$cmd}
See here for more information about {-yubikey} Manager:
{" "}{$url}
err-invalid-flag-command = Flag '{$flag}' cannot be used with '{$command}'. err-invalid-flag-command = Flag '{$flag}' cannot be used with '{$command}'.
err-invalid-flag-tui = Flag '{$flag}' cannot be used with the interactive interface. err-invalid-flag-tui = Flag '{$flag}' cannot be used with the interactive interface.
err-invalid-pin-length = The PIN needs to be 1-8 characters. err-invalid-pin-length = The PIN needs to be 1-8 characters.
+15 -1
View File
@@ -48,7 +48,21 @@ impl From<yubikey::Error> for Error {
impl fmt::Debug for Error { impl fmt::Debug for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Error::CustomManagementKey => wlnfl!(f, "err-custom-mgmt-key")?, Error::CustomManagementKey => {
wlnfl!(f, "err-custom-mgmt-key")?;
let cmd = "ykman piv access change-management-key --protect";
let url = "https://developers.yubico.com/yubikey-manager/";
writeln!(
f,
"{}",
fl!(
crate::LANGUAGE_LOADER,
"rec-custom-mgmt-key",
cmd = cmd,
url = url,
),
)?;
}
Error::InvalidFlagCommand(flag, command) => writeln!( Error::InvalidFlagCommand(flag, command) => writeln!(
f, f,
"{}", "{}",