def addInvite(self):
        pf = input("Load invite from Paste or File [P/f]? ")
        if pf == 'f':
            filename = input("Load invite from filename: ").strip()
            f = open(filename, 'rb')
            data = f.read()
            f.close()
        else:
            data = decode(input("Past invite: "))

        passwd = input("Decrypt invite with password: "******"Name for this endpoint: ")
        try:
            entry = self.book[name]
        except:
            entry = {}
        entry['pubkey'] = encode(packet.pubkey)
        entry['tracker'] = encodeAddress((invite.ip, invite.port))
        self.book[name] = entry

        self.commandDone.set()

        return entry
Exemple #2
0
  def addInvite(self):
    pf=input("Load invite from Paste or File [P/f]? ")
    if pf=='f':
      filename=input("Load invite from filename: ").strip()
      f=open(filename, 'rb')
      data=f.read()
      f.close()
    else:
      data=decode(input("Past invite: "))

    passwd=input("Decrypt invite with password: "******"Name for this endpoint: ")
    try:
      entry=self.book[name]
    except:
      entry={}
    entry['pubkey']=encode(packet.pubkey)
    entry['tracker']=encodeAddress((invite.ip, invite.port))
    self.book[name]=entry

    self.commandDone.set()

    return entry
Exemple #3
0
 def generate(self, pubkey, v6, tcp, port, number, entropy):
   invites=[]
   for x in range(number+1):
     i=InviteMessage()
     i.generate(pubkey, v6, tcp, port, entropy)
     invites.append(i)
     self.addInvite(i)
   return invites
 def generate(self, pubkey, v6, tcp, port, number, entropy):
     invites = []
     for x in range(number + 1):
         i = InviteMessage()
         i.generate(pubkey, v6, tcp, port, entropy)
         invites.append(i)
         self.addInvite(i)
     return invites
  def putInviteForPeer(self, addr, invite):
    print('putInviteForPeer!!! '+str(addr)+' '+str(invite))
    i=InviteMessage()
    i.decodeInviteMessage(decode(invite))
    self.keys.outgoingInvites.addInvite(i)
    if self.keys.outgoingFilename:
      self.keys.saveOutgoingInvites(self.keys.outgoingFilename, self.keys.invitePassword)

    callback=self.callbacks[addr]
    callback(addr, i)
Exemple #6
0
    def putInviteForPeer(self, addr, invite):
        print("putInviteForPeer!!! " + str(addr) + " " + str(invite))
        i = InviteMessage()
        i.decodeInviteMessage(decode(invite))
        self.keys.outgoingInvites.addInvite(i)
        if self.keys.outgoingFilename:
            self.keys.saveOutgoingInvites(self.keys.outgoingFilename, self.keys.invitePassword)

        callback = self.callbacks[addr]
        callback(addr, i)
keys.loadOutgoingInvites('config/outgoing_invites.ip')
endpoint = keys.loadEndpoint(os.path.expanduser('~/.dust/endpoint.yaml'))

pf = input("Load invite from Paste or File [P/f]? ")
if pf == 'f':
    filename = input("Load invite from filename: ").strip()
    f = open(filename, 'rb')
    data = f.read()
    f.close()
else:
    data = decode(input("Past invite: "))

passwd = input("Decrypt invite with password: "******"pubkey: " + encode(packet.pubkey))
print("invite: " + encode(packet.invite))
invite = InviteMessage()
invite.decodeInviteMessage(packet.invite)
keys.addInvite(invite)

name = input("Name for this endpoint: ")
book = YamlMap('config/dustmail-addressbook.yaml')
try:
    entry = book[name]
except:
    entry = {}
entry['pubkey'] = encode(packet.pubkey)
entry['tracker'] = encodeAddress((invite.ip, invite.port))
book[name] = entry
Exemple #8
0
keys.loadOutgoingInvites('config/outgoing_invites.ip')
endpoint=keys.loadEndpoint(os.path.expanduser('~/.dust/endpoint.yaml'))

pf=input("Load invite from Paste or File [P/f]? ")
if pf=='f':
  filename=input("Load invite from filename: ").strip()
  f=open(filename, 'rb')
  data=f.read()
  f.close()
else:
  data=decode(input("Past invite: "))

passwd=input("Decrypt invite with password: "******"pubkey: "+encode(packet.pubkey))
print("invite: "+encode(packet.invite))
invite=InviteMessage()
invite.decodeInviteMessage(packet.invite)
keys.addInvite(invite)

name=input("Name for this endpoint: ")
book=YamlMap('config/dustmail-addressbook.yaml')
try:
  entry=book[name]
except:
  entry={}
entry['pubkey']=encode(packet.pubkey)
entry['tracker']=encodeAddress((invite.ip, invite.port))
book[name]=entry