Skip to content

Commit

Permalink
extent hotp error message for nitrokeys
Browse files Browse the repository at this point in the history
  • Loading branch information
nestire committed May 21, 2024
1 parent 857ac42 commit 7c8fb5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions initrd/bin/seal-hotpkey
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ if [ "$admin_pin_status" -ne 0 ]; then
if ! hotp_initialize "$admin_pin" $HOTP_SECRET $counter_value "$HOTPKEY_BRANDING" ; then
# don't leak key on failure
shred -n 10 -z -u "$HOTP_SECRET" 2> /dev/null
fatal_error "Setting HOTP secret failed"
if [ "$HOTPKEY_BRANDING" == "Nitrokey" ]; then
fatal_error "Setting HOTP secret failed, to reset nitrokey pin use: nitropy nk3 secrets reset or the Nitrokey App 2"
else
fatal_error "Setting HOTP secret failed"
fi
fi
fi
else
# remind user to change admin password
echo -e "\nWARNING: default GPG admin PIN detected: please change this as soon as possible."
echo -e "\nWARNING: default admin PIN detected: please change this as soon as possible."
fi

# HOTP key no longer needed
Expand Down

0 comments on commit 7c8fb5c

Please sign in to comment.