only tell user to touch when mode is enabled

Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
This commit is contained in:
David Lawrence 2015-11-10 12:59:29 -08:00
parent b0354762d1
commit 8ffbf116cc
1 changed files with 4 additions and 2 deletions

View File

@ -343,8 +343,10 @@ func sign(ctx *pkcs11.Ctx, session pkcs11.SessionHandle, pkcs11KeyID []byte, pas
// Get the SHA256 of the payload
digest := sha256.Sum256(payload)
touchToSignUI()
defer touchDoneCallback()
if (yubikeyKeymode & KeymodeTouch) > 0 {
touchToSignUI()
defer touchDoneCallback()
}
sig, err = ctx.Sign(session, digest[:])
if err != nil {
logrus.Debugf("Error while signing: %s", err)