Skip to content

Preserve leading zeros in Diffie-Hellman secrets.#462

Merged
ekr merged 1 commit into
tlswg:masterfrom
davidben:dhe-pad2
May 20, 2016
Merged

Preserve leading zeros in Diffie-Hellman secrets.#462
ekr merged 1 commit into
tlswg:masterfrom
davidben:dhe-pad2

Conversation

@davidben

Copy link
Copy Markdown
Contributor

Every other use of Diffie-Hellman preserves leading zeros. See PKCS #3 section
8.3, RFC 2631 section 2.1.2, and SP 800-56A section C.1. I assume X9.42 says
something similar to RFC 2631, but I do not have a copy of it. This discrepancy
has caused sporadic interoperability issues in TLS 1.2's DHE construction, so
clearly it's confusing.

Moreover, having variable-length secrets is generally dubious. It exposes an
unnecessary side channel.

Since TLS 1.2's server-fiat DHE and TLS 1.3's negotiated DHE are already very
different animals (1.3 DHE is more like 1.2 ECDHE than anything else), change
it to the more reasonable scheme going forward. This is not compatible with 1.2
and does risk a different set of sporadic interop issues if implementations do
not realize this changed, but we already have those with 1.2 implementations
today.

Every other use of Diffie-Hellman preserves leading zeros. See PKCS tlswg#3 section
8.3, RFC 2631 section 2.1.2, and SP 800-56A section C.1. I assume X9.42 says
something similar to RFC 2631, but I do not have a copy of it. This discrepancy
has caused sporadic interoperability issues in TLS 1.2's DHE construction, so
clearly it's confusing.

Moreover, having variable-length secrets is generally dubious. It exposes an
unnecessary side channel.

Since TLS 1.2's server-fiat DHE and TLS 1.3's negotiated DHE are already very
different animals (1.3 DHE is more like 1.2 ECDHE than anything else), change
it to the more reasonable scheme going forward. This is not compatible with 1.2
and does risk a different set of sporadic interop issues if implementations do
not realize this changed, but we already have those with 1.2 implementations
today.
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