Beispiel #1
0
def instance_hook(service, input, instance, attrs):

    instance.username = service.cid # Required by model
    instance.info = get_tls_from_payload(input.value)

    with service.lock():
        full_path = store_tls(service.server.tls_dir, service.request.input.value)
        service.logger.info('CA certificate saved under `%s`', full_path)
Beispiel #2
0
def instance_hook(service, input, instance, attrs):

    instance.username = service.cid # Required by model
    instance.sec_type = SEC_DEF_TYPE.TLS_KEY_CERT
    instance.info = get_tls_from_payload(input.value, True)

    with service.lock():
        full_path = store_tls(service.server.tls_dir, service.request.input.value, True)
        service.logger.info('Key/cert pair saved under `%s`', full_path)
Beispiel #3
0
def instance_hook(service, input, instance, attrs):

    instance.username = service.cid  # Required by model
    instance.info = get_tls_from_payload(input.value)

    with service.lock():
        full_path = store_tls(service.server.tls_dir,
                              service.request.input.value)
        service.logger.info('CA certificate saved under `%s`', full_path)
Beispiel #4
0
def instance_hook(service, input, instance, attrs):

    instance.username = service.cid  # Required by model
    instance.sec_type = SEC_DEF_TYPE.TLS_KEY_CERT
    instance.info = get_tls_from_payload(input.value, True)

    with service.lock():
        full_path = store_tls(service.server.tls_dir,
                              service.request.input.value, True)
        service.logger.info('Key/cert pair saved under `%s`', full_path)
Beispiel #5
0
def instance_hook(self, input, instance, attrs):

    decrypted = self.server.decrypt(input.auth_data).encode('utf8')

    instance.username = self.cid  # Required by model
    instance.sec_type = SEC_DEF_TYPE.TLS_KEY_CERT
    instance.info = get_tls_from_payload(decrypted, True).encode('utf8')
    instance.auth_data = input.auth_data.encode('utf8')

    with self.lock():
        full_path = store_tls(self.server.tls_dir, decrypted, True)
        self.logger.info('Key/cert pair saved under `%s`', full_path)
Beispiel #6
0
 def test_validate_tls_cert_from_payload(self):
     info = util.get_tls_from_payload(ca_cert)
     self.assertEquals(info, 'C=AU; CN=CA2')
Beispiel #7
0
 def test_validate_tls_cert_from_payload(self):
     info = util.get_tls_from_payload(ca_cert)
     self.assertEquals(info, 'C=AU; CN=CA2')