diff --git a/main.go b/main.go index c4fb7a7..56b541f 100644 --- a/main.go +++ b/main.go @@ -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 {