mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2026-02-04 08:18:34 +00:00
fix: correctly handle failure to unlock single key
This commit is contained in:
@ -8,7 +8,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* GODT-360 Detect charset embedded in html/xml.
|
* GODT-360 Detect charset embedded in html/xml.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* GODT-354 Do not label/unlabel messsages from `All Mail` folder
|
* GODT-354 Do not label/unlabel messsages from `All Mail` folder.
|
||||||
* GODT-388 Support for both bridge and import/export credentials by package users.
|
* GODT-388 Support for both bridge and import/export credentials by package users.
|
||||||
* GODT-387 Store factory to make store optional.
|
* GODT-387 Store factory to make store optional.
|
||||||
* GODT-386 Renamed bridge to general users and keep bridge only for bridge stuff.
|
* GODT-386 Renamed bridge to general users and keep bridge only for bridge stuff.
|
||||||
@ -19,6 +19,9 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* `Unlock()` call on pmapi-client unlocks both User keys and Address keys.
|
* `Unlock()` call on pmapi-client unlocks both User keys and Address keys.
|
||||||
* Salt is available via `AuthSalt()` method.
|
* Salt is available via `AuthSalt()` method.
|
||||||
* GODT-394 Don't check SMTP message send time in integration tests.
|
* GODT-394 Don't check SMTP message send time in integration tests.
|
||||||
|
* GODT-280 Migrate to gopenpgp v2.
|
||||||
|
* `Unlock()` call on pmapi-client unlocks both User keys and Address keys.
|
||||||
|
* Salt is available via `AuthSalt()` method.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* GODT-356 Fix crash when removing account while mail client is fetching messages (regression from GODT-204).
|
* GODT-356 Fix crash when removing account while mail client is fetching messages (regression from GODT-204).
|
||||||
@ -35,6 +38,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
|||||||
* GODT-404 Don't keep connections to proxy servers alive if user disables DoH.
|
* GODT-404 Don't keep connections to proxy servers alive if user disables DoH.
|
||||||
* Ensure DoH is used at startup to load users for the initial auth.
|
* Ensure DoH is used at startup to load users for the initial auth.
|
||||||
* Issue causing deadlock when reloading users keys due to double-locking of a mutex.
|
* Issue causing deadlock when reloading users keys due to double-locking of a mutex.
|
||||||
|
* Correctly handle failure to unlock single key.
|
||||||
|
|
||||||
## [v1.2.7] Donghai-hotfix - beta (2020-05-07)
|
## [v1.2.7] Donghai-hotfix - beta (2020-05-07)
|
||||||
|
|
||||||
|
|||||||
1
go.sum
1
go.sum
@ -188,6 +188,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
|
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA=
|
||||||
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
|
|||||||
@ -142,15 +142,14 @@ func (keys *PMKeys) UnlockAll(passphrase []byte, userKey *crypto.KeyRing) (kr *c
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var k *crypto.Key
|
k, unlockErr := key.unlock(secret)
|
||||||
|
if unlockErr != nil {
|
||||||
if k, err = key.unlock(secret); err != nil {
|
logrus.WithError(unlockErr).WithField("fingerprint", key.Fingerprint).Warn("Failed to unlock key")
|
||||||
logrus.WithError(err).Warn("Failed to unlock key")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = kr.AddKey(k); err != nil {
|
if addKeyErr := kr.AddKey(k); addKeyErr != nil {
|
||||||
logrus.WithError(err).Warn("Failed to add key to keyring")
|
logrus.WithError(addKeyErr).Warn("Failed to add key to keyring")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user