Skip to content

Commit 4f6bc8a

Browse files
authored
Merge pull request #433 from thaJeztah/wincred_inline
wincred: inline label, and append to existing
2 parents b0820e3 + 869b277 commit 4f6bc8a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

wincred/wincred.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ type Wincred struct{}
1616

1717
// Add adds new credentials to the windows credentials manager.
1818
func (h Wincred) Add(creds *credentials.Credentials) error {
19-
credsLabels := []byte(credentials.CredsLabel)
2019
g := winc.NewGenericCredential(creds.ServerURL)
2120
g.UserName = creds.Username
2221
g.CredentialBlob = []byte(creds.Secret)
2322
g.Persist = winc.PersistLocalMachine
24-
g.Attributes = []winc.CredentialAttribute{{Keyword: "label", Value: credsLabels}}
23+
g.Attributes = append(g.Attributes, winc.CredentialAttribute{
24+
Keyword: "label",
25+
Value: []byte(credentials.CredsLabel),
26+
})
2527

2628
return g.Write()
2729
}

0 commit comments

Comments
 (0)