Beispiel #1
0
    def trust(self, certificate, peer):
        """
        Add the certificate to the SSL Known Hosts in the Configuration file, so we will
        always trust this host in future.
        """

        Configuration.set("ssl-known-hosts", "%s|%d" % peer, self.digest(certificate))
Beispiel #2
0
 def enable(cls, path):
     """
     Re-add a andsploit Module Repository to the collection, that was created manually
     or has previously been removed with #disable().
     """
     
     if cls.looks_like_repo(path):
         Configuration.set('repositories', path, path)
     else:
         raise UnknownRepository(path)
Beispiel #3
0
 def create(cls, url):
     """
     Create a new andsploit remote, with the specified URL.
     
     If the URL already exists, no remote will be created.
     """
     
     if cls.get(url) == None:
         Configuration.set('remotes', url, url)
         
         return True
     else:
         return False
Beispiel #4
0
    def provision(self, path):
        """
        Provision new CA Key Material.
        
        This will overwrite any existing CA.
        """

        self.authority.create_ca()

        Configuration.set("ssl", "ca_path", path)

        fs.write(self.ca_certificate_path(), ca.CA.certificate_to_pem(self.authority.ca_cert))
        fs.write(self.__ca_key_path(), ca.CA.pkey_to_pem(self.authority.ca_key))

        return True