protonmail: skip keys we can't read
Updates https://github.com/emersion/hydroxide/issues/46
This commit is contained in:
parent
fc1618d086
commit
ba96d886d8
|
@ -280,7 +280,8 @@ func (c *Client) Unlock(auth *Auth, passphrase string) (openpgp.EntityList, erro
|
||||||
for _, key := range addr.Keys {
|
for _, key := range addr.Keys {
|
||||||
entity, err := key.Entity()
|
entity, err := key.Entity()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to read key %q: %v", addr.Email, err)
|
log.Printf("warning: failed to read key %q: %v", addr.Email, err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
found := false
|
found := false
|
||||||
|
@ -303,6 +304,10 @@ func (c *Client) Unlock(auth *Auth, passphrase string) (openpgp.EntityList, erro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(keyRing) == 0 {
|
||||||
|
return nil, fmt.Errorf("failed to unlock any key")
|
||||||
|
}
|
||||||
|
|
||||||
return keyRing, nil
|
return keyRing, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue