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

{"version":3,"sources":["webpack:///./node_modules/matrix-react-sdk/src/async-components/views/dialogs/ExportE2eKeysDialog.js","webpack:///./node_modules/file-saver/FileSaver.js","webpack:///(webpack)/buildin/amd-define.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./node_modules/matrix-react-sdk/src/utils/MegolmExportEncryption.js"],"names":["createReactClass","displayName","propTypes","matrixClient","PropTypes","instanceOf","MatrixClient","isRequired","onFinished","func","getInitialState","phase","errStr","UNSAFE_componentWillMount","this","_unmounted","_passphrase1","createRef","_passphrase2","componentWillUnmount","_onPassphraseFormSubmit","ev","preventDefault","passphrase","current","value","setState","_t","_startExport","Promise","resolve","then","props","exportRoomKeys","k","MegolmExportEncryption","JSON","stringify","f","blob","Blob","type","FileSaver","saveAs","catch","e","console","error","msg","friendlyText","_onCancelClick","render","BaseDialog","sdk","disableForm","state","className","title","onSubmit","htmlFor","ref","id","autoFocus","size","disabled","onClick","view","navigator","test","userAgent","doc","document","get_URL","URL","webkitURL","save_link","createElementNS","can_use_save_link","is_safari","HTMLElement","safari","is_chrome_ios","throw_outside","ex","setImmediate","setTimeout","revoke","file","revokeObjectURL","remove","auto_bom","String","fromCharCode","name","no_auto_bom","object_url","filesaver","force","dispatch_all","event_types","event","i","concat","length","listener","call","dispatch","split","readyState","INIT","createObjectURL","node","href","download","MouseEvent","dispatchEvent","DONE","FileReader","reader","onloadend","url","result","replace","open","location","undefined","readAsDataURL","fs_error","FS_proto","prototype","msSaveOrOpenBlob","abort","WRITING","onwritestart","onprogress","onwrite","onabort","onerror","onwriteend","self","window","content","module","exports","Error","__webpack_amd_options__","TextEncoder","TextEncodingUtf8","TextDecoder","subtleCrypto","crypto","subtle","webkitSubtle","friendlyError","cryptoFailMsg","async","decryptMegolmKeyFile","data","password","body","fileStr","decode","Uint8Array","lineStart","lineEnd","indexOf","line","slice","trim","HEADER_LINE","dataStart","dataEnd","base64","latin1String","atob","uint8Array","charCodeAt","decodeBase64","unpackMegolmKeyFile","ciphertextLength","salt","subarray","iv","iterations","ciphertext","hmac","aesKey","hmacKey","deriveKeys","toVerify","isValid","plaintext","verify","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","apply","btoa"],"mappings":";2FAAA,iHA6BeA,cAAiB,CAC5BC,YAAa,sBAEbC,UAAW,CACPC,aAAcC,IAAUC,WAAWC,KAAcC,WACjDC,WAAYJ,IAAUK,KAAKF,YAG/BG,gBAAiB,WACb,MAAO,CACHC,MAbO,EAcPC,OAAQ,OAKhBC,0BAA2B,WACvBC,KAAKC,YAAa,EAElBD,KAAKE,aAAeC,sBACpBH,KAAKI,aAAeD,uBAGxBE,qBAAsB,WAClBL,KAAKC,YAAa,GAGtBK,wBAAyB,SAASC,GAC9BA,EAAGC,iBAEH,MAAMC,EAAaT,KAAKE,aAAaQ,QAAQC,MAC7C,OAAIF,IAAeT,KAAKI,aAAaM,QAAQC,OACzCX,KAAKY,SAAS,CAACd,OAAQe,YAAG,6BACnB,GAENJ,GAKLT,KAAKc,aAAaL,IACX,IALHT,KAAKY,SAAS,CAACd,OAAQe,YAAG,mCACnB,IAOfC,aAAc,SAASL,GAGnBM,QAAQC,UAAUC,KAAK,IACZjB,KAAKkB,MAAM7B,aAAa8B,kBAChCF,KAAMG,GACEC,IACHC,KAAKC,UAAUH,GAAIX,IAExBQ,KAAMO,IACL,MAAMC,EAAO,IAAIC,KAAK,CAACF,GAAI,CACvBG,KAAM,gCAEVC,IAAUC,OAAOJ,EAAM,iBACvBzB,KAAKkB,MAAMxB,YAAW,KACvBoC,MAAOC,IAEN,GADAC,QAAQC,MAAM,4BAA6BF,GACvC/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