Fixup dir structure
This commit is contained in:
parent
4595ad0fc4
commit
eec4c66ef6
20 changed files with 53 additions and 49 deletions
|
@ -1,15 +1,15 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.js"></script>
|
||||||
<script type="text/javascript" src="jquery.atmosphere.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.atmosphere.js"></script>
|
||||||
<script type="text/javascript" src="aes.js"></script>
|
<script type="text/javascript" src="js-deps/aes.js"></script>
|
||||||
<script type="text/javascript" src="hmac-sha256.js"></script>
|
<script type="text/javascript" src="js-deps/hmac-sha256.js"></script>
|
||||||
<script type="text/javascript" src="lib-typedarrays.js"></script>
|
<script type="text/javascript" src="js-deps/lib-typedarrays.js"></script>
|
||||||
<script type="text/javascript" src="Long.min.js"></script>
|
<script type="text/javascript" src="js-deps/Long.min.js"></script>
|
||||||
<script type="text/javascript" src="ByteBuffer.min.js"></script>
|
<script type="text/javascript" src="js-deps/ByteBuffer.min.js"></script>
|
||||||
<script type="text/javascript" src="ProtoBuf.min.js"></script>
|
<script type="text/javascript" src="js-deps/ProtoBuf.min.js"></script>
|
||||||
<script type="text/javascript" src="helpers.js"></script>
|
<script type="text/javascript" src="js/helpers.js"></script>
|
||||||
<script type="text/javascript" src="background.js"></script>
|
<script type="text/javascript" src="js/background.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
</body>
|
</body>
|
||||||
|
|
0
Long.min.js → js-deps/Long.min.js
vendored
0
Long.min.js → js-deps/Long.min.js
vendored
0
ProtoBuf.min.js → js-deps/ProtoBuf.min.js
vendored
0
ProtoBuf.min.js → js-deps/ProtoBuf.min.js
vendored
0
jquery.js → js-deps/jquery.js
vendored
0
jquery.js → js-deps/jquery.js
vendored
|
@ -58,27 +58,27 @@ function base64ToUint8Array(string) {
|
||||||
|
|
||||||
// Protobuf decodingA
|
// Protobuf decodingA
|
||||||
//TODO: throw on missing fields everywhere
|
//TODO: throw on missing fields everywhere
|
||||||
var IncomingPushMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("IncomingPushMessageSignal.proto").build("textsecure.IncomingPushMessageSignal");
|
var IncomingPushMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("protos/IncomingPushMessageSignal.proto").build("textsecure.IncomingPushMessageSignal");
|
||||||
function decodeIncomingPushMessageProtobuf(string) {
|
function decodeIncomingPushMessageProtobuf(string) {
|
||||||
return IncomingPushMessageProtobuf.decode(btoa(string));
|
return IncomingPushMessageProtobuf.decode(btoa(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
var PushMessageContentProtobuf = dcodeIO.ProtoBuf.loadProtoFile("IncomingPushMessageSignal.proto").build("textsecure.PushMessageContent");
|
var PushMessageContentProtobuf = dcodeIO.ProtoBuf.loadProtoFile("protos/IncomingPushMessageSignal.proto").build("textsecure.PushMessageContent");
|
||||||
function decodePushMessageContentProtobuf(string) {
|
function decodePushMessageContentProtobuf(string) {
|
||||||
return PushMessageContentProtobuf.decode(btoa(string));
|
return PushMessageContentProtobuf.decode(btoa(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
var WhisperMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("WhisperTextProtocol.proto").build("textsecure.WhisperMessage");
|
var WhisperMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("protos/WhisperTextProtocol.proto").build("textsecure.WhisperMessage");
|
||||||
function decodeWhisperMessageProtobuf(string) {
|
function decodeWhisperMessageProtobuf(string) {
|
||||||
return WhisperMessageProtobuf.decode(btoa(string));
|
return WhisperMessageProtobuf.decode(btoa(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
var PreKeyWhisperMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("WhisperTextProtocol.proto").build("textsecure.PreKeyWhisperMessage");
|
var PreKeyWhisperMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("protos/WhisperTextProtocol.proto").build("textsecure.PreKeyWhisperMessage");
|
||||||
function decodePreKeyWhisperMessageProtobuf(string) {
|
function decodePreKeyWhisperMessageProtobuf(string) {
|
||||||
return PreKeyWhisperMessageProtobuf.decode(btoa(string));
|
return PreKeyWhisperMessageProtobuf.decode(btoa(string));
|
||||||
}
|
}
|
||||||
|
|
||||||
var KeyExchangeMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("WhisperTextProtocol.proto").build("textsecure.KeyExchangeMessage");
|
var KeyExchangeMessageProtobuf = dcodeIO.ProtoBuf.loadProtoFile("protos/WhisperTextProtocol.proto").build("textsecure.KeyExchangeMessage");
|
||||||
function decodeKeyExchangeMessageProtobuf(string) {
|
function decodeKeyExchangeMessageProtobuf(string) {
|
||||||
return KeyExchangeMessageProtobuf.decode(btoa(string));
|
return KeyExchangeMessageProtobuf.decode(btoa(string));
|
||||||
}
|
}
|
||||||
|
@ -256,6 +256,10 @@ function getRandomBytes(size) {
|
||||||
(function(crypto, $, undefined) {
|
(function(crypto, $, undefined) {
|
||||||
var createNewKeyPair = function() {
|
var createNewKeyPair = function() {
|
||||||
//TODO
|
//TODO
|
||||||
|
var privKey = getRandomBytes(32);
|
||||||
|
privKey[0] &= 248;
|
||||||
|
privKey[31] &= 127;
|
||||||
|
privKey[31] |= 64;
|
||||||
var pubKey = "BRTJzsHPUWRRBxyo5MoaBRidMk2fwDlfqvU91b6pzbED";
|
var pubKey = "BRTJzsHPUWRRBxyo5MoaBRidMk2fwDlfqvU91b6pzbED";
|
||||||
var privKey = "";
|
var privKey = "";
|
||||||
return { pubKey: pubKey, privKey: privKey };
|
return { pubKey: pubKey, privKey: privKey };
|
||||||
|
@ -264,7 +268,7 @@ function getRandomBytes(size) {
|
||||||
var crypto_storage = {};
|
var crypto_storage = {};
|
||||||
|
|
||||||
crypto_storage.getNewPubKeySTORINGPrivKey = function(keyName) {
|
crypto_storage.getNewPubKeySTORINGPrivKey = function(keyName) {
|
||||||
var keyPair = crypto._createNewKeyPair();
|
var keyPair = createNewKeyPair();
|
||||||
storage.putEncrypted("25519Key" + keyName, keyPair);
|
storage.putEncrypted("25519Key" + keyName, keyPair);
|
||||||
return keyPair.pubKey;
|
return keyPair.pubKey;
|
||||||
}
|
}
|
||||||
|
@ -393,7 +397,7 @@ function getRandomBytes(size) {
|
||||||
var masterKey = HKDF(ECDHE(remoteKey, ratchet.ephemeralKeyPair.privKey), ratchet.rootKey, "WhisperRatchet");
|
var masterKey = HKDF(ECDHE(remoteKey, ratchet.ephemeralKeyPair.privKey), ratchet.rootKey, "WhisperRatchet");
|
||||||
session[remoteKey] = { messageKeys: {}, chainKey: { counter: 0, key: masterKey.substring(32, 64) } };
|
session[remoteKey] = { messageKeys: {}, chainKey: { counter: 0, key: masterKey.substring(32, 64) } };
|
||||||
|
|
||||||
ratchet.ephemeralKeyPair = _createNewKeyPair();
|
ratchet.ephemeralKeyPair = createNewKeyPair();
|
||||||
masterKey = HKDF(ECDHE(remoteKey, ratchet.ephemeralKeyPair.privKey), masterKey.substring(0, 32), "WhisperRatchet");
|
masterKey = HKDF(ECDHE(remoteKey, ratchet.ephemeralKeyPair.privKey), masterKey.substring(0, 32), "WhisperRatchet");
|
||||||
ratchet.rootKey = masterKey.substring(0, 32);
|
ratchet.rootKey = masterKey.substring(0, 32);
|
||||||
session[nextRatchet.ephemeralKeyPair.pubKey] = { messageKeys: {}, chainKey: { counter: 0, key: masterKey.substring(32, 64) } };
|
session[nextRatchet.ephemeralKeyPair.pubKey] = { messageKeys: {}, chainKey: { counter: 0, key: masterKey.substring(32, 64) } };
|
|
@ -16,8 +16,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"background": {
|
"background": {
|
||||||
"scripts": [ "jquery.js", "jquery.atmosphere.js", "aes.js", "hmac-sha256.js", "lib-typedarrays.js",
|
"scripts": [ "js-deps/jquery.js", "js-deps/jquery.atmosphere.js", "js-deps/aes.js", "js-deps/hmac-sha256.js", "js-deps/lib-typedarrays.js",
|
||||||
"Long.min.js", "ByteBuffer.min.js", "ProtoBuf.min.js", "helpers.js", "background.js" ]
|
"js-deps/Long.min.js", "js-deps/ByteBuffer.min.js", "js-deps/ProtoBuf.min.js", "js/helpers.js", "js/background.js" ]
|
||||||
},
|
},
|
||||||
|
|
||||||
"options_page": "options.html"
|
"options_page": "options.html"
|
||||||
|
|
20
options.html
20
options.html
|
@ -22,15 +22,15 @@
|
||||||
<h2>You are now registered on TextSecure with number <span id="complete-number"></span></h2>
|
<h2>You are now registered on TextSecure with number <span id="complete-number"></span></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.js"></script>
|
||||||
<script type="text/javascript" src="jquery.atmosphere.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.atmosphere.js"></script>
|
||||||
<script type="text/javascript" src="aes.js"></script>
|
<script type="text/javascript" src="js-deps/aes.js"></script>
|
||||||
<script type="text/javascript" src="hmac-sha256.js"></script>
|
<script type="text/javascript" src="js-deps/hmac-sha256.js"></script>
|
||||||
<script type="text/javascript" src="lib-typedarrays.js"></script>
|
<script type="text/javascript" src="js-deps/lib-typedarrays.js"></script>
|
||||||
<script type="text/javascript" src="Long.min.js"></script>
|
<script type="text/javascript" src="js-deps/Long.min.js"></script>
|
||||||
<script type="text/javascript" src="ByteBuffer.min.js"></script>
|
<script type="text/javascript" src="js-deps/ByteBuffer.min.js"></script>
|
||||||
<script type="text/javascript" src="ProtoBuf.min.js"></script>
|
<script type="text/javascript" src="js-deps/ProtoBuf.min.js"></script>
|
||||||
<script type="text/javascript" src="helpers.js"></script>
|
<script type="text/javascript" src="js/helpers.js"></script>
|
||||||
<script type="text/javascript" src="options.js"></script>
|
<script type="text/javascript" src="js/options.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
20
popup.html
20
popup.html
|
@ -10,15 +10,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="send" style="display:none;"></div>
|
<div id="send" style="display:none;"></div>
|
||||||
|
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.js"></script>
|
||||||
<script type="text/javascript" src="jquery.atmosphere.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.atmosphere.js"></script>
|
||||||
<script type="text/javascript" src="aes.js"></script>
|
<script type="text/javascript" src="js-deps/aes.js"></script>
|
||||||
<script type="text/javascript" src="hmac-sha256.js"></script>
|
<script type="text/javascript" src="js-deps/hmac-sha256.js"></script>
|
||||||
<script type="text/javascript" src="lib-typedarrays.js"></script>
|
<script type="text/javascript" src="js-deps/lib-typedarrays.js"></script>
|
||||||
<script type="text/javascript" src="Long.min.js"></script>
|
<script type="text/javascript" src="js-deps/Long.min.js"></script>
|
||||||
<script type="text/javascript" src="ByteBuffer.min.js"></script>
|
<script type="text/javascript" src="js-deps/ByteBuffer.min.js"></script>
|
||||||
<script type="text/javascript" src="ProtoBuf.min.js"></script>
|
<script type="text/javascript" src="js-deps/ProtoBuf.min.js"></script>
|
||||||
<script type="text/javascript" src="helpers.js"></script>
|
<script type="text/javascript" src="js/helpers.js"></script>
|
||||||
<script type="text/javascript" src="popup.js"></script>
|
<script type="text/javascript" src="js/popup.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
20
test.html
20
test.html
|
@ -8,14 +8,14 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript" src="jquery.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.js"></script>
|
||||||
<script type="text/javascript" src="jquery.atmosphere.js"></script>
|
<script type="text/javascript" src="js-deps/jquery.atmosphere.js"></script>
|
||||||
<script type="text/javascript" src="aes.js"></script>
|
<script type="text/javascript" src="js-deps/aes.js"></script>
|
||||||
<script type="text/javascript" src="hmac-sha256.js"></script>
|
<script type="text/javascript" src="js-deps/hmac-sha256.js"></script>
|
||||||
<script type="text/javascript" src="lib-typedarrays.js"></script>
|
<script type="text/javascript" src="js-deps/lib-typedarrays.js"></script>
|
||||||
<script type="text/javascript" src="Long.min.js"></script>
|
<script type="text/javascript" src="js-deps/Long.min.js"></script>
|
||||||
<script type="text/javascript" src="ByteBuffer.min.js"></script>
|
<script type="text/javascript" src="js-deps/ByteBuffer.min.js"></script>
|
||||||
<script type="text/javascript" src="ProtoBuf.min.js"></script>
|
<script type="text/javascript" src="js-deps/ProtoBuf.min.js"></script>
|
||||||
<script type="text/javascript" src="helpers.js"></script>
|
<script type="text/javascript" src="js/helpers.js"></script>
|
||||||
<script type="text/javascript" src="test.js"></script>
|
<script type="text/javascript" src="js/test.js"></script>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue