Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
orbea
Tor
Commits
955cf962
Unverified
Commit
955cf962
authored
5 years ago
by
teor
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'tor-github/pr/911' into maint-0.3.5
parents
3287cae6
4dd96f74
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/29241_diagnostic
+4
-0
4 additions, 0 deletions
changes/29241_diagnostic
changes/bug29241
+6
-0
6 additions, 0 deletions
changes/bug29241
src/lib/tls/tortls_nss.c
+40
-0
40 additions, 0 deletions
src/lib/tls/tortls_nss.c
with
50 additions
and
0 deletions
changes/29241_diagnostic
0 → 100644
+
4
−
0
View file @
955cf962
o Minor features (NSS, diagnostic):
- Try to log an error from NSS (if there is any) and a more useful
description of our situation if we are using NSS and a call to
SSL_ExportKeyingMaterial() fails. Diagnostic for ticket 29241.
This diff is collapsed.
Click to expand it.
changes/bug29241
0 → 100644
+
6
−
0
View file @
955cf962
o Major bugfixes (NSS, relay):
- When running with NSS, disable TLS 1.2 ciphersuites that use SHA384
for their PRF. Due to an NSS bug, the TLS key exporters for these
ciphersuites don't work -- which caused relays to fail to handshake
with one another when these ciphersuites were enabled.
Fixes bug 29241; bugfix on 0.3.5.1-alpha.
This diff is collapsed.
Click to expand it.
src/lib/tls/tortls_nss.c
+
40
−
0
View file @
955cf962
...
...
@@ -152,6 +152,32 @@ we_like_auth_type(SSLAuthType at)
}
}
/**
* Return true iff this ciphersuite will be hit by a mozilla bug 1312976,
* which makes TLS key exporters not work with TLS 1.2 non-SHA256
* ciphersuites.
**/
static
bool
ciphersuite_has_nss_export_bug
(
const
SSLCipherSuiteInfo
*
info
)
{
/* For more information on the bug, see
https://bugzilla.mozilla.org/show_bug.cgi?id=1312976 */
/* This bug only exists in TLS 1.2. */
if
(
info
->
authType
==
ssl_auth_tls13_any
)
return
false
;
/* Sadly, there's no way to get this information from the
* CipherSuiteInfo object itself other than by looking at the
* name. */
if
(
strstr
(
info
->
cipherSuiteName
,
"_SHA384"
)
||
strstr
(
info
->
cipherSuiteName
,
"_SHA512"
))
{
return
true
;
}
return
false
;
}
tor_tls_context_t
*
tor_tls_context_new
(
crypto_pk_t
*
identity
,
unsigned
int
key_lifetime
,
unsigned
flags
,
int
is_client
)
...
...
@@ -256,6 +282,12 @@ tor_tls_context_new(crypto_pk_t *identity,
!
we_like_mac_algorithm
(
info
.
macAlgorithm
)
||
!
we_like_auth_type
(
info
.
authType
)
/* Requires NSS 3.24 */
;
if
(
ciphersuite_has_nss_export_bug
(
&
info
))
{
/* SSL_ExportKeyingMaterial will fail; we can't use this cipher.
*/
disable
=
1
;
}
s
=
SSL_CipherPrefSet
(
ctx
->
ctx
,
ciphers
[
i
],
disable
?
PR_FALSE
:
PR_TRUE
);
if
(
s
!=
SECSuccess
)
...
...
@@ -726,10 +758,18 @@ tor_tls_export_key_material,(tor_tls_t *tls, uint8_t *secrets_out,
tor_assert
(
context_len
<=
UINT_MAX
);
SECStatus
s
;
/* Make sure that the error code is set here, so that we can be sure that
* any error code set after a failure was in fact caused by
* SSL_ExportKeyingMaterial. */
PR_SetError
(
PR_UNKNOWN_ERROR
,
0
);
s
=
SSL_ExportKeyingMaterial
(
tls
->
ssl
,
label
,
(
unsigned
)
strlen
(
label
),
PR_TRUE
,
context
,
(
unsigned
)
context_len
,
secrets_out
,
DIGEST256_LEN
);
if
(
s
!=
SECSuccess
)
{
tls_log_errors
(
tls
,
LOG_WARN
,
LD_CRYPTO
,
"exporting key material for a TLS handshake"
);
}
return
(
s
==
SECSuccess
)
?
0
:
-
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment