hfs 3.4.0-rc5 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -10
- package/admin/assets/{AccountsPage-DZquVXTq.js → AccountsPage-CccLe8WU.js} +1 -1
- package/admin/assets/{ConfigFilePage-2CNjyGYK.js → ConfigFilePage-C3uOw-DT.js} +2 -2
- package/admin/assets/{CustomHtmlPage-DvrCDA49.js → CustomHtmlPage-BsX3b42n.js} +1 -1
- package/admin/assets/{InternetPage-Bw5c5UON.js → InternetPage-Dl_B1Xav.js} +2 -2
- package/admin/assets/{LangPage-CPApewUD.js → LangPage-B1mFaZz9.js} +1 -1
- package/admin/assets/{LogsPage-CN3-77d7.js → LogsPage-DjlcP9wy.js} +1 -1
- package/admin/assets/{MonitorPage-BxTrgouD.js → MonitorPage-B1olBuuq.js} +1 -1
- package/admin/assets/OptionsPage-kU5ukyzj.js +3 -0
- package/admin/assets/{PluginsPage-CbPsTIZY.js → PluginsPage-Cgsh0PoM.js} +1 -1
- package/admin/assets/{icons-Diw9EPUy.js → icons-D8-3FA01.js} +1 -1
- package/admin/assets/{index-Dq6SXYHr.js → index-yAP15aPJ.js} +7 -7
- package/admin/assets/{routing-DVx3FwrV.js → routing-CdjvMQLF.js} +1 -1
- package/admin/index.html +1 -1
- package/frontend/assets/{dist-legacy-C1KtEPEq.js → dist-legacy-UZ_kPF9O.js} +1 -1
- package/frontend/assets/{index-legacy-B0z78Sy4.js → index-legacy-CBijyHQo.js} +5 -5
- package/frontend/assets/{lib-legacy-DLNe7tmt.js → lib-legacy-DKlstKVQ.js} +1 -1
- package/frontend/assets/{sha512-legacy-CITTud99.js → sha512-legacy-D7dEZnZF.js} +1 -1
- package/frontend/index.html +1 -1
- package/npm-shrinkwrap.json +141 -111
- package/package.json +8 -3
- package/src/admin-langs/hfs-admin-lang-ar.json +4 -6
- package/src/admin-langs/hfs-admin-lang-bg.json +4 -6
- package/src/admin-langs/hfs-admin-lang-de.json +4 -6
- package/src/admin-langs/hfs-admin-lang-el.json +4 -6
- package/src/admin-langs/hfs-admin-lang-en.json +4 -6
- package/src/admin-langs/hfs-admin-lang-es.json +4 -6
- package/src/admin-langs/hfs-admin-lang-fi.json +4 -6
- package/src/admin-langs/hfs-admin-lang-fr.json +4 -6
- package/src/admin-langs/hfs-admin-lang-hu.json +4 -6
- package/src/admin-langs/hfs-admin-lang-it.json +4 -6
- package/src/admin-langs/hfs-admin-lang-ja.json +4 -6
- package/src/admin-langs/hfs-admin-lang-ko.json +4 -6
- package/src/admin-langs/hfs-admin-lang-lt.json +4 -6
- package/src/admin-langs/hfs-admin-lang-ms.json +4 -6
- package/src/admin-langs/hfs-admin-lang-nl.json +4 -6
- package/src/admin-langs/hfs-admin-lang-pl.json +4 -6
- package/src/admin-langs/hfs-admin-lang-pt-br.json +4 -6
- package/src/admin-langs/hfs-admin-lang-ro.json +4 -6
- package/src/admin-langs/hfs-admin-lang-ru.json +4 -6
- package/src/admin-langs/hfs-admin-lang-sr-latn.json +4 -6
- package/src/admin-langs/hfs-admin-lang-sr.json +4 -6
- package/src/admin-langs/hfs-admin-lang-th.json +4 -6
- package/src/admin-langs/hfs-admin-lang-tr.json +4 -6
- package/src/admin-langs/hfs-admin-lang-uk.json +4 -6
- package/src/admin-langs/hfs-admin-lang-vi.json +4 -6
- package/src/admin-langs/hfs-admin-lang-zh-hant.json +4 -6
- package/src/admin-langs/hfs-admin-lang-zh.json +4 -6
- package/src/basicWeb.js +7 -5
- package/src/fileAttr.js +1 -1
- package/src/middlewares.js +5 -4
- package/src/multipartUpload.js +5 -3
- package/src/plugins.js +2 -2
- package/src/serveGuiAndSharedFiles.js +4 -4
- package/src/upload.js +13 -7
- package/admin/assets/OptionsPage-Tyjx_S1U.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-8BhlS34s.js";import{Yn as t,rn as n,yr as r}from"./index-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-8BhlS34s.js";import{Yn as t,rn as n,yr as r}from"./index-yAP15aPJ.js";var i=e(r());function a(e,r){let[a,o]=n(),s=`/${e}/`,c=Math.max(0,r.indexOf(t(s,a)));return(0,i.useEffect)(()=>{let t=`/${e}/${r[c]}`;a!==t&&o(t,{replace:!0})},[e,o,a,c,r]),[c,l];function l(t){o(`/${e}/${r[t]}`)}}export{a as t};
|
package/admin/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link href="../frontend/fontello.css" rel="stylesheet" />
|
|
9
9
|
<link href="/flags/freakflags.css" rel="stylesheet" />
|
|
10
10
|
<link href="../frontend/fontello.woff2" rel="prefetch" />
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-yAP15aPJ.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-8BhlS34s.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/index-mI9kZlpb.css">
|
|
14
14
|
</head>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){function e(){var n,r,i=typeof Symbol==`function`?Symbol:{},a=i.iterator||`@@iterator`,o=i.toStringTag||`@@toStringTag`;function s(e,i,a,o){var s=i&&i.prototype instanceof l?i:l,u=Object.create(s.prototype);return t(u,`_invoke`,function(e,t,i){var a,o,s,l=0,u=i||[],d=!1,f={p:0,n:0,v:n,a:p,f:p.bind(n,4),d:function(e,t){return a=e,o=0,s=n,f.n=t,c}};function p(e,t){for(o=e,s=t,r=0;!d&&l&&!i&&r<u.length;r++){var i,a=u[r],p=f.p,m=a[2];e>3?(i=m===t)&&(s=a[(o=a[4])?5:(o=3,3)],a[4]=a[5]=n):a[0]<=p&&((i=e<2&&p<a[1])?(o=0,f.v=t,f.n=a[1]):p<m&&(i=e<3||a[0]>t||t>m)&&(a[4]=e,a[5]=t,f.n=m,o=0))}if(i||e>1)return c;throw d=!0,t}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),o=u,s=m;(r=o<2?n:s)||!d;){a||(o?o<3?(o>1&&(f.n=-1),p(o,s)):f.n=s:f.v=s);try{if(l=2,a){if(o||(i=`next`),r=a[i]){if(!(r=r.call(a,s)))throw TypeError(`iterator result is not an object`);if(!r.done)return r;s=r.value,o<2&&(o=0)}else o===1&&(r=a.return)&&r.call(a),o<2&&(s=TypeError(`The iterator does not provide a '`+i+`' method`),o=1);a=n}else if((r=(d=f.n<0)?s:e.call(t,f))!==c)break}catch(e){a=n,o=1,s=e}finally{l=1}}return{value:r,done:d}}}(e,a,o),!0),u}var c={};function l(){}function u(){}function d(){}r=Object.getPrototypeOf;var f=[][a]?r(r([][a]())):(t(r={},a,function(){return this}),r),p=d.prototype=l.prototype=Object.create(f);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,t(e,o,`GeneratorFunction`)),e.prototype=Object.create(p),e}return u.prototype=d,t(p,`constructor`,d),t(d,`constructor`,u),u.displayName=`GeneratorFunction`,t(d,o,`GeneratorFunction`),t(p),t(p,o,`Generator`),t(p,a,function(){return this}),t(p,`toString`,function(){return`[object Generator]`}),(e=function(){return{w:s,m}})()}function t(e,n,r,i){var a=Object.defineProperty;try{a({},``,{})}catch(e){a=0}t=function(e,n,r,i){function o(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?a?a(e,n,{value:r,enumerable:!i,configurable:!i,writable:!i}):e[n]=r:(o(`next`,0),o(`throw`,1),o(`return`,2))},t(e,n,r,i)}function n(e){return o(e)||a(e)||i(e)||r()}function r(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){if(e){if(typeof e==`string`)return s(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function a(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function o(e){if(Array.isArray(e))return s(e)}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=d(e,`string`);return typeof t==`symbol`?t:t+``}function d(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}System.register([`./index-legacy-B0z78Sy4.js`],function(t,r){var i,a,o,s,c,u,d,p,m;return{setters:[function(e){i=e.t}],execute:function(){a=i(function(e,t){t.exports={}}),o=i(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crossEnvCrypto=void 0;try{var t=typeof window<`u`&&window.crypto||a().webcrypto;if(t){if(!t.subtle)throw Error(`Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.`);var n=function(e){return function(n){return t.subtle.digest(e,n)}};e.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:n(`SHA-1`),SHA256:n(`SHA-256`),SHA384:n(`SHA-384`),SHA512:n(`SHA-512`)}}}else{var r=a(),i=function(e){return function(t){return r.createHash(e).update(t).digest().buffer}};e.crossEnvCrypto={randomBytes:r.randomFillSync,hashFunctions:{SHA1:i(`sha1`),SHA256:i(`sha256`),SHA384:i(`sha384`),SHA512:i(`sha512`)}}}}catch(e){throw console.error(e),Error(`No suitable crypto library was found. You may need a polyfill.`)}}),s=i(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SRPParameters=void 0;var t=o(),n=l(function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.PrimeGroup[2048],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.H.SHA512;if(f(this,e),this.primeGroup=t,this.H=n,this.NBits=this.primeGroup.N.toString(2).length,!n)throw Error(`Hash function required`)});e.SRPParameters=n,n.PrimeGroup={256:{N:BigInt(`125617018995153554710546479714086468244499594888726646874671447258204721048803`),g:BigInt(2)},512:{N:BigInt(`11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603`),g:BigInt(2)},768:{N:BigInt(`1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147`),g:BigInt(2)},1024:{N:BigInt(`167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939`),g:BigInt(2)},1536:{N:BigInt(`1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587`),g:BigInt(2)},2048:{N:BigInt(`21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819`),g:BigInt(2)}},n.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512}}),c=i(function(t){var r=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.modPow=t.hashBitCount=t.createVerifierAndSalt=t.createVerifier=t.generateRandomBigInt=t.generateRandomString=t.hashPadded=t.hash=t.padStartArrayBuffer=t.stringToArrayBuffer=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=void 0;var i=o(),a=BigInt(0),s=BigInt(1),c=BigInt(2);t.bigIntToArrayBuffer=function(e){var t=e.toString(16),n=new ArrayBuffer(Math.ceil(t.length/2)),r=new Uint8Array(n),i=0;t.length%2!=0&&(r[0]=parseInt(t[0],16),i=1);for(var a=0;a<n.byteLength;a++)r[a+i]=parseInt(t.slice(2*a+i,2*a+2+i),16);return n},t.arrayBufferToBigInt=function(e){var t=[];return new Uint8Array(e).forEach(function(e){t.push((`0`+e.toString(16)).slice(-2))}),BigInt(`0x${t.join(``)}`)};function l(e){return new TextEncoder().encode(e).buffer}t.stringToArrayBuffer=l,t.padStartArrayBuffer=function(e,t){var n=new Uint8Array(e);if(n.length<t){var r=new Uint8Array(t);return r.fill(0,0,t-n.length),r.set(n,t-n.length),r}return n};function u(e){for(var t=[...arguments].slice(1),n=t.reduce(function(e,t){return e+t.byteLength},0),r=new Uint8Array(n),i=0,a=0;a<t.length;a++)r.set(new Uint8Array(t[a]),i),i+=t[a].byteLength;return e.H(r)}t.hash=u;function d(e,r){var i=[...arguments].slice(2);return u.apply(void 0,[e].concat(n(i.map(function(e){return t.padStartArrayBuffer(e,r)}))))}t.hashPadded=d;function f(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=new Uint8Array(Math.ceil(Math.ceil(e/2)));return i.crossEnvCrypto.randomBytes(t),t.reduce(function(e,t){var n=t.toString(16).toString();return n.length===1?e+`0`+n:e+n},``).slice(0,e)}t.generateRandomString=f;function p(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16;return t.arrayBufferToBigInt(_(e))}t.generateRandomBigInt=p;function m(t,n,i,a){return r(this,void 0,void 0,e().m(function r(){var o;return e().w(function(e){for(;;)switch(e.n){case 0:if(n&&n.trim()){e.n=1;break}throw Error(`Identity (I) must not be null or empty.`);case 1:if(i){e.n=2;break}throw Error(`Salt (s) must not be null.`);case 2:if(a){e.n=3;break}throw Error(`Password (P) must not be null`);case 3:return e.n=4,t.computeX(n,i,a);case 4:return o=e.v,e.a(2,t.computeVerifier(o))}},r)}))}t.createVerifier=m;function h(t,n,i,a){return r(this,void 0,void 0,e().m(function r(){var o,s,c;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.generateRandomSalt(a);case 1:return o=e.v,s=o,e.n=2,m(t,n,o,i);case 2:return c=e.v,e.a(2,{s,v:c})}},r)}))}t.createVerifierAndSalt=h,t.hashBitCount=function(n){return r(void 0,void 0,void 0,e().m(function r(){var i;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u(n,t.bigIntToArrayBuffer(BigInt(1)));case 1:return i=e.v.byteLength,e.a(2,i*8)}},r)}))};function g(e,t,n){for(var r=s;t>a;)t%c==s?(r=e*r%n,t-=s):(e=e*e%n,t/=c);return r}t.modPow=g;var _=function(e){var t=new Uint8Array(e);return i.crossEnvCrypto.randomBytes(t),t.buffer}}),u=i(function(t){var n=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPRoutines=void 0;var r=c();t.SRPRoutines=function(){function t(e){f(this,t),this.parameters=e}return l(t,[{key:`hash`,value:function(){var e=[...arguments];return r.hash.apply(r,[this.parameters].concat(e))}},{key:`hashPadded`,value:function(){var e=Math.trunc((this.parameters.NBits+7)/8),t=[...arguments];return r.hashPadded.apply(r,[this.parameters,e].concat(t))}},{key:`computeK`,value:function(){return n(this,void 0,void 0,e().m(function t(){var n;return e().w(function(e){for(;;)switch(e.n){case 0:return n=r,e.n=1,this.hashPadded(r.bigIntToArrayBuffer(this.parameters.primeGroup.N),r.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 1:return e.a(2,n.arrayBufferToBigInt.call(n,e.v))}},t,this)}))}},{key:`generateRandomSalt`,value:function(t){return n(this,void 0,void 0,e().m(function n(){var i,a;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.hashBitCount(this.parameters);case 1:return i=e.v,a=t||2*i/8,e.a(2,r.generateRandomBigInt(a))}},n,this)}))}},{key:`computeX`,value:function(t,i,a){return n(this,void 0,void 0,e().m(function n(){var o,s,c;return e().w(function(e){for(;;)switch(e.n){case 0:return o=r,s=this,c=r.bigIntToArrayBuffer(i),e.n=1,this.computeIdentityHash(t,a);case 1:return e.n=2,s.hash.call(s,c,e.v);case 2:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}},n,this)}))}},{key:`computeXStep2`,value:function(t,i){return n(this,void 0,void 0,e().m(function n(){var a;return e().w(function(e){for(;;)switch(e.n){case 0:return a=r,e.n=1,this.hash(r.bigIntToArrayBuffer(t),i);case 1:return e.a(2,a.arrayBufferToBigInt.call(a,e.v))}},n,this)}))}},{key:`computeIdentityHash`,value:function(t,i){return n(this,void 0,void 0,e().m(function t(){return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hash(r.stringToArrayBuffer(i));case 1:return e.a(2,e.v)}},t,this)}))}},{key:`computeVerifier`,value:function(e){return r.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:`generatePrivateValue`,value:function(){var e=Math.max(256,this.parameters.NBits),t;do t=r.generateRandomBigInt(e/8)%this.parameters.primeGroup.N;while(t===BigInt(0));return t}},{key:`computeClientPublicValue`,value:function(e){return r.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:`isValidPublicValue`,value:function(e){return e%this.parameters.primeGroup.N!==BigInt(0)}},{key:`computeU`,value:function(t,i){return n(this,void 0,void 0,e().m(function n(){var a;return e().w(function(e){for(;;)switch(e.n){case 0:return a=r,e.n=1,this.hashPadded(r.bigIntToArrayBuffer(t),r.bigIntToArrayBuffer(i));case 1:return e.a(2,a.arrayBufferToBigInt.call(a,e.v))}},n,this)}))}},{key:`computeClientEvidence`,value:function(t,i,a,o,s){return n(this,void 0,void 0,e().m(function t(){var n;return e().w(function(e){for(;;)switch(e.n){case 0:return n=r,e.n=1,this.hash(r.bigIntToArrayBuffer(a),r.bigIntToArrayBuffer(o),r.bigIntToArrayBuffer(s));case 1:return e.a(2,n.arrayBufferToBigInt.call(n,e.v))}},t,this)}))}},{key:`computeServerEvidence`,value:function(t,i,a){return n(this,void 0,void 0,e().m(function n(){var o;return e().w(function(e){for(;;)switch(e.n){case 0:return o=r,e.n=1,this.hash(r.bigIntToArrayBuffer(t),r.bigIntToArrayBuffer(i),r.bigIntToArrayBuffer(a));case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}},n,this)}))}},{key:`computeClientSessionKey`,value:function(e,t,n,i,a){var o=this.parameters.primeGroup.N,s=n*t+i,c=r.modPow(this.parameters.primeGroup.g,t,o)*e%o;return r.modPow(a+o-c,s,o)}}])}()}),d=i(function(t){var n=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=void 0,t.SRPClientSession=function(){function t(e){f(this,t),this.routines=e}return l(t,[{key:`step1`,value:function(t,i){return n(this,void 0,void 0,e().m(function n(){var a;return e().w(function(e){for(;;)switch(e.n){case 0:if(t&&t.trim()){e.n=1;break}throw Error(`User identity must not be null nor empty`);case 1:if(i){e.n=2;break}throw Error(`User password must not be null`);case 2:return e.n=3,this.routines.computeIdentityHash(t,i);case 3:return a=e.v,e.a(2,new r(this.routines,t,a))}},n,this)}))}}])}();var r=function(){function t(e,n,r){f(this,t),this.routines=e,this.I=n,this.IH=r}return l(t,[{key:`step2`,value:function(t,r){return n(this,void 0,void 0,e().m(function n(){var a,o,s,c,l,u,d;return e().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw Error(`Salt (s) must not be null`);case 1:if(r){e.n=2;break}throw Error(`Public server value (B) must not be null`);case 2:return e.n=3,this.routines.computeXStep2(t,this.IH);case 3:return a=e.v,o=this.routines.generatePrivateValue(),s=this.routines.computeClientPublicValue(o),e.n=4,this.routines.computeK();case 4:return c=e.v,e.n=5,this.routines.computeU(s,r);case 5:return l=e.v,u=this.routines.computeClientSessionKey(c,a,l,o,r),e.n=6,this.routines.computeClientEvidence(this.I,t,s,r,u);case 6:return d=e.v,e.a(2,new i(this.routines,s,d,u))}},n,this)}))}},{key:`toJSON`,value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:`fromState`,value:function(e,n){return new t(e,n.I,new Uint8Array(n.IH).buffer)}}])}();t.SRPClientSessionStep1=r;var i=function(){function t(e,n,r,i){f(this,t),this.routines=e,this.A=n,this.M1=r,this.S=i}return l(t,[{key:`step3`,value:function(t){return n(this,void 0,void 0,e().m(function n(){var r,i;return e().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw Error(`Server evidence (M2) must not be null`);case 1:return e.n=2,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 2:if(r=e.v,i=t,r===i){e.n=3;break}throw Error(`Bad server credentials`);case 3:return e.a(2)}},n,this)}))}},{key:`toJSON`,value:function(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}}],[{key:`fromState`,value:function(e,n){return new t(e,BigInt(`0x`+n.A),BigInt(`0x`+n.M1),BigInt(`0x`+n.S))}}])}();t.SRPClientSessionStep2=i}),p=i(function(t){var n=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPServerSessionStep1=t.SRPServerSession=void 0;var r=c();t.SRPServerSession=function(){function t(e){f(this,t),this.routines=e}return l(t,[{key:`step1`,value:function(t,r,o){return n(this,void 0,void 0,e().m(function n(){var s,c,l;return e().w(function(e){for(;;)switch(e.n){case 0:return s=this.routines.generatePrivateValue(),e.n=1,this.routines.computeK();case 1:return c=e.v,l=a(this.routines.parameters,c,o,s),e.a(2,new i(this.routines,t,r,o,s,l))}},n,this)}))}}])}();var i=function(){function t(e,n,r,i,a,o){f(this,t),this.routines=e,this.identifier=n,this.salt=r,this.verifier=i,this.b=a,this.B=o}return l(t,[{key:`sessionKey`,value:function(t){return n(this,void 0,void 0,e().m(function n(){var r;return e().w(function(e){for(;;)switch(e.n){case 0:if(t!==null){e.n=1;break}throw Error(`Client public value (A) must not be null`);case 1:if(this.routines.isValidPublicValue(t)){e.n=2;break}throw Error(`Invalid Client public value (A): ${t.toString(16)}`);case 2:return e.n=3,this.routines.computeU(t,this.B);case 3:return r=e.v,e.a(2,o(this.routines.parameters.primeGroup.N,this.verifier,r,t,this.b))}},n,this)}))}},{key:`step2`,value:function(t,r){return n(this,void 0,void 0,e().m(function n(){var i,a,o;return e().w(function(e){for(;;)switch(e.n){case 0:if(r){e.n=1;break}throw Error(`Client evidence (M1) must not be null`);case 1:return e.n=2,this.sessionKey(t);case 2:return i=e.v,e.n=3,this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,i);case 3:if(a=e.v,o=r,a===o){e.n=4;break}throw Error(`Bad client credentials`);case 4:return e.a(2,this.routines.computeServerEvidence(t,r,i))}},n,this)}))}},{key:`toJSON`,value:function(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}}],[{key:`fromState`,value:function(e,n){return new t(e,n.identifier,BigInt(`0x`+n.salt),BigInt(`0x`+n.verifier),BigInt(`0x`+n.b),BigInt(`0x`+n.B))}}])}();t.SRPServerSessionStep1=i;var a=function(e,t,n,i){return(r.modPow(e.primeGroup.g,i,e.primeGroup.N)+n*t)%e.primeGroup.N},o=function(e,t,n,i,a){return r.modPow(r.modPow(t,n,e)*i,a,e)}}),m=i(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=s();Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var n=u();Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return n.SRPRoutines}});var r=d();Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return r.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return r.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return r.SRPClientSessionStep2}});var i=p();Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return i.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return i.SRPServerSessionStep1}});var a=c();Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return a.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return a.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return a.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return a.generateRandomBigInt}})}),t(`default`,m())}}})})();
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){if(e){if(typeof e==`string`)return s(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function a(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function o(e){if(Array.isArray(e))return s(e)}function s(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=d(e,`string`);return typeof t==`symbol`?t:t+``}function d(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function f(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}System.register([`./index-legacy-CBijyHQo.js`],function(t,r){var i,a,o,s,c,u,d,p,m;return{setters:[function(e){i=e.t}],execute:function(){a=i(function(e,t){t.exports={}}),o=i(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crossEnvCrypto=void 0;try{var t=typeof window<`u`&&window.crypto||a().webcrypto;if(t){if(!t.subtle)throw Error(`Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.`);var n=function(e){return function(n){return t.subtle.digest(e,n)}};e.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:n(`SHA-1`),SHA256:n(`SHA-256`),SHA384:n(`SHA-384`),SHA512:n(`SHA-512`)}}}else{var r=a(),i=function(e){return function(t){return r.createHash(e).update(t).digest().buffer}};e.crossEnvCrypto={randomBytes:r.randomFillSync,hashFunctions:{SHA1:i(`sha1`),SHA256:i(`sha256`),SHA384:i(`sha384`),SHA512:i(`sha512`)}}}}catch(e){throw console.error(e),Error(`No suitable crypto library was found. You may need a polyfill.`)}}),s=i(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SRPParameters=void 0;var t=o(),n=l(function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:e.PrimeGroup[2048],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.H.SHA512;if(f(this,e),this.primeGroup=t,this.H=n,this.NBits=this.primeGroup.N.toString(2).length,!n)throw Error(`Hash function required`)});e.SRPParameters=n,n.PrimeGroup={256:{N:BigInt(`125617018995153554710546479714086468244499594888726646874671447258204721048803`),g:BigInt(2)},512:{N:BigInt(`11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603`),g:BigInt(2)},768:{N:BigInt(`1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147`),g:BigInt(2)},1024:{N:BigInt(`167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939`),g:BigInt(2)},1536:{N:BigInt(`1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587`),g:BigInt(2)},2048:{N:BigInt(`21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819`),g:BigInt(2)}},n.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512}}),c=i(function(t){var r=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.modPow=t.hashBitCount=t.createVerifierAndSalt=t.createVerifier=t.generateRandomBigInt=t.generateRandomString=t.hashPadded=t.hash=t.padStartArrayBuffer=t.stringToArrayBuffer=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=void 0;var i=o(),a=BigInt(0),s=BigInt(1),c=BigInt(2);t.bigIntToArrayBuffer=function(e){var t=e.toString(16),n=new ArrayBuffer(Math.ceil(t.length/2)),r=new Uint8Array(n),i=0;t.length%2!=0&&(r[0]=parseInt(t[0],16),i=1);for(var a=0;a<n.byteLength;a++)r[a+i]=parseInt(t.slice(2*a+i,2*a+2+i),16);return n},t.arrayBufferToBigInt=function(e){var t=[];return new Uint8Array(e).forEach(function(e){t.push((`0`+e.toString(16)).slice(-2))}),BigInt(`0x${t.join(``)}`)};function l(e){return new TextEncoder().encode(e).buffer}t.stringToArrayBuffer=l,t.padStartArrayBuffer=function(e,t){var n=new Uint8Array(e);if(n.length<t){var r=new Uint8Array(t);return r.fill(0,0,t-n.length),r.set(n,t-n.length),r}return n};function u(e){for(var t=[...arguments].slice(1),n=t.reduce(function(e,t){return e+t.byteLength},0),r=new Uint8Array(n),i=0,a=0;a<t.length;a++)r.set(new Uint8Array(t[a]),i),i+=t[a].byteLength;return e.H(r)}t.hash=u;function d(e,r){var i=[...arguments].slice(2);return u.apply(void 0,[e].concat(n(i.map(function(e){return t.padStartArrayBuffer(e,r)}))))}t.hashPadded=d;function f(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=new Uint8Array(Math.ceil(Math.ceil(e/2)));return i.crossEnvCrypto.randomBytes(t),t.reduce(function(e,t){var n=t.toString(16).toString();return n.length===1?e+`0`+n:e+n},``).slice(0,e)}t.generateRandomString=f;function p(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16;return t.arrayBufferToBigInt(_(e))}t.generateRandomBigInt=p;function m(t,n,i,a){return r(this,void 0,void 0,e().m(function r(){var o;return e().w(function(e){for(;;)switch(e.n){case 0:if(n&&n.trim()){e.n=1;break}throw Error(`Identity (I) must not be null or empty.`);case 1:if(i){e.n=2;break}throw Error(`Salt (s) must not be null.`);case 2:if(a){e.n=3;break}throw Error(`Password (P) must not be null`);case 3:return e.n=4,t.computeX(n,i,a);case 4:return o=e.v,e.a(2,t.computeVerifier(o))}},r)}))}t.createVerifier=m;function h(t,n,i,a){return r(this,void 0,void 0,e().m(function r(){var o,s,c;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.generateRandomSalt(a);case 1:return o=e.v,s=o,e.n=2,m(t,n,o,i);case 2:return c=e.v,e.a(2,{s,v:c})}},r)}))}t.createVerifierAndSalt=h,t.hashBitCount=function(n){return r(void 0,void 0,void 0,e().m(function r(){var i;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,u(n,t.bigIntToArrayBuffer(BigInt(1)));case 1:return i=e.v.byteLength,e.a(2,i*8)}},r)}))};function g(e,t,n){for(var r=s;t>a;)t%c==s?(r=e*r%n,t-=s):(e=e*e%n,t/=c);return r}t.modPow=g;var _=function(e){var t=new Uint8Array(e);return i.crossEnvCrypto.randomBytes(t),t.buffer}}),u=i(function(t){var n=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPRoutines=void 0;var r=c();t.SRPRoutines=function(){function t(e){f(this,t),this.parameters=e}return l(t,[{key:`hash`,value:function(){var e=[...arguments];return r.hash.apply(r,[this.parameters].concat(e))}},{key:`hashPadded`,value:function(){var e=Math.trunc((this.parameters.NBits+7)/8),t=[...arguments];return r.hashPadded.apply(r,[this.parameters,e].concat(t))}},{key:`computeK`,value:function(){return n(this,void 0,void 0,e().m(function t(){var n;return e().w(function(e){for(;;)switch(e.n){case 0:return n=r,e.n=1,this.hashPadded(r.bigIntToArrayBuffer(this.parameters.primeGroup.N),r.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 1:return e.a(2,n.arrayBufferToBigInt.call(n,e.v))}},t,this)}))}},{key:`generateRandomSalt`,value:function(t){return n(this,void 0,void 0,e().m(function n(){var i,a;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,r.hashBitCount(this.parameters);case 1:return i=e.v,a=t||2*i/8,e.a(2,r.generateRandomBigInt(a))}},n,this)}))}},{key:`computeX`,value:function(t,i,a){return n(this,void 0,void 0,e().m(function n(){var o,s,c;return e().w(function(e){for(;;)switch(e.n){case 0:return o=r,s=this,c=r.bigIntToArrayBuffer(i),e.n=1,this.computeIdentityHash(t,a);case 1:return e.n=2,s.hash.call(s,c,e.v);case 2:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}},n,this)}))}},{key:`computeXStep2`,value:function(t,i){return n(this,void 0,void 0,e().m(function n(){var a;return e().w(function(e){for(;;)switch(e.n){case 0:return a=r,e.n=1,this.hash(r.bigIntToArrayBuffer(t),i);case 1:return e.a(2,a.arrayBufferToBigInt.call(a,e.v))}},n,this)}))}},{key:`computeIdentityHash`,value:function(t,i){return n(this,void 0,void 0,e().m(function t(){return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hash(r.stringToArrayBuffer(i));case 1:return e.a(2,e.v)}},t,this)}))}},{key:`computeVerifier`,value:function(e){return r.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:`generatePrivateValue`,value:function(){var e=Math.max(256,this.parameters.NBits),t;do t=r.generateRandomBigInt(e/8)%this.parameters.primeGroup.N;while(t===BigInt(0));return t}},{key:`computeClientPublicValue`,value:function(e){return r.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:`isValidPublicValue`,value:function(e){return e%this.parameters.primeGroup.N!==BigInt(0)}},{key:`computeU`,value:function(t,i){return n(this,void 0,void 0,e().m(function n(){var a;return e().w(function(e){for(;;)switch(e.n){case 0:return a=r,e.n=1,this.hashPadded(r.bigIntToArrayBuffer(t),r.bigIntToArrayBuffer(i));case 1:return e.a(2,a.arrayBufferToBigInt.call(a,e.v))}},n,this)}))}},{key:`computeClientEvidence`,value:function(t,i,a,o,s){return n(this,void 0,void 0,e().m(function t(){var n;return e().w(function(e){for(;;)switch(e.n){case 0:return n=r,e.n=1,this.hash(r.bigIntToArrayBuffer(a),r.bigIntToArrayBuffer(o),r.bigIntToArrayBuffer(s));case 1:return e.a(2,n.arrayBufferToBigInt.call(n,e.v))}},t,this)}))}},{key:`computeServerEvidence`,value:function(t,i,a){return n(this,void 0,void 0,e().m(function n(){var o;return e().w(function(e){for(;;)switch(e.n){case 0:return o=r,e.n=1,this.hash(r.bigIntToArrayBuffer(t),r.bigIntToArrayBuffer(i),r.bigIntToArrayBuffer(a));case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}},n,this)}))}},{key:`computeClientSessionKey`,value:function(e,t,n,i,a){var o=this.parameters.primeGroup.N,s=n*t+i,c=r.modPow(this.parameters.primeGroup.g,t,o)*e%o;return r.modPow(a+o-c,s,o)}}])}()}),d=i(function(t){var n=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=void 0,t.SRPClientSession=function(){function t(e){f(this,t),this.routines=e}return l(t,[{key:`step1`,value:function(t,i){return n(this,void 0,void 0,e().m(function n(){var a;return e().w(function(e){for(;;)switch(e.n){case 0:if(t&&t.trim()){e.n=1;break}throw Error(`User identity must not be null nor empty`);case 1:if(i){e.n=2;break}throw Error(`User password must not be null`);case 2:return e.n=3,this.routines.computeIdentityHash(t,i);case 3:return a=e.v,e.a(2,new r(this.routines,t,a))}},n,this)}))}}])}();var r=function(){function t(e,n,r){f(this,t),this.routines=e,this.I=n,this.IH=r}return l(t,[{key:`step2`,value:function(t,r){return n(this,void 0,void 0,e().m(function n(){var a,o,s,c,l,u,d;return e().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw Error(`Salt (s) must not be null`);case 1:if(r){e.n=2;break}throw Error(`Public server value (B) must not be null`);case 2:return e.n=3,this.routines.computeXStep2(t,this.IH);case 3:return a=e.v,o=this.routines.generatePrivateValue(),s=this.routines.computeClientPublicValue(o),e.n=4,this.routines.computeK();case 4:return c=e.v,e.n=5,this.routines.computeU(s,r);case 5:return l=e.v,u=this.routines.computeClientSessionKey(c,a,l,o,r),e.n=6,this.routines.computeClientEvidence(this.I,t,s,r,u);case 6:return d=e.v,e.a(2,new i(this.routines,s,d,u))}},n,this)}))}},{key:`toJSON`,value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:`fromState`,value:function(e,n){return new t(e,n.I,new Uint8Array(n.IH).buffer)}}])}();t.SRPClientSessionStep1=r;var i=function(){function t(e,n,r,i){f(this,t),this.routines=e,this.A=n,this.M1=r,this.S=i}return l(t,[{key:`step3`,value:function(t){return n(this,void 0,void 0,e().m(function n(){var r,i;return e().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw Error(`Server evidence (M2) must not be null`);case 1:return e.n=2,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 2:if(r=e.v,i=t,r===i){e.n=3;break}throw Error(`Bad server credentials`);case 3:return e.a(2)}},n,this)}))}},{key:`toJSON`,value:function(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}}],[{key:`fromState`,value:function(e,n){return new t(e,BigInt(`0x`+n.A),BigInt(`0x`+n.M1),BigInt(`0x`+n.S))}}])}();t.SRPClientSessionStep2=i}),p=i(function(t){var n=t&&t.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPServerSessionStep1=t.SRPServerSession=void 0;var r=c();t.SRPServerSession=function(){function t(e){f(this,t),this.routines=e}return l(t,[{key:`step1`,value:function(t,r,o){return n(this,void 0,void 0,e().m(function n(){var s,c,l;return e().w(function(e){for(;;)switch(e.n){case 0:return s=this.routines.generatePrivateValue(),e.n=1,this.routines.computeK();case 1:return c=e.v,l=a(this.routines.parameters,c,o,s),e.a(2,new i(this.routines,t,r,o,s,l))}},n,this)}))}}])}();var i=function(){function t(e,n,r,i,a,o){f(this,t),this.routines=e,this.identifier=n,this.salt=r,this.verifier=i,this.b=a,this.B=o}return l(t,[{key:`sessionKey`,value:function(t){return n(this,void 0,void 0,e().m(function n(){var r;return e().w(function(e){for(;;)switch(e.n){case 0:if(t!==null){e.n=1;break}throw Error(`Client public value (A) must not be null`);case 1:if(this.routines.isValidPublicValue(t)){e.n=2;break}throw Error(`Invalid Client public value (A): ${t.toString(16)}`);case 2:return e.n=3,this.routines.computeU(t,this.B);case 3:return r=e.v,e.a(2,o(this.routines.parameters.primeGroup.N,this.verifier,r,t,this.b))}},n,this)}))}},{key:`step2`,value:function(t,r){return n(this,void 0,void 0,e().m(function n(){var i,a,o;return e().w(function(e){for(;;)switch(e.n){case 0:if(r){e.n=1;break}throw Error(`Client evidence (M1) must not be null`);case 1:return e.n=2,this.sessionKey(t);case 2:return i=e.v,e.n=3,this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,i);case 3:if(a=e.v,o=r,a===o){e.n=4;break}throw Error(`Bad client credentials`);case 4:return e.a(2,this.routines.computeServerEvidence(t,r,i))}},n,this)}))}},{key:`toJSON`,value:function(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}}],[{key:`fromState`,value:function(e,n){return new t(e,n.identifier,BigInt(`0x`+n.salt),BigInt(`0x`+n.verifier),BigInt(`0x`+n.b),BigInt(`0x`+n.B))}}])}();t.SRPServerSessionStep1=i;var a=function(e,t,n,i){return(r.modPow(e.primeGroup.g,i,e.primeGroup.N)+n*t)%e.primeGroup.N},o=function(e,t,n,i,a){return r.modPow(r.modPow(t,n,e)*i,a,e)}}),m=i(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=s();Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var n=u();Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return n.SRPRoutines}});var r=d();Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return r.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return r.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return r.SRPClientSessionStep2}});var i=p();Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return i.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return i.SRPServerSessionStep1}});var a=c();Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return a.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return a.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return a.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return a.generateRandomBigInt}})}),t(`default`,m())}}})})();
|