Skip to content

Commit

Permalink
fixup! Add first cut of git-credential-fdoss
Browse files Browse the repository at this point in the history
Reword issue with secret encoding and gnome-keyring's unencrypted
keyrings.

Addresses: #3 (comment)
  • Loading branch information
camh- committed Aug 27, 2024
1 parent 8fddfdf commit ff79adb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,16 @@ func makeAttrs(gc *GitCredential) map[string]string {
// The format for [encoding] multiple values is the same as used by
// git-credential-libsecret to be compatible with it.
//
// Note: This format is not compatible with the unencrypted keyring format of
// gnome-keyring as it does not escape the newlines when storing them in an
// ini-like file, and those newlines break the file (the extra fields added
// here appear as different values that do not get retrieved with the secret).
// This really should be fixed in gnome-keyring, but is not much of a concern
// as if you are going to store your passwords in plain text, you may as well
// use git-credential-store. However, one may want all their credentials
// together in one place stored in plain text for easier exploitation.
// Note: This encoding is not compatible with the unencrypted keyring format of
// gnome-keyring. Gnome-keyring does not escape the newlines in secrets when
// storing them in an unencrypted keyring, and those newlines appear as field
// separators in the keyring. When the secret is read back, it is only read
// back to the first newline, so we don't get back all that we stored.
//
// It would not be typical to be using unencrypted keyrings though as it mostly
// defeats the purpose of a secret manager. If one did not care about
// unencrypted storage of git credentials, git-credential-store (bundled with
// git) would make more sense than this credential helper.
//
// [encoding]: https://github.com/git/git/blob/159f2d50e75c17382c9f4eb7cbda671a6fa612d1/contrib/credential/libsecret/git-credential-libsecret.c#L212
func formatSecretVal(gc *GitCredential) string {
Expand Down

0 comments on commit ff79adb

Please sign in to comment.