Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-module-privacyidea-pam
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eugene Omelyanovich
python-module-privacyidea-pam
Commits
333b89eb
Commit
333b89eb
authored
Mar 03, 2016
by
Brandon Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support privacyIDEA as primary auth
parent
e25b7f44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
ssh-u2f.py
ssh-u2f.py
+8
-15
No files found.
ssh-u2f.py
View file @
333b89eb
...
...
@@ -73,31 +73,24 @@ def passthrough():
pass
sys
.
exit
(
0
)
index
=
ssh
.
expect
([
"Authenticated with partial success."
,
"[^
\r\n
]+"
,
pexpect
.
EOF
])
if
index
==
0
:
print
(
ssh
.
match
.
group
())
elif
index
==
1
:
passthrough
()
elif
index
==
2
:
sys
.
exit
(
0
)
while
True
:
index
=
ssh
.
expect
([
"Enter additional factors: "
,
index
=
ssh
.
expect
([
"Authenticated with partial success."
,
"Enter additional factors: "
,
"----- BEGIN U2F CHALLENGE -----
\r\n
"
,
"[^
\r\n
]+"
,
pexpect
.
EOF
])
if
index
==
0
:
print
(
ssh
.
match
.
group
())
if
index
==
1
:
try
:
pin
=
getpass
.
getpass
(
ssh
.
match
.
group
())
except
EOFError
:
pin
=
""
ssh
.
sendline
(
pin
.
strip
())
elif
index
==
1
:
elif
index
==
2
:
u2f_origin
=
ssh
.
readline
()
.
strip
()
u2f_challenge
=
ssh
.
readline
()
.
strip
()
ssh
.
expect
(
"(.*)----- END U2F CHALLENGE -----"
)
...
...
@@ -109,8 +102,8 @@ while True:
p
.
wait
()
ssh
.
sendline
(
out
.
strip
())
elif
index
==
2
:
elif
index
==
3
:
passthrough
()
elif
index
==
3
:
elif
index
==
4
:
sys
.
exit
(
0
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment