Merge pull request #180 from ProtonMail/keygen-no-name
Do not return error on empty name or email key generation
This commit is contained in:
commit
74905cd51f
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
|
||||
- `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
|
||||
|
||||
|
|
|
|||
|
|
@ -438,12 +438,8 @@ func generateKey(
|
|||
bits int,
|
||||
prime1, prime2, prime3, prime4 []byte,
|
||||
) (*Key, error) {
|
||||
if len(email) == 0 {
|
||||
return nil, errors.New("gopenpgp: invalid email format")
|
||||
}
|
||||
|
||||
if len(name) == 0 {
|
||||
return nil, errors.New("gopenpgp: invalid name format")
|
||||
if len(email) == 0 && len(name) == 0 {
|
||||
return nil, errors.New("gopenpgp: neither name nor email set.")
|
||||
}
|
||||
|
||||
comments := ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue