From 0319a16b15e002a2de3488d54dde563eff87e238 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 4 Aug 2018 13:25:31 +0200 Subject: [PATCH] support older browsers correctly and ensure the paranoia setting for the sjcl.random.isReady call matches paranoia level 10 instead of the default 6 --- js/privatebin.js | 5 ++++- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 2701423..05ed6c5 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -25,6 +25,8 @@ // Immediately start random number generator collector. sjcl.random.startCollectors(); +// Setting this to 10 ensures 1024 bits of entropy get collected before generating the paste key +sjcl.random.setDefaultParanoia(10); // main application start, called when DOM is fully loaded jQuery(document).ready(function() { @@ -229,7 +231,8 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { return baseUri; } - baseUri = window.location.origin + window.location.pathname; + // window.location.origin is a newer alternative, but requires FF 21 / Chrome 31 / Safari 7 / IE 11 + baseUri = window.location.protocol + '//' + window.location.host + window.location.pathname; return baseUri; }; diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 12e3433..de59c14 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -75,7 +75,7 @@ if ($MARKDOWN): - + diff --git a/tpl/page.php b/tpl/page.php index b5aeeab..221da75 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -53,7 +53,7 @@ if ($MARKDOWN): - +