Commit eb1e743e authored by Brandon Smith's avatar Brandon Smith

Print a message about interacting with U2F token

parent 3cfa8da6
......@@ -147,7 +147,10 @@ class Authenticator(object):
----- BEGIN U2F CHALLENGE -----
%s
%s
----- END U2F CHALLENGE -----""" % (self.URL, json.dumps(attributes["u2fSignRequest"]))
%s
----- END U2F CHALLENGE -----""" % (self.URL,
json.dumps(attributes["u2fSignRequest"]),
str(detail.get("message", "")))
if transaction_id:
if challenge:
rval = self.challenge_response(transaction_id,
......
......@@ -69,7 +69,9 @@ while True:
elif index == 1:
u2f_origin = ssh.readline().strip()
u2f_challenge = ssh.readline().strip()
ssh.expect("----- END U2F CHALLENGE -----")
ssh.expect("(.*)----- END U2F CHALLENGE -----")
message = ssh.match.group(1).strip()
print(message or "Interact with your U2F token.")
p = subprocess.Popen(["u2f-host", "-aauthenticate", "-o", u2f_origin],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
out, err = p.communicate(u2f_challenge)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment