Merge "Fix argument reversal error in pkek cache"

This commit is contained in:
Jenkins 2016-01-14 16:42:20 +00:00 committed by Gerrit Code Review
commit 715eb91ae2
2 changed files with 1 additions and 9 deletions

View File

@ -289,7 +289,7 @@ class P11CryptoPlugin(plugin.CryptoPluginBase):
kek = self.pkcs11.unwrap_key(mkek, iv, wrapped_key,
session)
self._pkek_cache_add(key_label, kek)
self._pkek_cache_add(kek, key_label)
return kek

View File

@ -204,14 +204,6 @@ class WhenTestingP11CryptoPlugin(utils.BaseTestCase):
def test_cached_kek_expired(self):
self.plugin.pkek_cache['expired_kek'] = p11_crypto.CachedKEK(4, 0)
kek_meta = mock.MagicMock()
kek_meta.kek_label = 'expired_kek'
kek_meta.plugin_meta = ('{"iv": "iv==",'
'"hmac": "hmac",'
'"wrapped_key": "wrappedkey==",'
'"mkek_label": "mkek_label",'
'"hmac_label": "hmac_label"}')
self.plugin._load_kek_from_meta_dto(kek_meta)
self.assertEqual(self.plugin._pkek_cache_get('expired_kek'), None)
def test_generate_mkek(self):