Skip to content

use SecureRandom for digest auth cnonce#2220

Open
jmestwa-coder wants to merge 1 commit into
AsyncHttpClient:mainfrom
jmestwa-coder:digest-cnonce-securerandom
Open

use SecureRandom for digest auth cnonce#2220
jmestwa-coder wants to merge 1 commit into
AsyncHttpClient:mainfrom
jmestwa-coder:digest-cnonce-securerandom

Conversation

@jmestwa-coder

Copy link
Copy Markdown
Contributor

The digest cnonce was drawn from a non-cryptographic PRNG:

  • Realm.Builder.newCnonce seeds the cnonce from ThreadLocalRandom, whose output is predictable
  • RFC 7616 section 3.3 needs the cnonce unpredictable so it guards against chosen-plaintext and precomputation attacks on the credentials
  • NtlmEngine and ScramEngine in this repo already use SecureRandom for their nonces

Switched the cnonce source to SecureRandom to match.

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.

1 participant