as requested

main
Florent Daigniere 2 years ago committed by GitHub
parent b553d025eb
commit c565e69a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -609,8 +609,8 @@ class DkimKeyField(fields.String):
# check key validity
try:
serialization.load_pem_private_key(value, password=None)
except crypto.Error as exc:
serialization.load_pem_private_key(bytes(value, "ascii"), password=None)
except (UnicodeEncodeError, ValueError) as exc:
raise ValidationError(f'invalid dkim key {bad_key!r}') from exc
else:
return value

Loading…
Cancel
Save