Skip to content

Commit c47a76a

Browse files
author
Alex Wilson
committed
OSX package: init fresh new yubikeys properly
1 parent a567b07 commit c47a76a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

macosx/scripts/postinstall

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ while true; do
1111
/usr/bin/osascript -e 'display dialog "Please insert your YubiKey and press OK"'
1212

1313
# XXX: we just take the first one we see?
14-
while IFS=: read rdrname guid chuid ykpiv; do
14+
while IFS=: read rdrname guid chuid ykpiv _; do
1515
# check it's been set up with a CHUID
1616
if [[ "$chuid" == "false" && "$ykpiv" == "true" ]]; then
1717
# if it hasn't set up a basic one + 9e key so we can pin it.
1818
# the user can do the rest with pivy-tool later.
19-
$bindir/pivy-tool -g $guid init
19+
$bindir/pivy-tool -g 00000000 init
2020
# "init" changes the guid
21-
guid=$($bindir/pivy-tool list -p | \
21+
guid=$($bindir/pivy-tool -p list | \
2222
/usr/bin/grep "$rdrname" | /usr/bin/awk -F: '{print $2}')
2323
$bindir/pivy-tool -g $guid -a eccp256 generate 9e
24+
elif [[ "$chuid" == "false" ]]; then
25+
continue
2426
fi
2527
cak="$($bindir/pivy-tool -g $guid pubkey 9e)"
2628

0 commit comments

Comments
 (0)