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

{"version":3,"sources":["webpack:///./node_modules/matrix-react-sdk/src/async-components/views/dialogs/ImportE2eKeysDialog.js","webpack:///./node_modules/matrix-react-sdk/src/utils/MegolmExportEncryption.js"],"names":["createReactClass","displayName","propTypes","matrixClient","PropTypes","instanceOf","MatrixClient","isRequired","onFinished","func","getInitialState","enableSubmit","phase","errStr","UNSAFE_componentWillMount","this","_unmounted","_file","createRef","_passphrase","componentWillUnmount","_onFormChange","ev","files","current","setState","value","length","_onFormSubmit","preventDefault","_startImport","file","passphrase","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsArrayBuffer","readFileAsArrayBuffer","then","arrayBuffer","MegolmExportEncryption","keys","props","importRoomKeys","JSON","parse","catch","console","error","msg","friendlyText","_t","_onCancelClick","render","BaseDialog","sdk","disableForm","state","className","title","onSubmit","htmlFor","ref","id","type","autoFocus","onChange","disabled","size","onClick","TextEncoder","window","TextEncodingUtf8","TextDecoder","subtleCrypto","crypto","subtle","webkitSubtle","friendlyError","Error","cryptoFailMsg","async","decryptMegolmKeyFile","data","password","body","fileStr","decode","Uint8Array","lineStart","lineEnd","indexOf","line","slice","trim","HEADER_LINE","dataStart","undefined","dataEnd","base64","latin1String","atob","uint8Array","i","charCodeAt","decodeBase64","unpackMegolmKeyFile","ciphertextLength","salt","subarray","iv","iterations","ciphertext","hmac","aesKey","hmacKey","deriveKeys","toVerify","isValid","plaintext","verify","name","decrypt","counter","encryptMegolmKeyFile","options","kdfRounds","kdf_rounds","getRandomValues","encodedData","encode","encrypt","cipherArray","bodyLength","resultBuffer","idx","set","toSign","sign","hmacArray","nLines","Math","ceil","lines","Array","o","encodeBase64","join","buffer","packMegolmKeyFile","start","Date","key","keybits","importKey","deriveBits","hash","now","log","aesProm","hmacProm","all","String","fromCharCode","apply","btoa"],"mappings":"4FAAA,+FAwCeA,cAAiB,CAC5BC,YAAa,sBAEbC,UA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