Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: net/third_party/nss/patches/sslkeylogerror.patch

Issue 10636062: Fix crash when an SSL key-log file couldn't be opened. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/third_party/nss/patches/applypatches.sh ('k') | net/third_party/nss/ssl/sslsock.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/third_party/nss/patches/sslkeylogerror.patch
diff --git a/net/third_party/nss/patches/sslkeylogerror.patch b/net/third_party/nss/patches/sslkeylogerror.patch
new file mode 100644
index 0000000000000000000000000000000000000000..7dd57c2b0123facd859ec6545ea05757511a8698
--- /dev/null
+++ b/net/third_party/nss/patches/sslkeylogerror.patch
@@ -0,0 +1,24 @@
+diff --git a/net/third_party/nss/ssl/sslsock.c b/net/third_party/nss/ssl/sslsock.c
+index 1823a1c..2a93dae 100644
+--- a/net/third_party/nss/ssl/sslsock.c
++++ b/net/third_party/nss/ssl/sslsock.c
+@@ -2934,11 +2934,15 @@ ssl_SetDefaultsFromEnvironment(void)
+ ev = getenv("SSLKEYLOGFILE");
+ if (ev && ev[0]) {
+ ssl_keylog_iob = fopen(ev, "a");
+- if (ftell(ssl_keylog_iob) == 0) {
+- fputs("# SSL/TLS secrets log file, generated by NSS\n",
+- ssl_keylog_iob);
++ if (!ssl_keylog_iob) {
++ SSL_TRACE(("Failed to open key log file"));
++ } else {
++ if (ftell(ssl_keylog_iob) == 0) {
++ fputs("# SSL/TLS secrets log file, generated by NSS\n",
++ ssl_keylog_iob);
++ }
++ SSL_TRACE(("SSL: logging pre-master secrets to %s", ev));
+ }
+- SSL_TRACE(("SSL: logging pre-master secrets to %s", ev));
+ }
+ ev = getenv("SSLBYPASS");
+ if (ev && ev[0]) {
« no previous file with comments | « net/third_party/nss/patches/applypatches.sh ('k') | net/third_party/nss/ssl/sslsock.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698