fix token ask for PIN, if available

This commit is contained in:
Jakobus Schürz 2021-07-07 15:45:29 +02:00
parent 7ca1143c4b
commit 2b97122a66

View file

@ -834,12 +834,14 @@ token(){
[ -z "${P11M+x}" ] && { P11M=/usr/lib64/p11-kit-proxy.so; export P11M; }
tmppubkey="${XDG_RUNTIME_DIR}/token.pub"
loginfo "$(ssh-keygen -D $P11M >$tmppubkey)"
# Usage:
# token <identity> will load token in agent. does nothing, if token is already loaded
# token -r|-f|--reload-token <identity> will remove token from agent and add it again (if plugged off and plugged in again
# startagent -t $@
# loadagent $@
loginfo "$(ssh-add -s $P11M || { ssh-add -e $P11M; ssh-add -s $P11M; } )"
loginfo "$(ssh-add -T ${tmppubkey} || { ssh-add -e $P11M; ssh-add -s $P11M; } )"
loginfo "$(ssh-add -l)"
}