mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
GODT-1986: Handle case where an address has no decryption entities
It's possible (but very rare, I don't think proton still allows it) for an address to have no keys. If we try to load the address keyring for such an address, this change logs a warning that no decryption entities were found in the unlocked keyring. It bumps liteapi to a version that does not return an error when no keys could be unlocked.
This commit is contained in:
@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gitlab.protontech.ch/go/liteapi"
|
||||
)
|
||||
|
||||
@ -56,6 +57,10 @@ func withAddrKRs(apiUser liteapi.User, apiAddr map[string]liteapi.Address, keyPa
|
||||
}
|
||||
defer addrKR.ClearPrivateParams()
|
||||
|
||||
if addrKR.CountDecryptionEntities() == 0 {
|
||||
logrus.WithField("addressID", addrID).Warn("Address keyring has no decryption entities")
|
||||
}
|
||||
|
||||
addrKRs[addrID] = addrKR
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user