hfs 3.1.2 → 3.1.4
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/admin/assets/{index-DI_SOdzQ.js → index-DTxjaflW.js} +1 -1
- package/admin/assets/{index-CpeyrW2d.js → index-Df6vYR7s.js} +4 -4
- package/admin/assets/{sha512-QTaxzUvZ.js → sha512-D936QW8l.js} +1 -1
- package/admin/index.html +1 -1
- package/frontend/assets/{index-legacy-DLISyaZ1.js → index-legacy-CQ3_LTGh.js} +1 -1
- package/frontend/assets/index-legacy-D6nPw49_.js +9 -0
- package/frontend/assets/{sha512-legacy-CHdxh7x9.js → sha512-legacy-DLqdsV8R.js} +1 -1
- package/frontend/index.html +1 -1
- package/npm-shrinkwrap.json +19 -19
- package/package.json +1 -1
- package/src/basicWeb.js +1 -1
- package/src/cross-const.js +2 -1
- package/src/first.js +15 -5
- package/src/serveGuiAndSharedFiles.js +2 -2
- package/src/update.js +2 -1
- package/src/upload.js +1 -1
- package/src/webdav.js +203 -60
- package/frontend/assets/index-legacy-BQCEUtxs.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as UF,g as gF}from"./index-
|
|
1
|
+
import{c as UF,g as gF}from"./index-Df6vYR7s.js";function RF(sF,xF){for(var eF=0;eF<xF.length;eF++){const tF=xF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var yF={exports:{}};/*
|
|
2
2
|
* [js-sha512]{@link https://github.com/emn178/js-sha512}
|
|
3
3
|
*
|
|
4
4
|
* @version 0.8.0
|
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-Df6vYR7s.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-B66w-a0v.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:k(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var p="suspendedStart",v="suspendedYield",d="executing",y="completed",g={};function m(){}function w(){}function S(){}var b={};f(b,u,(function(){return this}));var P=Object.getPrototypeOf,B=P&&P(P(O([])));B&&B!==n&&i.call(B,u)&&(b=B);var x=S.prototype=m.prototype=Object.create(b);function I(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(n,o,a,u){var s=l(t[n],t,o);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var n;o(this,"_invoke",{value:function(t,i){function o(){return new e((function(e,n){r(t,i,e,n)}))}return n=n?n.then(o,o):o()}})}function k(t,r,n){var i=p;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var s=E(u,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=l(t,r,n);if("normal"===c.type){if(i=n.done?y:v,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function E(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=l(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return w.prototype=S,o(x,"constructor",{value:S,configurable:!0}),o(S,"constructor",{value:w,configurable:!0}),w.displayName=f(S,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,f(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},r.awrap=function(t){return{__await:t}},I(A.prototype),f(A.prototype,s,(function(){return this})),r.AsyncIterator=A,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new A(h(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},I(x),f(x,c,"Generator"),f(x,u,(function(){return this})),f(x,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return u.type="throw",u.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}System.register(["./index-legacy-BQCEUtxs.js"],(function(r,n){"use strict";var o,u;return{setters:[function(t){o=t.a,u=t.g}],execute:function(){function n(t,e){for(var r=function(){var r=e[n];if("string"!=typeof r&&!Array.isArray(r)){var i=function(e){if("default"!==e&&!(e in t)){var n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return r[e]}})}};for(var o in r)i(o)}},n=0;n<e.length;n++)r();return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s,c,f={},h={},l={},p=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})),v=o(p);function d(){if(s)return l;s=1,Object.defineProperty(l,"__esModule",{value:!0}),l.crossEnvCrypto=void 0;try{var t="undefined"!=typeof window&&window.crypto||v.webcrypto;if(t){if(!t.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");var e=function(e){return function(r){return t.subtle.digest(e,r)}};l.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:e("SHA-1"),SHA256:e("SHA-256"),SHA384:e("SHA-384"),SHA512:e("SHA-512")}}}else{var r=v,n=function(t){return function(e){return r.createHash(t).update(e).digest().buffer}};l.crossEnvCrypto={randomBytes:r.randomFillSync,hashFunctions:{SHA1:n("sha1"),SHA256:n("sha256"),SHA384:n("sha384"),SHA512:n("sha512")}}}}catch(i){throw console.error(i),new Error("No suitable crypto library was found. You may need a polyfill.")}return l}var y,g,m={},w={};function S(){return y||(y=1,function(r){var n=w&&w.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.modPow=r.hashBitCount=r.createVerifierAndSalt=r.createVerifier=r.generateRandomBigInt=r.generateRandomString=r.hashPadded=r.hash=r.padStartArrayBuffer=r.stringToArrayBuffer=r.arrayBufferToBigInt=r.bigIntToArrayBuffer=void 0;var i=d(),o=BigInt(0),a=BigInt(1),u=BigInt(2);r.bigIntToArrayBuffer=function(t){var e=t.toString(16),r=new ArrayBuffer(Math.ceil(e.length/2)),n=new Uint8Array(r),i=0;e.length%2!=0&&(n[0]=parseInt(e[0],16),i=1);for(var o=0;o<r.byteLength;o++)n[o+i]=parseInt(e.slice(2*o+i,2*o+2+i),16);return r};r.arrayBufferToBigInt=function(t){var e=[];return new Uint8Array(t).forEach((function(t){e.push(("0"+t.toString(16)).slice(-2))})),BigInt(`0x${e.join("")}`)},r.stringToArrayBuffer=function(t){return(new TextEncoder).encode(t).buffer};function s(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];for(var i=r.reduce((function(t,e){return t+e.byteLength}),0),o=new Uint8Array(i),a=0,u=0;u<r.length;u++)o.set(new Uint8Array(r[u]),a),a+=r[u].byteLength;return t.H(o)}function c(e,r,i,o){return n(this,void 0,void 0,t().mark((function n(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.trim()){t.next=2;break}throw new Error("Identity (I) must not be null or empty.");case 2:if(i){t.next=4;break}throw new Error("Salt (s) must not be null.");case 4:if(o){t.next=6;break}throw new Error("Password (P) must not be null");case 6:return t.next=8,e.computeX(r,i,o);case 8:return a=t.sent,t.abrupt("return",e.computeVerifier(a));case 10:case"end":return t.stop()}}),n)})))}r.padStartArrayBuffer=function(t,e){var r=new Uint8Array(t);if(r.length<e){var n=new Uint8Array(e);return n.fill(0,0,e-r.length),n.set(r,e-r.length),n}return r},r.hash=s,r.hashPadded=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];var u=o.map((function(t){return r.padStartArrayBuffer(t,n)}));return s.apply(void 0,[t].concat(e(u)))},r.generateRandomString=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=new Uint8Array(Math.ceil(Math.ceil(t/2)));return i.crossEnvCrypto.randomBytes(e),e.reduce((function(t,e){var r=e.toString(16).toString();return 1===r.length?t+"0"+r:t+r}),"").slice(0,t)},r.generateRandomBigInt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return r.arrayBufferToBigInt(f(t))},r.createVerifier=c,r.createVerifierAndSalt=function(e,r,i,o){return n(this,void 0,void 0,t().mark((function n(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.generateRandomSalt(o);case 2:return a=t.sent,t.t0=a,t.next=6,c(e,r,a,i);case 6:return t.t1=t.sent,t.abrupt("return",{s:t.t0,v:t.t1});case 8:case"end":return t.stop()}}),n)})))};r.hashBitCount=function(e){return n(void 0,void 0,void 0,t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s(e,r.bigIntToArrayBuffer(BigInt(1)));case 2:return t.t0=t.sent.byteLength,t.abrupt("return",8*t.t0);case 4:case"end":return t.stop()}}),n)})))},r.modPow=function(t,e,r){for(var n=a;e>o;)e%u==a?(n=t*n%r,e-=a):(t=t*t%r,e/=u);return n};var f=function(t){var e=new Uint8Array(t);return i.crossEnvCrypto.randomBytes(e),e.buffer}}(w)),w}function b(){if(g)return m;g=1;var e=m&&m.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(m,"__esModule",{value:!0}),m.SRPRoutines=void 0;var r=S(),n=function(){return i((function t(e){a(this,t),this.parameters=e}),[{key:"hash",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.hash.apply(r,[this.parameters].concat(e))}},{key:"hashPadded",value:function(){for(var t=Math.trunc((this.parameters.NBits+7)/8),e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r.hashPadded.apply(r,[this.parameters,t].concat(n))}},{key:"computeK",value:function(){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hashPadded(r.bigIntToArrayBuffer(this.parameters.primeGroup.N),r.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"generateRandomSalt",value:function(n){return e(this,void 0,void 0,t().mark((function e(){var i,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.hashBitCount(this.parameters);case 2:return i=t.sent,o=n||2*i/8,t.abrupt("return",r.generateRandomBigInt(o));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeX",value:function(n,i,o){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.t1=this,t.t2=r.bigIntToArrayBuffer(i),t.next=5,this.computeIdentityHash(n,o);case 5:return t.t3=t.sent,t.next=8,t.t1.hash.call(t.t1,t.t2,t.t3);case 8:return t.t4=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t4));case 10:case"end":return t.stop()}}),e,this)})))}},{key:"computeXStep2",value:function(n,i){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hash(r.bigIntToArrayBuffer(n),i);case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeIdentityHash",value:function(n,i){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.hash(r.stringToArrayBuffer(i));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),e,this)})))}},{key:"computeVerifier",value:function(t){return r.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}},{key:"generatePrivateValue",value:function(){var t,e=Math.max(256,this.parameters.NBits);do{t=r.generateRandomBigInt(e/8)%this.parameters.primeGroup.N}while(t===BigInt(0));return t}},{key:"computeClientPublicValue",value:function(t){return r.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}},{key:"isValidPublicValue",value:function(t){return t%this.parameters.primeGroup.N!==BigInt(0)}},{key:"computeU",value:function(n,i){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hashPadded(r.bigIntToArrayBuffer(n),r.bigIntToArrayBuffer(i));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeClientEvidence",value:function(n,i,o,a,u){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hash(r.bigIntToArrayBuffer(o),r.bigIntToArrayBuffer(a),r.bigIntToArrayBuffer(u));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeServerEvidence",value:function(n,i,o){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hash(r.bigIntToArrayBuffer(n),r.bigIntToArrayBuffer(i),r.bigIntToArrayBuffer(o));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeClientSessionKey",value:function(t,e,n,i,o){var a=this.parameters.primeGroup.N,u=n*e+i,s=r.modPow(this.parameters.primeGroup.g,e,a)*t%a;return r.modPow(o+a-s,u,a)}}])}();return m.SRPRoutines=n,m}var P,B={};function x(){if(P)return B;P=1;var e=B&&B.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(B,"__esModule",{value:!0}),B.SRPClientSessionStep2=B.SRPClientSessionStep1=B.SRPClientSession=void 0;var r=function(){return i((function t(e){a(this,t),this.routines=e}),[{key:"step1",value:function(r,i){return e(this,void 0,void 0,t().mark((function e(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.trim()){t.next=2;break}throw new Error("User identity must not be null nor empty");case 2:if(i){t.next=4;break}throw new Error("User password must not be null");case 4:return t.next=6,this.routines.computeIdentityHash(r,i);case 6:return o=t.sent,t.abrupt("return",new n(this.routines,r,o));case 8:case"end":return t.stop()}}),e,this)})))}}])}();B.SRPClientSession=r;var n=function(){function r(t,e,n){a(this,r),this.routines=t,this.I=e,this.IH=n}return i(r,[{key:"step2",value:function(r,n){return e(this,void 0,void 0,t().mark((function e(){var i,a,u,s,c,f,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}throw new Error("Salt (s) must not be null");case 2:if(n){t.next=4;break}throw new Error("Public server value (B) must not be null");case 4:return t.next=6,this.routines.computeXStep2(r,this.IH);case 6:return i=t.sent,a=this.routines.generatePrivateValue(),u=this.routines.computeClientPublicValue(a),t.next=11,this.routines.computeK();case 11:return s=t.sent,t.next=14,this.routines.computeU(u,n);case 14:return c=t.sent,f=this.routines.computeClientSessionKey(s,i,c,a,n),t.next=18,this.routines.computeClientEvidence(this.I,r,u,n,f);case 18:return h=t.sent,t.abrupt("return",new o(this.routines,u,h,f));case 20:case"end":return t.stop()}}),e,this)})))}},{key:"toJSON",value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:"fromState",value:function(t,e){return new r(t,e.I,new Uint8Array(e.IH).buffer)}}])}();B.SRPClientSessionStep1=n;var o=function(){function r(t,e,n,i){a(this,r),this.routines=t,this.A=e,this.M1=n,this.S=i}return i(r,[{key:"step3",value:function(r){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}throw new Error("Server evidence (M2) must not be null");case 2:return t.next=4,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 4:if(t.sent===r){t.next=7;break}throw new Error("Bad server credentials");case 7:case"end":return t.stop()}}),e,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(t,e){return new r(t,BigInt("0x"+e.A),BigInt("0x"+e.M1),BigInt("0x"+e.S))}}])}();return B.SRPClientSessionStep2=o,B}var I,A,k={};function E(){if(I)return k;I=1;var e=k&&k.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(k,"__esModule",{value:!0}),k.SRPServerSessionStep1=k.SRPServerSession=void 0;var r=S(),n=function(){return i((function t(e){a(this,t),this.routines=e}),[{key:"step1",value:function(r,n,i){return e(this,void 0,void 0,t().mark((function e(){var a,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=this.routines.generatePrivateValue(),t.next=3,this.routines.computeK();case 3:return s=t.sent,c=u(this.routines.parameters,s,i,a),t.abrupt("return",new o(this.routines,r,n,i,a,c));case 6:case"end":return t.stop()}}),e,this)})))}}])}();k.SRPServerSession=n;var o=function(){function r(t,e,n,i,o,u){a(this,r),this.routines=t,this.identifier=e,this.salt=n,this.verifier=i,this.b=o,this.B=u}return i(r,[{key:"sessionKey",value:function(r){return e(this,void 0,void 0,t().mark((function e(){var n,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==r){t.next=2;break}throw new Error("Client public value (A) must not be null");case 2:if(this.routines.isValidPublicValue(r)){t.next=4;break}throw new Error(`Invalid Client public value (A): ${r.toString(16)}`);case 4:return t.next=6,this.routines.computeU(r,this.B);case 6:return n=t.sent,i=s(this.routines.parameters.primeGroup.N,this.verifier,n,r,this.b),t.abrupt("return",i);case 9:case"end":return t.stop()}}),e,this)})))}},{key:"step2",value:function(r,n){return e(this,void 0,void 0,t().mark((function e(){var i,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}throw new Error("Client evidence (M1) must not be null");case 2:return t.next=4,this.sessionKey(r);case 4:return i=t.sent,t.next=7,this.routines.computeClientEvidence(this.identifier,this.salt,r,this.B,i);case 7:if(t.sent===n){t.next=10;break}throw new Error("Bad client credentials");case 10:return o=this.routines.computeServerEvidence(r,n,i),t.abrupt("return",o);case 12:case"end":return t.stop()}}),e,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(t,e){return new r(t,e.identifier,BigInt("0x"+e.salt),BigInt("0x"+e.verifier),BigInt("0x"+e.b),BigInt("0x"+e.B))}}])}();k.SRPServerSessionStep1=o;var u=function(t,e,n,i){return(r.modPow(t.primeGroup.g,i,t.primeGroup.N)+n*e)%t.primeGroup.N},s=function(t,e,n,i,o){return r.modPow(r.modPow(e,n,t)*i,o,t)};return k}var R=(A||(A=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomBigInt=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=t.createVerifierAndSalt=t.SRPServerSessionStep1=t.SRPServerSession=t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=t.SRPRoutines=t.SRPParameters=void 0;var e=function(){if(c)return h;c=1,Object.defineProperty(h,"__esModule",{value:!0}),h.SRPParameters=void 0;var t=d(),e=i((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.PrimeGroup[2048],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.H.SHA512;if(a(this,t),this.primeGroup=e,this.H=r,this.NBits=this.primeGroup.N.toString(2).length,!r)throw new Error("Hash function required")}));return h.SRPParameters=e,e.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)}},e.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512},h}();Object.defineProperty(t,"SRPParameters",{enumerable:!0,get:function(){return e.SRPParameters}});var r=b();Object.defineProperty(t,"SRPRoutines",{enumerable:!0,get:function(){return r.SRPRoutines}});var n=x();Object.defineProperty(t,"SRPClientSession",{enumerable:!0,get:function(){return n.SRPClientSession}}),Object.defineProperty(t,"SRPClientSessionStep1",{enumerable:!0,get:function(){return n.SRPClientSessionStep1}}),Object.defineProperty(t,"SRPClientSessionStep2",{enumerable:!0,get:function(){return n.SRPClientSessionStep2}});var o=E();Object.defineProperty(t,"SRPServerSession",{enumerable:!0,get:function(){return o.SRPServerSession}}),Object.defineProperty(t,"SRPServerSessionStep1",{enumerable:!0,get:function(){return o.SRPServerSessionStep1}});var u=S();Object.defineProperty(t,"createVerifierAndSalt",{enumerable:!0,get:function(){return u.createVerifierAndSalt}}),Object.defineProperty(t,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return u.bigIntToArrayBuffer}}),Object.defineProperty(t,"arrayBufferToBigInt",{enumerable:!0,get:function(){return u.arrayBufferToBigInt}}),Object.defineProperty(t,"generateRandomBigInt",{enumerable:!0,get:function(){return u.generateRandomBigInt}})}(f)),f);r("i",n({__proto__:null,default:u(R)},[R]))}}}))}();
|
|
1
|
+
!function(){function t(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return r};var e,r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),u=new j(n||[]);return o(a,"_invoke",{value:k(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var p="suspendedStart",v="suspendedYield",d="executing",y="completed",g={};function m(){}function w(){}function S(){}var b={};f(b,u,(function(){return this}));var P=Object.getPrototypeOf,B=P&&P(P(O([])));B&&B!==n&&i.call(B,u)&&(b=B);var x=S.prototype=m.prototype=Object.create(b);function I(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function r(n,o,a,u){var s=l(t[n],t,o);if("throw"!==s.type){var c=s.arg,f=c.value;return f&&"object"==typeof f&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var n;o(this,"_invoke",{value:function(t,i){function o(){return new e((function(e,n){r(t,i,e,n)}))}return n=n?n.then(o,o):o()}})}function k(t,r,n){var i=p;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var s=E(u,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===p)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=l(t,r,n);if("normal"===c.type){if(i=n.done?y:v,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=y,n.method="throw",n.arg=c.arg)}}}function E(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=l(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function O(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function r(){for(;++n<t.length;)if(i.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(typeof t+" is not iterable")}return w.prototype=S,o(x,"constructor",{value:S,configurable:!0}),o(S,"constructor",{value:w,configurable:!0}),w.displayName=f(S,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,f(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},r.awrap=function(t){return{__await:t}},I(A.prototype),f(A.prototype,s,(function(){return this})),r.AsyncIterator=A,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new A(h(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},I(x),f(x,c,"Generator"),f(x,u,(function(){return this})),f(x,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return u.type="throw",u.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:O(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function i(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}System.register(["./index-legacy-D6nPw49_.js"],(function(r,n){"use strict";var o,u;return{setters:[function(t){o=t.a,u=t.g}],execute:function(){function n(t,e){for(var r=function(){var r=e[n];if("string"!=typeof r&&!Array.isArray(r)){var i=function(e){if("default"!==e&&!(e in t)){var n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:function(){return r[e]}})}};for(var o in r)i(o)}},n=0;n<e.length;n++)r();return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var s,c,f={},h={},l={},p=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})),v=o(p);function d(){if(s)return l;s=1,Object.defineProperty(l,"__esModule",{value:!0}),l.crossEnvCrypto=void 0;try{var t="undefined"!=typeof window&&window.crypto||v.webcrypto;if(t){if(!t.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");var e=function(e){return function(r){return t.subtle.digest(e,r)}};l.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:e("SHA-1"),SHA256:e("SHA-256"),SHA384:e("SHA-384"),SHA512:e("SHA-512")}}}else{var r=v,n=function(t){return function(e){return r.createHash(t).update(e).digest().buffer}};l.crossEnvCrypto={randomBytes:r.randomFillSync,hashFunctions:{SHA1:n("sha1"),SHA256:n("sha256"),SHA384:n("sha384"),SHA512:n("sha512")}}}}catch(i){throw console.error(i),new Error("No suitable crypto library was found. You may need a polyfill.")}return l}var y,g,m={},w={};function S(){return y||(y=1,function(r){var n=w&&w.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.modPow=r.hashBitCount=r.createVerifierAndSalt=r.createVerifier=r.generateRandomBigInt=r.generateRandomString=r.hashPadded=r.hash=r.padStartArrayBuffer=r.stringToArrayBuffer=r.arrayBufferToBigInt=r.bigIntToArrayBuffer=void 0;var i=d(),o=BigInt(0),a=BigInt(1),u=BigInt(2);r.bigIntToArrayBuffer=function(t){var e=t.toString(16),r=new ArrayBuffer(Math.ceil(e.length/2)),n=new Uint8Array(r),i=0;e.length%2!=0&&(n[0]=parseInt(e[0],16),i=1);for(var o=0;o<r.byteLength;o++)n[o+i]=parseInt(e.slice(2*o+i,2*o+2+i),16);return r};r.arrayBufferToBigInt=function(t){var e=[];return new Uint8Array(t).forEach((function(t){e.push(("0"+t.toString(16)).slice(-2))})),BigInt(`0x${e.join("")}`)},r.stringToArrayBuffer=function(t){return(new TextEncoder).encode(t).buffer};function s(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];for(var i=r.reduce((function(t,e){return t+e.byteLength}),0),o=new Uint8Array(i),a=0,u=0;u<r.length;u++)o.set(new Uint8Array(r[u]),a),a+=r[u].byteLength;return t.H(o)}function c(e,r,i,o){return n(this,void 0,void 0,t().mark((function n(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.trim()){t.next=2;break}throw new Error("Identity (I) must not be null or empty.");case 2:if(i){t.next=4;break}throw new Error("Salt (s) must not be null.");case 4:if(o){t.next=6;break}throw new Error("Password (P) must not be null");case 6:return t.next=8,e.computeX(r,i,o);case 8:return a=t.sent,t.abrupt("return",e.computeVerifier(a));case 10:case"end":return t.stop()}}),n)})))}r.padStartArrayBuffer=function(t,e){var r=new Uint8Array(t);if(r.length<e){var n=new Uint8Array(e);return n.fill(0,0,e-r.length),n.set(r,e-r.length),n}return r},r.hash=s,r.hashPadded=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];var u=o.map((function(t){return r.padStartArrayBuffer(t,n)}));return s.apply(void 0,[t].concat(e(u)))},r.generateRandomString=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=new Uint8Array(Math.ceil(Math.ceil(t/2)));return i.crossEnvCrypto.randomBytes(e),e.reduce((function(t,e){var r=e.toString(16).toString();return 1===r.length?t+"0"+r:t+r}),"").slice(0,t)},r.generateRandomBigInt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return r.arrayBufferToBigInt(f(t))},r.createVerifier=c,r.createVerifierAndSalt=function(e,r,i,o){return n(this,void 0,void 0,t().mark((function n(){var a;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.generateRandomSalt(o);case 2:return a=t.sent,t.t0=a,t.next=6,c(e,r,a,i);case 6:return t.t1=t.sent,t.abrupt("return",{s:t.t0,v:t.t1});case 8:case"end":return t.stop()}}),n)})))};r.hashBitCount=function(e){return n(void 0,void 0,void 0,t().mark((function n(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s(e,r.bigIntToArrayBuffer(BigInt(1)));case 2:return t.t0=t.sent.byteLength,t.abrupt("return",8*t.t0);case 4:case"end":return t.stop()}}),n)})))},r.modPow=function(t,e,r){for(var n=a;e>o;)e%u==a?(n=t*n%r,e-=a):(t=t*t%r,e/=u);return n};var f=function(t){var e=new Uint8Array(t);return i.crossEnvCrypto.randomBytes(e),e.buffer}}(w)),w}function b(){if(g)return m;g=1;var e=m&&m.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(m,"__esModule",{value:!0}),m.SRPRoutines=void 0;var r=S(),n=function(){return i((function t(e){a(this,t),this.parameters=e}),[{key:"hash",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.hash.apply(r,[this.parameters].concat(e))}},{key:"hashPadded",value:function(){for(var t=Math.trunc((this.parameters.NBits+7)/8),e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return r.hashPadded.apply(r,[this.parameters,t].concat(n))}},{key:"computeK",value:function(){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hashPadded(r.bigIntToArrayBuffer(this.parameters.primeGroup.N),r.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"generateRandomSalt",value:function(n){return e(this,void 0,void 0,t().mark((function e(){var i,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.hashBitCount(this.parameters);case 2:return i=t.sent,o=n||2*i/8,t.abrupt("return",r.generateRandomBigInt(o));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeX",value:function(n,i,o){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.t1=this,t.t2=r.bigIntToArrayBuffer(i),t.next=5,this.computeIdentityHash(n,o);case 5:return t.t3=t.sent,t.next=8,t.t1.hash.call(t.t1,t.t2,t.t3);case 8:return t.t4=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t4));case 10:case"end":return t.stop()}}),e,this)})))}},{key:"computeXStep2",value:function(n,i){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hash(r.bigIntToArrayBuffer(n),i);case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeIdentityHash",value:function(n,i){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.hash(r.stringToArrayBuffer(i));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),e,this)})))}},{key:"computeVerifier",value:function(t){return r.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}},{key:"generatePrivateValue",value:function(){var t,e=Math.max(256,this.parameters.NBits);do{t=r.generateRandomBigInt(e/8)%this.parameters.primeGroup.N}while(t===BigInt(0));return t}},{key:"computeClientPublicValue",value:function(t){return r.modPow(this.parameters.primeGroup.g,t,this.parameters.primeGroup.N)}},{key:"isValidPublicValue",value:function(t){return t%this.parameters.primeGroup.N!==BigInt(0)}},{key:"computeU",value:function(n,i){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hashPadded(r.bigIntToArrayBuffer(n),r.bigIntToArrayBuffer(i));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeClientEvidence",value:function(n,i,o,a,u){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hash(r.bigIntToArrayBuffer(o),r.bigIntToArrayBuffer(a),r.bigIntToArrayBuffer(u));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeServerEvidence",value:function(n,i,o){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=r,t.next=3,this.hash(r.bigIntToArrayBuffer(n),r.bigIntToArrayBuffer(i),r.bigIntToArrayBuffer(o));case 3:return t.t1=t.sent,t.abrupt("return",t.t0.arrayBufferToBigInt.call(t.t0,t.t1));case 5:case"end":return t.stop()}}),e,this)})))}},{key:"computeClientSessionKey",value:function(t,e,n,i,o){var a=this.parameters.primeGroup.N,u=n*e+i,s=r.modPow(this.parameters.primeGroup.g,e,a)*t%a;return r.modPow(o+a-s,u,a)}}])}();return m.SRPRoutines=n,m}var P,B={};function x(){if(P)return B;P=1;var e=B&&B.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(B,"__esModule",{value:!0}),B.SRPClientSessionStep2=B.SRPClientSessionStep1=B.SRPClientSession=void 0;var r=function(){return i((function t(e){a(this,t),this.routines=e}),[{key:"step1",value:function(r,i){return e(this,void 0,void 0,t().mark((function e(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.trim()){t.next=2;break}throw new Error("User identity must not be null nor empty");case 2:if(i){t.next=4;break}throw new Error("User password must not be null");case 4:return t.next=6,this.routines.computeIdentityHash(r,i);case 6:return o=t.sent,t.abrupt("return",new n(this.routines,r,o));case 8:case"end":return t.stop()}}),e,this)})))}}])}();B.SRPClientSession=r;var n=function(){function r(t,e,n){a(this,r),this.routines=t,this.I=e,this.IH=n}return i(r,[{key:"step2",value:function(r,n){return e(this,void 0,void 0,t().mark((function e(){var i,a,u,s,c,f,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}throw new Error("Salt (s) must not be null");case 2:if(n){t.next=4;break}throw new Error("Public server value (B) must not be null");case 4:return t.next=6,this.routines.computeXStep2(r,this.IH);case 6:return i=t.sent,a=this.routines.generatePrivateValue(),u=this.routines.computeClientPublicValue(a),t.next=11,this.routines.computeK();case 11:return s=t.sent,t.next=14,this.routines.computeU(u,n);case 14:return c=t.sent,f=this.routines.computeClientSessionKey(s,i,c,a,n),t.next=18,this.routines.computeClientEvidence(this.I,r,u,n,f);case 18:return h=t.sent,t.abrupt("return",new o(this.routines,u,h,f));case 20:case"end":return t.stop()}}),e,this)})))}},{key:"toJSON",value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:"fromState",value:function(t,e){return new r(t,e.I,new Uint8Array(e.IH).buffer)}}])}();B.SRPClientSessionStep1=n;var o=function(){function r(t,e,n,i){a(this,r),this.routines=t,this.A=e,this.M1=n,this.S=i}return i(r,[{key:"step3",value:function(r){return e(this,void 0,void 0,t().mark((function e(){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=2;break}throw new Error("Server evidence (M2) must not be null");case 2:return t.next=4,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 4:if(t.sent===r){t.next=7;break}throw new Error("Bad server credentials");case 7:case"end":return t.stop()}}),e,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(t,e){return new r(t,BigInt("0x"+e.A),BigInt("0x"+e.M1),BigInt("0x"+e.S))}}])}();return B.SRPClientSessionStep2=o,B}var I,A,k={};function E(){if(I)return k;I=1;var e=k&&k.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n.throw(t))}catch(e){o(e)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}s((n=n.apply(t,e||[])).next())}))};Object.defineProperty(k,"__esModule",{value:!0}),k.SRPServerSessionStep1=k.SRPServerSession=void 0;var r=S(),n=function(){return i((function t(e){a(this,t),this.routines=e}),[{key:"step1",value:function(r,n,i){return e(this,void 0,void 0,t().mark((function e(){var a,s,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=this.routines.generatePrivateValue(),t.next=3,this.routines.computeK();case 3:return s=t.sent,c=u(this.routines.parameters,s,i,a),t.abrupt("return",new o(this.routines,r,n,i,a,c));case 6:case"end":return t.stop()}}),e,this)})))}}])}();k.SRPServerSession=n;var o=function(){function r(t,e,n,i,o,u){a(this,r),this.routines=t,this.identifier=e,this.salt=n,this.verifier=i,this.b=o,this.B=u}return i(r,[{key:"sessionKey",value:function(r){return e(this,void 0,void 0,t().mark((function e(){var n,i;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==r){t.next=2;break}throw new Error("Client public value (A) must not be null");case 2:if(this.routines.isValidPublicValue(r)){t.next=4;break}throw new Error(`Invalid Client public value (A): ${r.toString(16)}`);case 4:return t.next=6,this.routines.computeU(r,this.B);case 6:return n=t.sent,i=s(this.routines.parameters.primeGroup.N,this.verifier,n,r,this.b),t.abrupt("return",i);case 9:case"end":return t.stop()}}),e,this)})))}},{key:"step2",value:function(r,n){return e(this,void 0,void 0,t().mark((function e(){var i,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}throw new Error("Client evidence (M1) must not be null");case 2:return t.next=4,this.sessionKey(r);case 4:return i=t.sent,t.next=7,this.routines.computeClientEvidence(this.identifier,this.salt,r,this.B,i);case 7:if(t.sent===n){t.next=10;break}throw new Error("Bad client credentials");case 10:return o=this.routines.computeServerEvidence(r,n,i),t.abrupt("return",o);case 12:case"end":return t.stop()}}),e,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(t,e){return new r(t,e.identifier,BigInt("0x"+e.salt),BigInt("0x"+e.verifier),BigInt("0x"+e.b),BigInt("0x"+e.B))}}])}();k.SRPServerSessionStep1=o;var u=function(t,e,n,i){return(r.modPow(t.primeGroup.g,i,t.primeGroup.N)+n*e)%t.primeGroup.N},s=function(t,e,n,i,o){return r.modPow(r.modPow(e,n,t)*i,o,t)};return k}var R=(A||(A=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.generateRandomBigInt=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=t.createVerifierAndSalt=t.SRPServerSessionStep1=t.SRPServerSession=t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=t.SRPRoutines=t.SRPParameters=void 0;var e=function(){if(c)return h;c=1,Object.defineProperty(h,"__esModule",{value:!0}),h.SRPParameters=void 0;var t=d(),e=i((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.PrimeGroup[2048],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.H.SHA512;if(a(this,t),this.primeGroup=e,this.H=r,this.NBits=this.primeGroup.N.toString(2).length,!r)throw new Error("Hash function required")}));return h.SRPParameters=e,e.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)}},e.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512},h}();Object.defineProperty(t,"SRPParameters",{enumerable:!0,get:function(){return e.SRPParameters}});var r=b();Object.defineProperty(t,"SRPRoutines",{enumerable:!0,get:function(){return r.SRPRoutines}});var n=x();Object.defineProperty(t,"SRPClientSession",{enumerable:!0,get:function(){return n.SRPClientSession}}),Object.defineProperty(t,"SRPClientSessionStep1",{enumerable:!0,get:function(){return n.SRPClientSessionStep1}}),Object.defineProperty(t,"SRPClientSessionStep2",{enumerable:!0,get:function(){return n.SRPClientSessionStep2}});var o=E();Object.defineProperty(t,"SRPServerSession",{enumerable:!0,get:function(){return o.SRPServerSession}}),Object.defineProperty(t,"SRPServerSessionStep1",{enumerable:!0,get:function(){return o.SRPServerSessionStep1}});var u=S();Object.defineProperty(t,"createVerifierAndSalt",{enumerable:!0,get:function(){return u.createVerifierAndSalt}}),Object.defineProperty(t,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return u.bigIntToArrayBuffer}}),Object.defineProperty(t,"arrayBufferToBigInt",{enumerable:!0,get:function(){return u.arrayBufferToBigInt}}),Object.defineProperty(t,"generateRandomBigInt",{enumerable:!0,get:function(){return u.generateRandomBigInt}})}(f)),f);r("i",n({__proto__:null,default:u(R)},[R]))}}}))}();
|