mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 22:56:48 +00:00
GODT-1609: use byte array for password
This commit is contained in:
committed by
James Houlahan
parent
3b5f931f06
commit
b536b8707e
@ -30,7 +30,7 @@ type imapConnector struct {
|
||||
updateCh <-chan imap.Update
|
||||
|
||||
emails []string
|
||||
password string
|
||||
password []byte
|
||||
|
||||
flags, permFlags, attrs imap.FlagSet
|
||||
}
|
||||
@ -38,7 +38,7 @@ type imapConnector struct {
|
||||
func newIMAPConnector(
|
||||
client *liteapi.Client,
|
||||
updateCh <-chan imap.Update,
|
||||
password string,
|
||||
password []byte,
|
||||
emails ...string,
|
||||
) *imapConnector {
|
||||
return &imapConnector{
|
||||
@ -55,8 +55,8 @@ func newIMAPConnector(
|
||||
}
|
||||
|
||||
// Authorize returns whether the given username/password combination are valid for this connector.
|
||||
func (conn *imapConnector) Authorize(username string, password string) bool {
|
||||
if subtle.ConstantTimeCompare([]byte(conn.password), []byte(password)) != 1 {
|
||||
func (conn *imapConnector) Authorize(username string, password []byte) bool {
|
||||
if subtle.ConstantTimeCompare(conn.password, password) != 1 {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@ -205,8 +205,8 @@ func (user *User) GluonKey() []byte {
|
||||
}
|
||||
|
||||
// BridgePass returns the user's bridge password, used for authentication over SMTP and IMAP.
|
||||
func (user *User) BridgePass() string {
|
||||
return user.vault.BridgePass()
|
||||
func (user *User) BridgePass() []byte {
|
||||
return []byte(user.vault.BridgePass())
|
||||
}
|
||||
|
||||
// UsedSpace returns the total space used by the user on the API.
|
||||
|
||||
Reference in New Issue
Block a user