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 # check key validity
try: try:
serialization.load_pem_private_key(value, password=None) serialization.load_pem_private_key(bytes(value, "ascii"), password=None)
except crypto.Error as exc: except (UnicodeEncodeError, ValueError) as exc:
raise ValidationError(f'invalid dkim key {bad_key!r}') from exc raise ValidationError(f'invalid dkim key {bad_key!r}') from exc
else: else:
return value return value

Loading…
Cancel
Save