Exemplo n.º 1
0
Arquivo: pbp.py Projeto: fpletz/pbp
def mpecdh_end_handler(id, self, infile = None, outfile = None, basedir = None):
    ctx = ecdh.MPECDH(id, me = self, basedir = basedir)
    ctx.load()
    keychain = ctx.mpecdh2(ecdh.load_dh_keychain(infile))
    if keychain:
        ecdh.save_dh_keychain(outfile, keychain)
    return ctx.secret
Exemplo n.º 2
0
def mpecdh_end_handler(id, self, infile=None, outfile=None, basedir=None):
    ctx = ecdh.MPECDH(id, me=self, basedir=basedir)
    ctx.load()
    keychain = ctx.mpecdh2(ecdh.load_dh_keychain(infile))
    if keychain:
        ecdh.save_dh_keychain(outfile, keychain)
    return ctx.secret
Exemplo n.º 3
0
Arquivo: pbp.py Projeto: fpletz/pbp
def mpecdh_start_handler(id, peer_count, self, infile = None, outfile = None, basedir = None):
    ctx = ecdh.MPECDH(id, peers = peer_count, me = self, basedir = basedir)
    keychain = ctx.mpecdh1(ecdh.load_dh_keychain(infile))
    if not hasattr(ctx,'secret'):
        ctx.save()
    clearmem(ctx.key)
    ctx.key=None
    ecdh.save_dh_keychain(outfile, keychain)
    if hasattr(ctx,'secret'):
        return ctx.secret
Exemplo n.º 4
0
def mpecdh_start_handler(id,
                         peer_count,
                         self,
                         infile=None,
                         outfile=None,
                         basedir=None):
    ctx = ecdh.MPECDH(id, peers=peer_count, me=self, basedir=basedir)
    keychain = ctx.mpecdh1(ecdh.load_dh_keychain(infile))
    if not hasattr(ctx, 'secret'):
        ctx.save()
    clearmem(ctx.key)
    ctx.key = None
    ecdh.save_dh_keychain(outfile, keychain)
    if hasattr(ctx, 'secret'):
        return ctx.secret