示例#1
0
def login(args):
    args.serverport = BAR0_PORT
    args.bar0 = BAR0
    args.service = "LogIn"
    #args.listenport = 0
    baseS = baseService()

    #Put an exception somewhere here!
    if not args.nym:
        args.nym = baseS.read_file(
            baseS.dirc(__file__, "../keys", "/pseudonym"))

    if not args.pk:
        args.pk = baseS.read_file(
            baseS.dirc(__file__, "../keys", "/public_key.pem"))
    else:
        args.pk = baseS.read_file(args.pk.name)

    if not args.proxyport:
        print "You need to specify a proxyport  with --proxyport. Aborting..."
        return

    if not args.delaymessage:
        args.delaymessage = 5

    #if not args.listenport:
    #    print "You need to specify a listener port for CLient to CLiet communication. Aborting..."
    #    return
    help(args.service)
    login_service(args)
示例#2
0
文件: LogIn.py 项目: d-elz/bar_tunnel
def login_conn(data_to_send, login_args):
    d = defer.Deferred()
    d.addCallback(
        bar_server_conn
    )  # put the bar_server_conn function to a callback ,which will run when the data is ready when the BAR0 response with the IP:port combination
    base = baseService()
    factory = ClientToBar0Factory(data_to_send, d, login_args)
    base.TLS_TOR_conn(login_args.bar0, login_args.serverport).connect(factory)
示例#3
0
def exchange_key(args):
    '''

    '''
    args.service = "ExchangeKey"
    args.serverport = BAR0_PORT
    args.bar0 = BAR0
    baseS = baseService()

    if not args.nym:
        args.nym = baseS.read_file(
            baseS.dirc(__file__, "../keys", "/pseudonym"))

    if not args.fnym:
        print "You need to specify a public key path file with --pk. Aborting..."
        return
    help(args.service)
    exchange_key_service(args)
示例#4
0
def register_conn(data_to_send,register_args):
    base= baseService()
    factory = ClientToBar0Factory(data_to_send,"empty_defer","") # without a defer
    base.TLS_TOR_conn(register_args.bar0,register_args.serverport).connect(factory)
示例#5
0
def exchange_key_conn(data_to_send,exchange_args):
    base= baseService()
    factory = ClientToBar0Factory(data_to_send,"empty_defer","") # without a defer
    base.TLS_TOR_conn(exchange_args.bar0,exchange_args.serverport).connect(factory)