diff --git a/background.html b/background.html index 6a3ee28aa..41933bde8 100644 --- a/background.html +++ b/background.html @@ -50,6 +50,6 @@ - + diff --git a/js/background.js b/js/main_start.js similarity index 99% rename from js/background.js rename to js/main_start.js index aa2f349bc..ab8d87e51 100644 --- a/js/background.js +++ b/js/main_start.js @@ -170,7 +170,7 @@ ]); } catch (error) { window.log.error( - 'background.js: ConversationController failed to load:', + 'main_start.js: ConversationController failed to load:', error && error.stack ? error.stack : error ); } finally { @@ -230,7 +230,7 @@ }); // FIXME audric2 ExpiringMessagesListener Whisper.Expi - throw new Error('plop'); + // throw new Error('plop'); Whisper.ExpiringMessagesListener.init(Whisper.events); if (Whisper.Registration.isDone() && !window.textsecure.storage.user.isSignInByLinking()) { diff --git a/js/modules/signal.js b/js/modules/signal.js index d0eece3d0..01fe3f038 100644 --- a/js/modules/signal.js +++ b/js/modules/signal.js @@ -4,7 +4,6 @@ const Crypto = require('./crypto'); const Data = require('../../ts/data/data'); const OS = require('../../ts/OS'); const Util = require('../../ts/util'); -const { Message } = require('../../ts/components/conversation/message/message-item/Message'); // Components const { @@ -19,7 +18,6 @@ exports.setup = () => { const Components = { SessionInboxView, SessionRegistrationView, - Message, }; return { diff --git a/ts/components/registration/RegistrationStages.tsx b/ts/components/registration/RegistrationStages.tsx index 4f1f8a63f..0bbe5a1c0 100644 --- a/ts/components/registration/RegistrationStages.tsx +++ b/ts/components/registration/RegistrationStages.tsx @@ -65,7 +65,7 @@ export async function signUp(signUpDetails: { value: true, timestamp: Date.now(), }); - setSignWithRecoveryPhrase(false); + await setSignWithRecoveryPhrase(false); trigger('openInbox'); } catch (e) { await resetRegistration(); @@ -96,7 +96,7 @@ export async function signInWithRecovery(signInDetails: { await resetRegistration(); await registerSingleDevice(userRecoveryPhrase, 'english', trimName); - setSignWithRecoveryPhrase(true); + await setSignWithRecoveryPhrase(true); trigger('openInbox'); } catch (e) { diff --git a/ts/components/registration/SessionRegistrationView.tsx b/ts/components/registration/SessionRegistrationView.tsx index 41919d3ef..9e2b77faa 100644 --- a/ts/components/registration/SessionRegistrationView.tsx +++ b/ts/components/registration/SessionRegistrationView.tsx @@ -10,7 +10,7 @@ import { setSignInByLinking } from '../../util/storage'; export const SessionRegistrationView = () => { useEffect(() => { - setSignInByLinking(false); + void setSignInByLinking(false); }, []); return ( diff --git a/ts/receiver/receiver.ts b/ts/receiver/receiver.ts index 5e4270eea..679542719 100644 --- a/ts/receiver/receiver.ts +++ b/ts/receiver/receiver.ts @@ -145,7 +145,7 @@ export function handleRequest(plaintext: any, options: ReqOptions, messageHash: // tslint:enable:cyclomatic-complexity max-func-body-length */ /** - * Used in background.js + * Used in main_start.js */ export async function queueAllCached() { const items = await getAllFromCache(); diff --git a/ts/updater/curve.ts b/ts/updater/curve.ts deleted file mode 100644 index 150954d51..000000000 --- a/ts/updater/curve.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { randomBytes } from 'crypto'; - -const g = global as any; - -// Because curve wrapper will populate this -g.Internal = {}; - -// Because curve wrapper uses 'Module' to get at curve-provided functionality -// tslint:disable-next-line -g.Module = require('../../js/curve/curve25519_compiled'); -// tslint:disable-next-line -require('../../js/curve/curve25519_wrapper'); - -export type BinaryType = Uint8Array | Buffer; - -interface CurveType { - keyPair: ( - privateKey: BinaryType - ) => { - pubKey: BinaryType; - privKey: BinaryType; - }; - sign: (privateKey: BinaryType, message: BinaryType) => BinaryType; - verify: (publicKey: BinaryType, message: BinaryType, signature: BinaryType) => boolean; -} - -const { keyPair: internalKeyPair, sign: internalSign, verify: internalVerify } = g.Internal - .curve25519 as CurveType; - -export function keyPair() { - const privateKey = randomBytes(32); - const { pubKey, privKey } = internalKeyPair(privateKey); - - return { - publicKey: pubKey, - privateKey: privKey, - }; -} - -export function sign(privateKey: BinaryType, message: BinaryType) { - return internalSign(privateKey, message); -} - -export function verify(publicKey: BinaryType, message: BinaryType, signature: BinaryType) { - const failed = internalVerify(publicKey, message, signature); - - return !failed; -}