Draw the GREASE signature algorithm from the per-connection seed - #412
Open
nihiloid wants to merge 1 commit into
Open
Draw the GREASE signature algorithm from the per-connection seed#412nihiloid wants to merge 1 commit into
nihiloid wants to merge 1 commit into
Conversation
…e 152) Add the seed index ssl_grease_signature_algorithm. ApplyPreset now replaces the GREASE placeholder in SignatureAlgorithmsExtension with the seeded value. Add u_grease_sigalg_test.go for the substitution, the per-connection draw, and the seed index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Chrome 152 introduced a GREASE value in the
signature_algorithmsextension. Chrome sends that value first in the list and draws a new value for each connection. Chrome 151 and earlier sent no GREASE value there.utls replaces GREASE placeholders in the cipher suites, the supported groups, the key shares, the supported versions, and the GREASE extensions. It does not replace them in
signature_algorithms. A spec that writesSignatureScheme(GREASE_PLACEHOLDER)therefore sends the literal value0x0a0aon every connection. That constant is a reliable "this is not Chrome" signal.Change
u_tls_extensions.go: add the seed indexssl_grease_signature_algorithm. It comes beforessl_grease_ticket_extension, so the indexes of the older positions keep their values.ssl_grease_last_indexgrows by one, andUConn.greaseSeedgrows with it.u_parrots.go: add acase *SignatureAlgorithmsExtensionto the reGREASE switch inApplyPreset. It replaces each entry for whichisGREASEUint16reports true withGetBoringGREASEValue(uconn.greaseSeed, ssl_grease_signature_algorithm), the same way the existing curve, key share, and version cases work. The value now comes from the one per-connection seed, so the GREASE values in one ClientHello relate to each other the way BoringSSL relates them.u_grease_sigalg_test.go: new tests. They check that the placeholder becomes a0x?a?avalue, that the other signature algorithms stay unchanged, that the value changes across 64 connections, and that the value equals the seeded value for the new index.This change adds the mechanism only. The newest bundled Chrome profile is
HelloChrome_133, which predates Chrome 152, so no shipped profile writesSignatureScheme(GREASE_PLACEHOLDER)yet. A future Chrome 152 profile, or any caller that builds its ownClientHelloSpec, can use it. Existing profiles send the same bytes as before.SignatureAlgorithmsCertExtensiongets no substitution, because BoringSSL does not GREASE it.Test
go build ./...,go vet ./..., andgo test ./...pass.The same change for the
bogdanfinn/utlsfork: bogdanfinn/utls#9.