Commit 144020f6 authored by Sam Rushing's avatar Sam Rushing

fleshing out authenticator interface

parent e47be476
...@@ -32,8 +32,11 @@ OekNfzzIBr6QkMvmIOuL ...@@ -32,8 +32,11 @@ OekNfzzIBr6QkMvmIOuL
-----END DSA PRIVATE KEY----- -----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() 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(): def usage():
print 'test_coro_server [-p port]' print 'test_coro_server [-p port]'
...@@ -68,11 +71,11 @@ def go (conn, addr): ...@@ -68,11 +71,11 @@ def go (conn, addr):
debug = coro.ssh.util.debug.Debug() debug = coro.ssh.util.debug.Debug()
debug.level = coro.ssh.util.debug.DEBUG_3 debug.level = coro.ssh.util.debug.DEBUG_3
transport = coro.ssh.l4_transport.coro_socket_transport.coro_socket_transport(sock=conn) 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 = coro.ssh.transport.server.SSH_Server_Transport (server_key_ob, debug=debug)
server.connect (transport) pubkey_auth = coro.ssh.auth.userauth.Public_Key_Authenticator ({'rushing': { 'ssh-connection' : [user_key_ob]}})
W ('after server.connect()\n') authenticator = coro.ssh.auth.userauth.Authenticator (server, [pubkey_auth])
service = coro.ssh.connection.connect.Connection_Service(server) server.connect (transport, authenticator)
W ('service=%r\n' % (service,)) service = coro.ssh.connection.connect.Connection_Service (server)
W ('sleeping...\n') W ('sleeping...\n')
coro.sleep_relative (1000) coro.sleep_relative (1000)
......
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