Beispiel #1
0
    def setup(self):
        """Create the secret pass phrase if it wasn't provided, compute the stream hash,
        save the stream to the stream info manager, and return the stream hash
        """
        if self.secret_pass_phrase is None:
            self.secret_pass_phrase = Random.new().read(512)

        d = CryptStreamCreator.setup(self)

        def make_stream_hash():
            hashsum = get_lbry_hash_obj()
            hashsum.update(binascii.hexlify(self.name))
            hashsum.update(get_pub_key(self.secret_pass_phrase))
            hashsum.update(binascii.hexlify(self.key))
            self.stream_hash = hashsum.hexdigest()
            return self.stream_hash

        d.addCallback(lambda _: make_stream_hash())
        d.addCallback(lambda _: self._save_stream())
        d.addCallback(lambda _: self.stream_hash)
        return d
Beispiel #2
0
    def setup(self):
        """Create the secret pass phrase if it wasn't provided, compute the stream hash,
        save the stream to the stream info manager, and return the stream hash
        """
        if self.secret_pass_phrase is None:
            self.secret_pass_phrase = Random.new().read(512)

        d = CryptStreamCreator.setup(self)

        def make_stream_hash():
            hashsum = get_lbry_hash_obj()
            hashsum.update(binascii.hexlify(self.name))
            hashsum.update(get_pub_key(self.secret_pass_phrase))
            hashsum.update(binascii.hexlify(self.key))
            self.stream_hash = hashsum.hexdigest()
            return self.stream_hash

        d.addCallback(lambda _: make_stream_hash())
        d.addCallback(lambda _: self._save_stream())
        d.addCallback(lambda _: self.stream_hash)
        return d
Beispiel #3
0
 def setup(self):
     d = CryptStreamCreator.setup(self)
     return d
Beispiel #4
0
 def setup(self):
     d = CryptStreamCreator.setup(self)
     return d
Beispiel #5
0
    def setup(self):
        d = CryptStreamCreator.setup(self)
        d.addCallback(lambda _: self.stream_hash)

        return d