convert of login items keeps original env names in fields; env now also exposes the login triple so sourced consumers can map to legacy names. Ticket: https://projects.knownelement.com/issues/832
This commit is contained in:
+14
-1
@@ -90,7 +90,8 @@ type PlainCipher struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
} `json:"login"`
|
||||
FolderID string `json:"folderId"`
|
||||
FolderID string `json:"folderId"`
|
||||
URIs []string `json:"uris"`
|
||||
}
|
||||
|
||||
// DecryptCipher converts a raw sync cipher into PlainCipher.
|
||||
@@ -132,6 +133,18 @@ func DecryptCipher(userKey []byte, raw []byte) (*PlainCipher, error) {
|
||||
if cr.Login.Password != nil {
|
||||
pc.Login.Password, _ = decStr(userKey, ck, cr.Login.Password)
|
||||
}
|
||||
for _, u := range cr.Login.URIs {
|
||||
var um map[string]any
|
||||
um, _ = u.(map[string]any)
|
||||
if um != nil {
|
||||
if us, ok := um["uri"].(string); ok {
|
||||
v, err := decStr(userKey, ck, &us)
|
||||
if err == nil {
|
||||
pc.URIs = append(pc.URIs, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return pc, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user