{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/25173","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/25173/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/25173/comments","events_url":"https://api.github.com/repos/golang/go/issues/25173/events","html_url":"https://github.com/golang/go/issues/25173","id":318744297,"number":25173,"title":"x/crypto/ssh/agent: Non-constant passphrase check","user":{"login":"weingart","id":1229641,"avatar_url":"https://avatars3.githubusercontent.com/u/1229641?v=4","gravatar_id":"","url":"https://api.github.com/users/weingart","html_url":"https://github.com/weingart","followers_url":"https://api.github.com/users/weingart/followers","following_url":"https://api.github.com/users/weingart/following{/other_user}","gists_url":"https://api.github.com/users/weingart/gists{/gist_id}","starred_url":"https://api.github.com/users/weingart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weingart/subscriptions","organizations_url":"https://api.github.com/users/weingart/orgs","repos_url":"https://api.github.com/users/weingart/repos","events_url":"https://api.github.com/users/weingart/events{/privacy}","received_events_url":"https://api.github.com/users/weingart/received_events","type":"User","site_admin":false},"labels":[{"id":373401956,"url":"https://api.github.com/repos/golang/go/labels/NeedsDecision","name":"NeedsDecision","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/22","html_url":"https://github.com/golang/go/milestone/22","labels_url":"https://api.github.com/repos/golang/go/milestones/22/labels","id":1067491,"number":22,"title":"Unreleased","description":"Issues that do not affect released Go code and binaries.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":848,"closed_issues":1381,"state":"open","created_at":"2015-04-14T18:48:22Z","updated_at":"2018-04-29T19:51:39Z","due_on":"2099-12-31T08:00:00Z","closed_at":null},"comments":1,"created_at":"2018-04-29T19:51:33Z","updated_at":"2018-04-29T22:26:23Z","closed_at":null,"author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n\r\n### What version of Go are you using (`go version`)?\r\n1.10.1\r\n\r\n### Does this issue reproduce with the latest release?\r\nYes\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n\r\n\r\n### What did you do?\r\nLook at: https://github.com/golang/crypto/blob/master/ssh/agent/keyring.go#L105\r\n\r\n### What did you expect to see?\r\nA comparison that was constant time.\r\n\r\n### What did you see instead?\r\nA comparison that could be used to divine the length of the passphrase.\r\n\r\n### How to fix?\r\nUse a constant time comparison, without a length check short-circuit.\r\n\r\nOther option:\r\nStored a hashed via bcrypt (or similar) version of the passphrase instead.  The comparison\r\nshould then also hash the attempted passphrase and use a constant time compare (which the\r\nhash would pretty much guarantee).  Note, this could make the implementation also more safe\r\nfrom casual memory snooping.\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/385286797","html_url":"https://github.com/golang/go/issues/25173#issuecomment-385286797","issue_url":"https://api.github.com/repos/golang/go/issues/25173","id":385286797,"user":{"login":"as","id":8127015,"avatar_url":"https://avatars2.githubusercontent.com/u/8127015?v=4","gravatar_id":"","url":"https://api.github.com/users/as","html_url":"https://github.com/as","followers_url":"https://api.github.com/users/as/followers","following_url":"https://api.github.com/users/as/following{/other_user}","gists_url":"https://api.github.com/users/as/gists{/gist_id}","starred_url":"https://api.github.com/users/as/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/as/subscriptions","organizations_url":"https://api.github.com/users/as/orgs","repos_url":"https://api.github.com/users/as/repos","events_url":"https://api.github.com/users/as/events{/privacy}","received_events_url":"https://api.github.com/users/as/received_events","type":"User","site_admin":false},"created_at":"2018-04-29T22:26:23Z","updated_at":"2018-04-29T22:26:23Z","author_association":"CONTRIBUTOR","body":"@weingart \r\n\r\nIt's true that hashing the passphrase will create a bitstring comparable in constant time, but the suggestion of bcrypt sounds rather expensive. Is there a particular reason you would choose this function over another?\r\n\r\n>Note, this could make the implementation also more safe\r\nfrom casual memory snooping.\r\n\r\nI would prefer to step away from such corollaries, it creates one more location in memory associated with the passphrase."}}
{"actor":{"display_login":"as"}}