Exemplo n.º 1
0
 def test_should_verify_signature(self):
     image_props = {
         CERT_UUID: 'CERT_UUID',
         HASH_METHOD: 'HASH_METHOD',
         SIGNATURE: 'SIGNATURE',
         KEY_TYPE: 'SIG_KEY_TYPE'
     }
     self.assertTrue(signature_utils.should_verify_signature(image_props))
Exemplo n.º 2
0
    def test_should_verify_signature_fail(self):
        bad_image_properties = [{CERT_UUID: 'CERT_UUID',
                                 HASH_METHOD: 'HASH_METHOD',
                                 SIGNATURE: 'SIGNATURE'},
                                {CERT_UUID: 'CERT_UUID',
                                 HASH_METHOD: 'HASH_METHOD',
                                 KEY_TYPE: 'SIG_KEY_TYPE'},
                                {CERT_UUID: 'CERT_UUID',
                                 SIGNATURE: 'SIGNATURE',
                                 KEY_TYPE: 'SIG_KEY_TYPE'},
                                {HASH_METHOD: 'HASH_METHOD',
                                 SIGNATURE: 'SIGNATURE',
                                 KEY_TYPE: 'SIG_KEY_TYPE'}]

        for bad_props in bad_image_properties:
            result = signature_utils.should_verify_signature(bad_props)
            self.assertFalse(result)
Exemplo n.º 3
0
    def test_should_verify_signature_fail(self):
        bad_image_properties = [{
            CERT_UUID: 'CERT_UUID',
            HASH_METHOD: 'HASH_METHOD',
            SIGNATURE: 'SIGNATURE'
        }, {
            CERT_UUID: 'CERT_UUID',
            HASH_METHOD: 'HASH_METHOD',
            KEY_TYPE: 'SIG_KEY_TYPE'
        }, {
            CERT_UUID: 'CERT_UUID',
            SIGNATURE: 'SIGNATURE',
            KEY_TYPE: 'SIG_KEY_TYPE'
        }, {
            HASH_METHOD: 'HASH_METHOD',
            SIGNATURE: 'SIGNATURE',
            KEY_TYPE: 'SIG_KEY_TYPE'
        }]

        for bad_props in bad_image_properties:
            result = signature_utils.should_verify_signature(bad_props)
            self.assertFalse(result)
Exemplo n.º 4
0
 def test_should_verify_signature(self):
     image_props = {CERT_UUID: 'CERT_UUID',
                    HASH_METHOD: 'HASH_METHOD',
                    SIGNATURE: 'SIGNATURE',
                    KEY_TYPE: 'SIG_KEY_TYPE'}
     self.assertTrue(signature_utils.should_verify_signature(image_props))