You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
8.7 KiB

{"version":3,"sources":["webpack:///./node_modules/matrix-react-sdk/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx","webpack:///./node_modules/matrix-react-sdk/src/utils/MegolmExportEncryption.ts"],"names":["Phase","ImportE2eKeysDialog","React","Component","constructor","props","super","_defineProperty","createRef","_this$file$current","files","this","file","current","setState","enableSubmit","state","passphrase","length","ev","target","value","onFormChange","_this$file$current2","_this$file$current2$f","preventDefault","startImport","onFinished","phase","Edit","errStr","componentWillUnmount","unmounted","Importing","Promise","resolve","reject","reader","FileReader","onload","e","_e$target","result","Error","onerror","readAsArrayBuffer","readFileAsArrayBuffer","then","arrayBuffer","MegolmExportEncryption","keys","matrixClient","importRoomKeys","JSON","parse","catch","logger","error","msg","friendlyText","_t","render","disableForm","createElement","BaseDialog","className","title","onSubmit","onFormSubmit","htmlFor","ref","id","type","autoFocus","onChange","disabled","Field","label","onPassphraseChange","size","onClick","onCancelClick","subtleCrypto","window","crypto","subtle","webkitSubtle","friendlyError","message","cryptoFailMsg","async","decryptMegolmKeyFile","data","password","body","fileStr","TextDecoder","decode","Uint8Array","lineStart","lineEnd","indexOf","line","slice","trim","HEADER_LINE","dataStart","undefined","TRAILER_LINE","dataEnd","base64","latin1String","atob","uint8Array","i","charCodeAt","decodeBase64","unpackMegolmKeyFile","brand","SdkConfig","get","ciphertextLength","salt","subarray","iv","iterations","ciphertext","hmac","aesKey","hmacKey","deriveKeys","toVerify","isValid","plaintext","verify","name","decrypt","counter","encryptMegolmKeyFile","options","kdfRounds","kdf_rounds","getRandomValues","encodedData","TextEncoder","encode","encrypt","cipherArray","bodyLength","resultBuffer","idx","set","toSign","sign","hmacArray","LINE_LENGTH","nLines","Math","ceil","lines","Array","o","encodeBase64","join","buffer","packMegolmKeyFile","start","Date","key","keybits","importKey","deriveBits","hash","now","log","getTime","aesProm","hmacProm","all","String","fromCharCode","apply","from","btoa"],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