Update protocol libs
Rename storage functions // FREEBIE
This commit is contained in:
parent
b5ddd41a5e
commit
1fe5d63015
11 changed files with 91 additions and 91 deletions
|
@ -19,25 +19,25 @@ describe("Key generation", function() {
|
|||
}
|
||||
function itStoresPreKey(keyId) {
|
||||
it('prekey ' + keyId + ' is valid', function(done) {
|
||||
return textsecure.storage.axolotl.getPreKey(keyId).then(function(keyPair) {
|
||||
return textsecure.storage.axolotl.loadPreKey(keyId).then(function(keyPair) {
|
||||
validateStoredKeyPair(keyPair);
|
||||
}).then(done,done);
|
||||
});
|
||||
}
|
||||
function itStoresSignedPreKey(keyId) {
|
||||
it('signed prekey ' + keyId + ' is valid', function(done) {
|
||||
return textsecure.storage.axolotl.getSignedPreKey(keyId).then(function(keyPair) {
|
||||
return textsecure.storage.axolotl.loadSignedPreKey(keyId).then(function(keyPair) {
|
||||
validateStoredKeyPair(keyPair);
|
||||
}).then(done,done);
|
||||
});
|
||||
}
|
||||
function validateResultKey(resultKey) {
|
||||
return textsecure.storage.axolotl.getPreKey(resultKey.keyId).then(function(keyPair) {
|
||||
return textsecure.storage.axolotl.loadPreKey(resultKey.keyId).then(function(keyPair) {
|
||||
assertEqualArrayBuffers(resultKey.publicKey, keyPair.pubKey);
|
||||
});
|
||||
}
|
||||
function validateResultSignedKey(resultSignedKey) {
|
||||
return textsecure.storage.axolotl.getSignedPreKey(resultSignedKey.keyId).then(function(keyPair) {
|
||||
return textsecure.storage.axolotl.loadSignedPreKey(resultSignedKey.keyId).then(function(keyPair) {
|
||||
assertEqualArrayBuffers(resultSignedKey.publicKey, keyPair.pubKey);
|
||||
});
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ describe("Key generation", function() {
|
|||
validateResultSignedKey(result.signedPreKey).then(done,done);
|
||||
});
|
||||
it('deletes signed key 1', function() {
|
||||
textsecure.storage.axolotl.getSignedPreKey(1).then(function(keyPair) {
|
||||
textsecure.storage.axolotl.loadSignedPreKey(1).then(function(keyPair) {
|
||||
assert.isUndefined(keyPair);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue