Provide more specific error message when ed25519 private key is invalid

This commit is contained in:
Scott Kitterman
2021-11-24 15:37:06 -05:00
parent 9c8e46eb5c
commit 6dcaaac712
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -7,6 +7,8 @@ Version 1.1
with no DKIM signatures
- Update dnsplug for DNS Python (dns) 2.0 compatibility (LP: #1888583)
- Fix @param srv_id typos (LP: #1890532)
- Provide more specific error message when ed25519 private key is invalid
(See LP 1901569 for background)
2019-12-31 Version 1.0.2
- dknewkey: On posix operating systems set file permissions to 600 for
+2
View File
@@ -832,6 +832,8 @@ class DKIM(DomainSigner):
pk = nacl.signing.SigningKey(privkey, encoder=nacl.encoding.Base64Encoder)
except NameError:
raise NaClNotFoundError('pynacl module required for ed25519 signing, see README.md')
except nacl.exceptions.ValueError:
raise KeyFormatError('invalid ed25519 private key or format')
if identity is not None and not identity.endswith(domain):
raise ParameterError("identity must end with domain")