forked from Silverfish/proton-bridge
fix: hang when reloading keys
This commit is contained in:
@ -34,6 +34,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
||||
* GODT-422 Fix element not found (avoid listing credentials, prefer getting).
|
||||
* 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.
|
||||
* Issue causing deadlock when reloading users keys due to double-locking of a mutex.
|
||||
|
||||
## [v1.2.7] Donghai-hotfix - beta (2020-05-07)
|
||||
|
||||
|
||||
@ -154,6 +154,12 @@ func (c *client) Unlock(passphrase []byte) (err error) {
|
||||
c.keyRingLock.Lock()
|
||||
defer c.keyRingLock.Unlock()
|
||||
|
||||
return c.unlock(passphrase)
|
||||
}
|
||||
|
||||
// unlock unlocks the user's keys but without locking the keyring lock first.
|
||||
// Should only be used internally by methods that first lock the lock.
|
||||
func (c *client) unlock(passphrase []byte) (err error) {
|
||||
if _, err = c.CurrentUser(); err != nil {
|
||||
return
|
||||
}
|
||||
@ -181,7 +187,7 @@ func (c *client) ReloadKeys(passphrase []byte) (err error) {
|
||||
|
||||
c.clearKeys()
|
||||
|
||||
return c.Unlock(passphrase)
|
||||
return c.unlock(passphrase)
|
||||
}
|
||||
|
||||
func (c *client) clearKeys() {
|
||||
|
||||
Reference in New Issue
Block a user