Provide more specific error message when ed25519 private key is invalid
This commit is contained in:
@@ -7,6 +7,8 @@ Version 1.1
|
|||||||
with no DKIM signatures
|
with no DKIM signatures
|
||||||
- Update dnsplug for DNS Python (dns) 2.0 compatibility (LP: #1888583)
|
- Update dnsplug for DNS Python (dns) 2.0 compatibility (LP: #1888583)
|
||||||
- Fix @param srv_id typos (LP: #1890532)
|
- 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
|
2019-12-31 Version 1.0.2
|
||||||
- dknewkey: On posix operating systems set file permissions to 600 for
|
- dknewkey: On posix operating systems set file permissions to 600 for
|
||||||
|
|||||||
@@ -832,6 +832,8 @@ class DKIM(DomainSigner):
|
|||||||
pk = nacl.signing.SigningKey(privkey, encoder=nacl.encoding.Base64Encoder)
|
pk = nacl.signing.SigningKey(privkey, encoder=nacl.encoding.Base64Encoder)
|
||||||
except NameError:
|
except NameError:
|
||||||
raise NaClNotFoundError('pynacl module required for ed25519 signing, see README.md')
|
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):
|
if identity is not None and not identity.endswith(domain):
|
||||||
raise ParameterError("identity must end with domain")
|
raise ParameterError("identity must end with domain")
|
||||||
|
|||||||
Reference in New Issue
Block a user