Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Goulet
Tor
Commits
680fd3f8
Unverified
Commit
680fd3f8
authored
Mar 29, 2019
by
Nick Mathewson
🏃
Committed by
teor
Apr 06, 2019
Browse files
NSS: Log an error message when SSL_ExportKeyingMaterial() fails
Diagnostic for 29241.
parent
3b9e3cca
Changes
2
Hide whitespace changes
Inline
Side-by-side
changes/29241_diagnostic
0 → 100644
View file @
680fd3f8
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.
src/lib/tls/tortls_nss.c
View file @
680fd3f8
...
...
@@ -726,10 +726,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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment