summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-09-08 19:55:33 +0200
committerWojtek Kosior <koszko@koszko.org>2021-09-08 19:55:33 +0200
commite2d26bad35bbe3876862b482f7963d713238313b (patch)
tree47e6647c239e8f85fa764cfa5750e0f73e1efd74 /common
parent704f2da0673dc714f72b9bb82f6bf648795d4335 (diff)
downloadbrowser-extension-e2d26bad35bbe3876862b482f7963d713238313b.tar.gz
browser-extension-e2d26bad35bbe3876862b482f7963d713238313b.zip
Fix sanitizing of non-HTML XMLDocument's
Diffstat (limited to 'common')
-rw-r--r--common/misc.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/misc.js b/common/misc.js
index 91d60d2..6adaf1e 100644
--- a/common/misc.js
+++ b/common/misc.js
@@ -36,9 +36,9 @@ function Uint8toHex(data)
return returnValue;
}
-function gen_nonce(length) // Default 16
+function gen_nonce(length=16)
{
- let randomData = new Uint8Array(length || 16);
+ let randomData = new Uint8Array(length);
crypto.getRandomValues(randomData);
return Uint8toHex(randomData);
}