Merge pull request #1527 from coreos-inc/defensive-copying

Make sure to iterate over a copy of the public_keys dictionary
This commit is contained in:
josephschorr 2016-06-07 18:22:28 -04:00
commit 53115b9109

View file

@ -26,7 +26,7 @@ class InstanceKeys(object):
keys[key.kid] = ExpiresEntry(key, key.expiration_date)
# Remove any expired or deleted keys from the public keys cache.
for key in self.public_keys:
for key in dict(self.public_keys):
if key not in keys:
self.public_keys.pop(key)