Disable the real webcrypto

Sadly, we are not quite compliant with the WC3 webcrypto spec
due to our insistance on passing around key data in plain old
ArrayBuffers.

Also converted whitespace.
This commit is contained in:
lilia 2014-10-23 20:45:09 -07:00
commit a4b25f7df1

View file

@ -1,4 +1,4 @@
/* vim: ts=4:sw=4 /* vim: ts=4:sw=4:expandtab
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@ -17,9 +17,9 @@
/* Web Crypto polyfill. TODO: replace with web crypto */ /* Web Crypto polyfill. TODO: replace with web crypto */
// All inputs/outputs are arraybuffers! // All inputs/outputs are arraybuffers!
window.crypto.subtle = (function() { window.crypto.subtle = (function() {
if (window.crypto.subtle !== undefined && window.crypto.subtle !== null) { /* if (window.crypto.subtle !== undefined && window.crypto.subtle !== null) {
return window.crypto.subtle; return window.crypto.subtle;
} else { } else*/ {
var StaticArrayBufferProto = new ArrayBuffer().__proto__; var StaticArrayBufferProto = new ArrayBuffer().__proto__;
function assertIsArrayBuffer(thing) { function assertIsArrayBuffer(thing) {
if (thing !== Object(thing) || thing.__proto__ != StaticArrayBufferProto) if (thing !== Object(thing) || thing.__proto__ != StaticArrayBufferProto)