From c47a76a442700e3766ec50d92bc2b85d8757ddf8 Mon Sep 17 00:00:00 2001 From: Alex Wilson Date: Wed, 17 Apr 2019 22:19:33 -0700 Subject: [PATCH] OSX package: init fresh new yubikeys properly --- macosx/scripts/postinstall | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/macosx/scripts/postinstall b/macosx/scripts/postinstall index d50f06a..c803496 100755 --- a/macosx/scripts/postinstall +++ b/macosx/scripts/postinstall @@ -11,16 +11,18 @@ while true; do /usr/bin/osascript -e 'display dialog "Please insert your YubiKey and press OK"' # XXX: we just take the first one we see? - while IFS=: read rdrname guid chuid ykpiv; do + while IFS=: read rdrname guid chuid ykpiv _; do # check it's been set up with a CHUID if [[ "$chuid" == "false" && "$ykpiv" == "true" ]]; then # if it hasn't set up a basic one + 9e key so we can pin it. # the user can do the rest with pivy-tool later. - $bindir/pivy-tool -g $guid init + $bindir/pivy-tool -g 00000000 init # "init" changes the guid - guid=$($bindir/pivy-tool list -p | \ + guid=$($bindir/pivy-tool -p list | \ /usr/bin/grep "$rdrname" | /usr/bin/awk -F: '{print $2}') $bindir/pivy-tool -g $guid -a eccp256 generate 9e + elif [[ "$chuid" == "false" ]]; then + continue fi cak="$($bindir/pivy-tool -g $guid pubkey 9e)"