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

rpcserver: Hash auth using random-keyed MAC. #2486

Merged
merged 1 commit into from
Dec 2, 2020
Merged

Conversation

jrick
Copy link
Member

@jrick jrick commented Nov 30, 2020

This commit replaces the SHA256 hash of the HTTP Basic Authorization
header with HMAC-SHA256. The MAC is performed using a random key read
from the cryptographically random source at server creation.

Storing the authentication details with a MAC unique to each startup
hardens the server against certain classes of memory dumping attacks.

While here, a server field that must be accessed atomically was moved
to the top of the structure, to reduce the likelihood of misaligned
access on architectures where that is forbidden.

This commit replaces the SHA256 hash of the HTTP Basic Authorization
header with HMAC-SHA256.  The MAC is performed using a random key read
from the cryptographically random source at server creation.

Storing the authentication details with a MAC unique to each startup
hardens the server against certain classes of memory dumping attacks.

While here, a server field that must be accessed atomically was moved
to the top of the structure, to reduce the likelihood of misaligned
access on architectures where that is forbidden.
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

Tested this works as intended.

@davecgh davecgh changed the title rpcserver: Hash auth using random-keyed MAC rpcserver: Hash auth using random-keyed MAC. Dec 2, 2020
@davecgh davecgh merged commit ced647d into decred:master Dec 2, 2020
@jrick jrick deleted the authhmac branch December 2, 2020 19:04
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.

2 participants