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/security/ExportE2eKeysDialog.js","webpack:///./node_modules/file-saver/dist/FileSaver.min.js","webpack:///./node_modules/matrix-react-sdk/src/utils/MegolmExportEncryption.js"],"names":["ExportE2eKeysDialog","React","Component","constructor","props","super","ev","preventDefault","passphrase","this","_passphrase1","current","value","_passphrase2","setState","errStr","_t","_startExport","onFinished","_unmounted","createRef","state","phase","componentWillUnmount","Promise","resolve","then","matrixClient","exportRoomKeys","k","MegolmExportEncryption","JSON","stringify","f","blob","Blob","type","FileSaver","saveAs","catch","e","console","error","msg","friendlyText","render","BaseDialog","sdk","disableForm","className","title","onSubmit","_onPassphraseFormSubmit","htmlFor","ref","id","autoFocus","size","disabled","onClick","_onCancelClick","PropTypes","instanceOf","MatrixClient","isRequired","func","c","a","b","d","XMLHttpRequest","open","responseType","onload","g","response","onerror","send","status","dispatchEvent","MouseEvent","document","createEvent","initMouseEvent","window","self","global","navigator","test","userAgent","HTMLAnchorElement","prototype","h","i","URL","webkitURL","j","createElement","name","download","rel","href","origin","location","target","createObjectURL","setTimeout","revokeObjectURL","msSaveOrOpenBlob","autoBom","warn","body","innerText","HTMLElement","safari","FileReader","onloadend","result","replace","readAsDataURL","l","m","module","exports","TextEncoder","TextEncodingUtf8","TextDecoder","subtleCrypto","crypto","subtle","webkitSubtle","friendlyError","Error","cryptoFailMsg","async","decryptMegolmKeyFile","data","password","fileStr","decode","Uint8Array","lineStart","lineEnd","indexOf","line","slice","trim","HEADER_LINE","dataStart","undefined","dataEnd","base64","latin1String","atob","uint8Array","length","charCodeAt","decodeBase64","unpackMegolmKeyFile","brand","SdkConfig","get","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","String","fromCharCode","apply","btoa"],"mappings":"qPA4Be,MAAMA,UAA4BC,IAAMC,UAMnDC,YAAYC,GACRC,MAAMD,GADS,mCAkBQE,IACvBA,EAAGC,iBAEH,MAAMC,EAAaC,KAAKC,aAAaC,QAAQC,MAC7C,OAAIJ,IAAeC,KAAKI,aAAaF,QAAQC,OACzCH,KAAKK,SAAS,CAACC,OAAQC,YAAG,6BACnB,GAENR,GAKLC,KAAKQ,aAAaT,IACX,IALHC,KAAKK,SAAS,CAACC,OAAQC,YAAG,mCACnB,KA5BI,0BAoEDV,IACdA,EAAGC,iBACHE,KAAKL,MAAMc,YAAW,IACf,IApEPT,KAAKU,YAAa,EAElBV,KAAKC,aAAeU,sBACpBX,KAAKI,aAAeO,sBAEpBX,KAAKY,MAAQ,CACTC,MAlBO,EAmBPP,OAAQ,MAIhBQ,uBACId,KAAKU,YAAa,EAoBtBF,aAAaT,GAGTgB,QAAQC,UAAUC,KAAK,IACZjB,KAAKL,MAAMuB,aAAaC,kBAChCF,KAAMG,GACEC,IACHC,KAAKC,UAAUH,GAAIrB,IAExBkB,KAAMO,IACL,MAAMC,EAAO,IAAIC,KAAK,CAACF,GAAI,CACvBG,KAAM,gCAEVC,IAAUC,OAAOJ,EAAM,oBACvBzB,KAAKL,MAAMc,YAAW,KACvBqB,MAAOC,IAEN,GADAC,QAAQC,MAAM,4BAA6BF,GACvC/B,KAAKU,WACL,OAEJ,MAAMwB,EAAMH,EAAEI,cAAgB5B,YAAG,iBACjCP,KAAKK,SAAS,CACVC,OAAQ4B,EACRrB,MAnEG,MAuEXb,KAAKK,SAAS,CACVC,OAAQ,KACRO,MAxEY,IAkFpBuB,SACI,MAAMC,EAAaC,eAAiB,4BAE9BC,E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