Make sure to iterate over a copy of the public_keys dictionary

This commit is contained in:
Joseph Schorr 2016-06-07 18:20:42 -04:00
parent f75949d533
commit 71b2853f40

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)