Skip to content

Fix a regression in SSL_export_keying_material - #7755

Closed
mattcaswell wants to merge 4 commits into
openssl:masterfrom
mattcaswell:tor-regression
Closed

mattcaswell wants to merge 4 commits into
openssl:masterfrom
mattcaswell:tor-regression

Conversation

@mattcaswell

Copy link
Copy Markdown
Member

This reverts cbad0a6 which introduced a regression impacting Tor. This also fixes some issues in tls13_hkdf_expand() which impact the SSL_export_keying_material function for TLSv1.3. We add a test to check that we can use the maximum label length in TLSv1.3.

Fixes #7712

This reverts commit ec0c5f5.

SSL_export_keying_material() may use longer label lengths.

Fixes openssl#7712
Fix some issues in tls13_hkdf_expand() which impact the above function
for TLSv1.3. In particular test that we can use the maximum label length
in TLSv1.3.
@mattcaswell mattcaswell added branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) labels Dec 4, 2018
Comment thread ssl/tls13_enc.c Outdated
unsigned char hkdflabel[sizeof(uint16_t) + sizeof(uint8_t) +
+ sizeof(label_prefix) + TLS13_MAX_LABEL_LEN
+ EVP_MAX_MD_SIZE];
static unsigned char hkdflabel[sizeof(uint16_t) + sizeof(uint8_t) +

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose static here is a no-go as it would make the function non-reentrant. So it either needs to be kept on the stack or allocated.

Comment thread ssl/tls13_enc.c Outdated
unsigned char *out, size_t outlen, int fatal)
{
static const unsigned char label_prefix[] = "tls13 ";
const unsigned char label_prefix[] = "tls13 ";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not keep the static here? Not that a reasonable compiler shouldn't be able to optimize it out anyway but...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Errr...I reverted the original commit and reimplemented some bits of it. I meant to retain the static - but it looks like I "missed" and added it to the wrong variable :-)

@mattcaswell

Copy link
Copy Markdown
Member Author

Fixup commit pushed addressing feedback.

@mattcaswell

Copy link
Copy Markdown
Member Author

Fixup commit pushed addressing travis failure.

@t-j-h t-j-h left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Once CIs are green for this update ...

levitte pushed a commit that referenced this pull request Dec 5, 2018
This reverts commit ec0c5f5.

SSL_export_keying_material() may use longer label lengths.

Fixes #7712

Reviewed-by: Tim Hudson <[email protected]>
(Merged from #7755)

(cherry picked from commit ed371b8)
levitte pushed a commit that referenced this pull request Dec 5, 2018
Fix some issues in tls13_hkdf_expand() which impact the above function
for TLSv1.3. In particular test that we can use the maximum label length
in TLSv1.3.

Reviewed-by: Tim Hudson <[email protected]>
(Merged from #7755)

(cherry picked from commit 0fb2815)
@mattcaswell

Copy link
Copy Markdown
Member Author

CIs are green. Pushed to master and 1.1.1.

@mattcaswell mattcaswell closed this Dec 5, 2018
levitte pushed a commit that referenced this pull request Dec 5, 2018
This reverts commit ec0c5f5.

SSL_export_keying_material() may use longer label lengths.

Fixes #7712

Reviewed-by: Tim Hudson <[email protected]>
(Merged from #7755)
levitte pushed a commit that referenced this pull request Dec 5, 2018
Fix some issues in tls13_hkdf_expand() which impact the above function
for TLSv1.3. In particular test that we can use the maximum label length
in TLSv1.3.

Reviewed-by: Tim Hudson <[email protected]>
(Merged from #7755)
@nmathewson

Copy link
Copy Markdown
Contributor

Is it known when this fix will go into an openssl release? It is causing Tor to break on several downstream operating systems.

@mattcaswell

Copy link
Copy Markdown
Member Author

We normally do releases on an "as needed" basis. This means either if a sufficiently serious security defect triggers it (moderate severity or above). If no security defect triggers a release then we typically do one anyway after 3-4 months from the previous release.

@jacmet

jacmet commented Feb 9, 2019

Copy link
Copy Markdown

@mattcaswell and for regressions like this?

@mattcaswell

Copy link
Copy Markdown
Member Author

Well its not a security defect so it doesn't trigger a release itself. It will get rolled up in the next release whenever that ends up being. The last one was a little under 3 months ago, and we typically do one every 3-4 months so I would expect one "soon".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Tor's use of SSL_export_keying_material() broken with TLS 1.3 in Openssl 1.1.1a

5 participants