Do not return error on empty name or email key generation
This commit is contained in:
parent
b601b54c1f
commit
f5803d148d
2 changed files with 3 additions and 6 deletions
|
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- `DecryptMIMEMessage` will return the decrypted content in the `OnBody` callback, even when there's a signature verification error. That lets the caller decide whether they want to use the content with a warning or hard fail on signature errors.
|
- `DecryptMIMEMessage` will return the decrypted content in the `OnBody` callback, even when there's a signature verification error. That lets the caller decide whether they want to use the content with a warning or hard fail on signature errors.
|
||||||
|
- Key generation functions no longer return an error if either the name or email is empty
|
||||||
|
|
||||||
## [2.4.6] 2022-03-25
|
## [2.4.6] 2022-03-25
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -438,12 +438,8 @@ func generateKey(
|
||||||
bits int,
|
bits int,
|
||||||
prime1, prime2, prime3, prime4 []byte,
|
prime1, prime2, prime3, prime4 []byte,
|
||||||
) (*Key, error) {
|
) (*Key, error) {
|
||||||
if len(email) == 0 {
|
if len(email) == 0 && len(name) == 0 {
|
||||||
return nil, errors.New("gopenpgp: invalid email format")
|
return nil, errors.New("gopenpgp: neither name nor email set.")
|
||||||
}
|
|
||||||
|
|
||||||
if len(name) == 0 {
|
|
||||||
return nil, errors.New("gopenpgp: invalid name format")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
comments := ""
|
comments := ""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue