Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/commands/config: do not show private key on local network #2957

Merged
merged 9 commits into from
Jul 16, 2016

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented Jul 10, 2016

@@ -58,6 +58,14 @@ Set the value of the 'datastore.path' key:
args := req.Arguments()
key := args[0]

// This is a temporary fix until we move the private key out of the config file
switch key {
case "Identity", "Identity.PrivKey":
Copy link
Member

@jbenet jbenet Jul 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • may be lowercased.
  • can just deny all of identity
if strings.HasPrefix(strings.ToLower(key), "identity")  {
  • addressed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbenet you cant look it up by the lowercase key, but we can add that to the permissions check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ipfs config Identity.PeerID is a valid usecase.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
and replacing config.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
@whyrusleeping
Copy link
Member

@lgierth if you could review and give a LGTM here that would be great

@whyrusleeping whyrusleeping assigned ghost Jul 14, 2016
err := r.SetConfigKey(key, value)
keyF, err := getConfig(r, "Identity.PrivKey")
if err != nil {
return nil, fmt.Errorf("Failed to get PrivKey")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower case failed

Kubuxu and others added 3 commits July 14, 2016 13:57
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
@whyrusleeping whyrusleeping merged commit 0dd04fe into master Jul 16, 2016
@whyrusleeping whyrusleeping deleted the patch-1 branch July 16, 2016 11:15
return
}

delete(idmap, "PrivKey")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • this wont work if the map has privkey. this should be case insensitive.
  • i know this comes from our own structs, so it should be capitalized.
  • but all someone has to do is change the capitalization to Privkey there.
  • come to think of it, this should be either:
    • a constant there, in that file where the struct is
    • or derived from the struct using reflection, to be very damn sure that doesn't get changed around these checks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also loop the map, compare keys to privkey case insensitive and remove that. SGTY?

@Kubuxu Kubuxu assigned Kubuxu and unassigned ghost Aug 28, 2016
@Kubuxu Kubuxu removed their assignment Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants