author | Kit Cambridge <kcambridge@mozilla.com> |
Wed, 16 Mar 2016 19:53:19 -0700 (2016-03-17) | |
changeset 289376 | 5fe5459a786bee7180632dab6e53295646e18dcb |
parent 289375 | b40d8bae66f1097f3c7cb1833614d9e58e87cd2a |
child 289377 | f164ff25450e14362813120e1c21937d2f5b1012 |
push id | 73812 |
push user | ryanvm@gmail.com |
push date | Fri, 18 Mar 2016 17:54:15 +0000 (2016-03-18) |
treeherder | mozilla-inbound@e14e69dd0ff6 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mt |
bugs | 1257405 |
milestone | 48.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
dom/push/PushCrypto.jsm | file | annotate | diff | comparison | revisions | |
dom/push/test/test_data.html | file | annotate | diff | comparison | revisions |
--- a/dom/push/PushCrypto.jsm +++ b/dom/push/PushCrypto.jsm @@ -178,17 +178,17 @@ function generateNonce(base, index) { nonce[nonce.byteLength - 1 - i] ^= (index / Math.pow(256, i)) & 0xff; } return nonce; } this.PushCrypto = { generateAuthenticationSecret() { - return crypto.getRandomValues(new Uint8Array(12)); + return crypto.getRandomValues(new Uint8Array(16)); }, generateKeys() { return crypto.subtle.generateKey(ECDH_KEY, true, ['deriveBits']) .then(cryptoKey => Promise.all([ crypto.subtle.exportKey('raw', cryptoKey.publicKey), crypto.subtle.exportKey('jwk', cryptoKey.privateKey)
--- a/dom/push/test/test_data.html +++ b/dom/push/test/test_data.html @@ -98,24 +98,24 @@ http://creativecommons.org/licenses/publ "Mismatched Base64-encoded key: " + keyName ); }); }); add_task(function* comparePublicKey() { var data = yield sendRequestToWorker({ type: "publicKey" }); var p256dhKey = new Uint8Array(pushSubscription.getKey("p256dh")); - ok(p256dhKey.length > 0, "Missing key share"); + is(p256dhKey.length, 65, "Key share should be 65 octets"); isDeeply( p256dhKey, new Uint8Array(data.p256dh), "Mismatched key share" ); var authSecret = new Uint8Array(pushSubscription.getKey("auth")); - ok(authSecret.length > 0, "Missing auth secret"); + ok(authSecret.length, 16, "Auth secret should be 16 octets"); isDeeply( authSecret, new Uint8Array(data.auth), "Mismatched auth secret" ); }); var version = 0;