Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
shrapnel
Commits
144020f6
Commit
144020f6
authored
May 08, 2013
by
Sam Rushing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fleshing out authenticator interface
parent
e47be476
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
coro/ssh/test/test_coro_server.py
coro/ssh/test/test_coro_server.py
+9
-6
No files found.
coro/ssh/test/test_coro_server.py
View file @
144020f6
...
...
@@ -32,8 +32,11 @@ OekNfzzIBr6QkMvmIOuL
-----END DSA PRIVATE KEY-----
"""
user_key_pub
=
"""ssh-dss AAAAB3NzaC1kc3MAAACBAPawYoOY758V46mBep5i3pRQSuXnmYLiwBWH06NMXfMKkncZE4eWIVVoDqZmeMfCSHP8uY2gS+QDfdMCGtqu9sX8noPx5SG6gzUnadhFKU2+o7tbJ9WkQX7TPHB2GLBk5SNn6MFfLlLwlLv+OFnO0jcBD81fkCZp19BoZt1CCMGLAAAAFQCCSKBZHEoXw7Y1jiT0GFuqGgPMaQAAAIB2EjHBcrMa6jvmNI1DLYEHrYlQ30cDvnYYIyunMsp6SybE1sLN2W3UqGLjqB2i3FgWh7o1yUVWdImBvFz4kdYVhlEcYUeTgu8IWH2YNFcr7/Q4IpF9h20pu/ASuR9aK/D8sA4s7JqVfkS/mIaOZ8W2aZiOSaqvJXQPee9tiKgLDAAAAIEA6jTTFwh0wBlLdzALSaxf+A4IPGwE3mlmVmzt+A+a+EqL2ZRmAZ2puQH3NKckqrAlHDY7gGuF5XlHUTiTbVanuv6vCRlPwHWCPNNZhYFqGLpMEqRNPV2cMlU0gaPn69DMZwbDNCJghZI6C2uejoh3agHvHq8jgm9q4e3X3nEjStc= rushing@beast.local
\
n
"""
ks
=
OpenSSH_Key_Storage
()
dss_obj
=
ks
.
parse_private_key
(
server_key_pri
)
server_key_ob
=
ks
.
parse_private_key
(
server_key_pri
)
user_key_ob
=
ks
.
parse_public_key
(
user_key_pub
)
def
usage
():
print
'test_coro_server [-p port]'
...
...
@@ -68,11 +71,11 @@ def go (conn, addr):
debug
=
coro
.
ssh
.
util
.
debug
.
Debug
()
debug
.
level
=
coro
.
ssh
.
util
.
debug
.
DEBUG_3
transport
=
coro
.
ssh
.
l4_transport
.
coro_socket_transport
.
coro_socket_transport
(
sock
=
conn
)
server
=
coro
.
ssh
.
transport
.
server
.
SSH_Server_Transport
(
dss_obj
,
debug
=
debug
)
server
.
connect
(
transport
)
W
(
'after server.connect()
\
n
'
)
serv
ice
=
coro
.
ssh
.
connection
.
connect
.
Connection_Service
(
serve
r
)
W
(
'service=%r
\
n
'
%
(
service
,)
)
server
=
coro
.
ssh
.
transport
.
server
.
SSH_Server_Transport
(
server_key_ob
,
debug
=
debug
)
pubkey_auth
=
coro
.
ssh
.
auth
.
userauth
.
Public_Key_Authenticator
({
'rushing'
:
{
'ssh-connection'
:
[
user_key_ob
]}}
)
authenticator
=
coro
.
ssh
.
auth
.
userauth
.
Authenticator
(
server
,
[
pubkey_auth
])
serv
er
.
connect
(
transport
,
authenticato
r
)
service
=
coro
.
ssh
.
connection
.
connect
.
Connection_Service
(
server
)
W
(
'sleeping...
\
n
'
)
coro
.
sleep_relative
(
1000
)
...
...
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