Skip to content

Commit

Permalink
WiP key to card fails with invalid time when moving keys to smartcard
Browse files Browse the repository at this point in the history
- whiptail_or_die has HEIGHT 0. This doesn't show a scrolling window here which is problematic
- Adding DO_WITH_DEBUG in that specific gpg call

Signed-off-by: Thierry Laurion <[email protected]>
  • Loading branch information
tlaurion committed May 14, 2024
1 parent c91731c commit 575e195
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion initrd/bin/oem-factory-reset
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ keytocard_subkeys_to_smartcard() {

gpg_key_factory_reset

DEBUG "GPG_USER_MAIL: ${GPG_USER_MAIL}"

echo "Moving subkeys to smartcard..."
{
echo "key 1" #Toggle on Signature key in --edit-key mode on local keyring
Expand All @@ -297,7 +299,7 @@ keytocard_subkeys_to_smartcard() {
echo "${ADMIN_PIN_DEF}" #Smartcard Admin PIN
echo "key 3" #Toggle off Authentication key
echo "save" #Save changes and commit to keyring
} | gpg --expert --command-fd=0 --status-fd=1 --pinentry-mode=loopback --edit-key "${GPG_USER_MAIL}" \
} | DO_WITH_DEBUG gpg --expert --command-fd=0 --status-fd=1 --pinentry-mode=loopback --edit-key "${GPG_USER_MAIL}" \
>/tmp/gpg_card_edit_output 2>&1
if [ $? -ne 0 ]; then
ERROR=$(cat /tmp/gpg_card_edit_output)
Expand Down

0 comments on commit 575e195

Please sign in to comment.