mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2026-11-27 06:43:08 +00:00
fix: 修复 Loon encryption-public-keys
This commit is contained in:
3 files changed
+27
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sub-store",
|
||||
"version": "2.44.28",
|
||||
"version": "2.44.29",
|
||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
|
||||
"main": "src/main.js",
|
||||
"packageManager": "pnpm@11.0.9",
|
||||
|
||||
@@ -762,9 +762,7 @@ function appendVlessEncryption(result, encryption) {
|
||||
|
||||
const publicKeys = settings.slice(keyIndex).join('.');
|
||||
result.append(`,encryption-mode=${mode},encryption-rtt=${rtt}`);
|
||||
result.append(
|
||||
`,encryption-public-keys=${formatLoonValue(publicKeys, true)}`,
|
||||
);
|
||||
result.append(`,encryption-public-keys=${formatLoonValue(publicKeys)}`);
|
||||
if (padding.length) {
|
||||
result.append(
|
||||
`,encryption-padding=${formatLoonValue(padding.join('.'))}`,
|
||||
|
||||
@@ -1355,7 +1355,9 @@ describe('Proxy text producers', function () {
|
||||
const output = produceExternal('Loon', ProxyUtils.parse(uri));
|
||||
expect(output).to.include(`,encryption-mode=${mode}`);
|
||||
expect(output).to.include(`,encryption-rtt=${expectedRtt}`);
|
||||
expect(output).to.include(`,encryption-public-keys="${keys}"`);
|
||||
expect(output.split(',')).to.include(
|
||||
`encryption-public-keys=${keys}`,
|
||||
);
|
||||
expect(output).to.include(`,encryption-padding=${padding}`);
|
||||
expect(ProxyUtils.parse(output)[0]).to.include({
|
||||
network,
|
||||
@@ -1365,6 +1367,27 @@ describe('Proxy text producers', function () {
|
||||
}
|
||||
});
|
||||
|
||||
it('exports unquoted Loon VLESS Encryption public keys with independent XHTTP download', function () {
|
||||
const key = 'A'.repeat(43);
|
||||
const extra = encodeURIComponent(
|
||||
JSON.stringify({
|
||||
downloadSettings: {
|
||||
address: 'download.example.com',
|
||||
port: 8443,
|
||||
security: 'tls',
|
||||
},
|
||||
}),
|
||||
);
|
||||
const proxies = ProxyUtils.parse(
|
||||
`vless://${UUID}@upload.example.com:443?type=xhttp&mode=stream-up&security=tls&encryption=mlkem768x25519plus.native.0rtt.${key}&extra=${extra}#Split`,
|
||||
);
|
||||
const output = produceExternal('Loon', proxies);
|
||||
expect(output).to.include(
|
||||
',xhttp-download-server=download.example.com,xhttp-download-port=8443,',
|
||||
);
|
||||
expect(output.split(',')).to.include(`encryption-public-keys=${key}`);
|
||||
});
|
||||
|
||||
it('validates Loon VLESS Encryption padding probabilities and ranges', function () {
|
||||
const key = 'A'.repeat(43);
|
||||
const input = `Encrypted=vless,example.com,443,"${UUID}",transport=tcp,encryption-mode=native,encryption-public-keys="${key}"`;
|
||||
@@ -1588,7 +1611,7 @@ describe('Proxy text producers', function () {
|
||||
});
|
||||
|
||||
expect(output).to.equal(
|
||||
`Loon Reality=vless,vless.example.com,443,"${UUID}",transport=ws,path=/ws,host=cdn.example.com,over-tls=true,skip-cert-verify=true,encryption-mode=native,encryption-rtt=1rtt,encryption-public-keys="${publicKey}",flow=xtls-rprx-vision,sni=sni.example.com,public-key="pubkey",short-id=08`,
|
||||
`Loon Reality=vless,vless.example.com,443,"${UUID}",transport=ws,path=/ws,host=cdn.example.com,over-tls=true,skip-cert-verify=true,encryption-mode=native,encryption-rtt=1rtt,encryption-public-keys=${publicKey},flow=xtls-rprx-vision,sni=sni.example.com,public-key="pubkey",short-id=08`,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user