Skip to content

Make RPC password resistant to timing attacks - #2886

Merged
gavinandresen merged 1 commit into
bitcoin:masterfrom
gavinandresen:rpctiming
Aug 16, 2013
Merged

gavinandresen merged 1 commit into
bitcoin:masterfrom
gavinandresen:rpctiming

Conversation

@gavinandresen

Copy link
Copy Markdown
Contributor

Fixes issue#2838; this is a tweaked version of pull#2845 that
should not leak the length of the password and is more generic,
in case we run into other situations where we need
timing-attack-resistant comparisons.

Fixes issue#2838; this is a tweaked version of pull#2845 that
should not leak the length of the password and is more generic,
in case we run into other situations where we need
timing-attack-resistant comparisons.
@BitcoinPullTester

Copy link
Copy Markdown

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/42656ea2e552b027e174fdceab7348ffcb8245c4 for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@laanwj

laanwj commented Aug 10, 2013

Copy link
Copy Markdown
Member

ACK

1 similar comment
@sipa

sipa commented Aug 15, 2013

Copy link
Copy Markdown
Member

ACK

@gmaxwell

Copy link
Copy Markdown
Contributor

ACK. This does leak some timing data if bsize==0 or not, but I think this is inconsequential, I'm only mentioning it in case others didn't realize it and might care.

gavinandresen added a commit that referenced this pull request Aug 16, 2013
Make RPC password resistant to timing attacks
@gavinandresen
gavinandresen merged commit a0bb001 into bitcoin:master Aug 16, 2013
@gavinandresen
gavinandresen deleted the rpctiming branch November 4, 2013 06:17
0xDEADFACE pushed a commit to 0xDEADFACE/novacoin that referenced this pull request Jan 26, 2014
Eliminates the possibility of timing attacks by changing the way the two passwords are compared.
It iterates through each char in the strings, and if the two chars it is comparing aren't the same, then it adds 1 to nReturn and the function, once it's done comparing all the chars, will return false. Previously, the function would return false on the first char that didn't match, allowing a possible attacker to run a timing attack.

See

bitcoin/bitcoin#2886
http://rdist.root.org/2010/01/07/timing-independent-array-comparison/

for more detailed explanation.
bee7 pushed a commit to bee7/grain that referenced this pull request Jun 2, 2014
Eliminates the possibility of timing attacks by changing the way the two passwords are compared.
It iterates through each char in the strings, and if the two chars it is comparing aren't the same, then it adds 1 to nReturn and the function, once it's done comparing all the chars, will return false. Previously, the function would return false on the first char that didn't match, allowing a possible attacker to run a timing attack.

See

bitcoin/bitcoin#2886
http://rdist.root.org/2010/01/07/timing-independent-array-comparison/

for more detailed explanation.
strcoin pushed a commit to strcoin/starcoin that referenced this pull request Jun 10, 2014
Eliminates the possibility of timing attacks by changing the way the two passwords are compared.
It iterates through each char in the strings, and if the two chars it is comparing aren't the same, then it adds 1 to nReturn and the function, once it's done comparing all the chars, will return false. Previously, the function would return false on the first char that didn't match, allowing a possible attacker to run a timing attack.

See

bitcoin/bitcoin#2886
http://rdist.root.org/2010/01/07/timing-independent-array-comparison/

for more detailed explanation.
lunokhod pushed a commit to lunokhod/anoncoin that referenced this pull request Feb 26, 2015
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants