mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-03 00:47:14 +00:00
fix(outbound): fill encryption and pqv when importing VLESS link
The link-to-JSON importer dropped two VLESS Reality fields: - pqv (post-quantum ML-DSA-65 verify key) was never parsed; map it back to realitySettings.mldsa65Verify, matching the inbound link generator. - encryption was force-reset to 'none' in the form adapter regardless of the parsed value, discarding post-quantum encryption strings. Add regression tests for both paths.
This commit is contained in:
@@ -74,6 +74,25 @@ describe('outbound-form-adapter: round-trip', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('vless preserves a non-none encryption value (post-quantum)', () => {
|
||||
const enc = 'mlkem768x25519plus.native.0rtt.G3cdPSd1-NnlpTbWNSM5vHsT5VNzWfFzYSKwbUMnV1Y';
|
||||
const wire = {
|
||||
protocol: 'vless',
|
||||
settings: {
|
||||
address: 'srv',
|
||||
port: 443,
|
||||
id: '11111111-2222-4333-8444-555555555555',
|
||||
flow: '',
|
||||
encryption: enc,
|
||||
},
|
||||
};
|
||||
const form = rawOutboundToFormValues(wire);
|
||||
if (form.protocol === 'vless') {
|
||||
expect(form.settings.encryption).toBe(enc);
|
||||
}
|
||||
expect((formValuesToWirePayload(form).settings as Record<string, unknown>).encryption).toBe(enc);
|
||||
});
|
||||
|
||||
it('vless emits reverse + sniffing when reverseTag is set', () => {
|
||||
const wire = {
|
||||
protocol: 'vless',
|
||||
|
||||
Reference in New Issue
Block a user