From 07ac4004b8451a198a6e601a8937019c5bb47d2c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 23 Oct 2015 02:19:32 -0700 Subject: [PATCH] mobile safari webcrypto fix --- bower_components/botp/sha1-hmac.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower_components/botp/sha1-hmac.js b/bower_components/botp/sha1-hmac.js index fb107ee..bbc20ed 100644 --- a/bower_components/botp/sha1-hmac.js +++ b/bower_components/botp/sha1-hmac.js @@ -13,7 +13,7 @@ exports.sha1Hmac = function (key, bytes) { var Unibabel = window.Unibabel; if (window.crypto) { - return window.crypto.subtle.importKey( + return (window.crypto.subtle||window.crypto.webkitSubtle).importKey( "raw" , key , { name: "HMAC" @@ -41,7 +41,7 @@ exports.sha1Hmac = function (key, bytes) { ) */ .then(function (key) { - return window.crypto.subtle.sign( + return (window.crypto.subtle||window.crypto.webkitSubtle).sign( { name: "HMAC" } , key // from generateKey or importKey above , new Uint8Array(bytes) // ArrayBuffer of data you want to sign