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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