mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-10-25 05:50:47 +00:00
Ignore invalid ciphers
This commit is contained in:
parent
dd3e3f7df2
commit
3b62fcf9af
1 changed files with 11 additions and 0 deletions
|
|
@ -56,6 +56,11 @@ export class OutlineShadowsocksServer implements ShadowsocksServer {
|
|||
return new Promise((resolve, reject) => {
|
||||
const keysJson = {keys: [] as AccessKey[]};
|
||||
for (const key of keys) {
|
||||
if (!isAeadCipher(key.cipher)) {
|
||||
logging.error(`Cipher ${key.cipher} for access key ${
|
||||
key.id} is not supported: use an AEAD cipher instead.`);
|
||||
continue;
|
||||
}
|
||||
keysJson.keys.push(key);
|
||||
}
|
||||
const ymlTxt = jsyaml.safeDump(keysJson, {'sortKeys': true});
|
||||
|
|
@ -92,3 +97,9 @@ export class OutlineShadowsocksServer implements ShadowsocksServer {
|
|||
this.ssProcess.stderr.pipe(process.stderr);
|
||||
}
|
||||
}
|
||||
|
||||
// List of AEAD ciphers can be found at https://shadowsocks.org/en/spec/AEAD-Ciphers.html
|
||||
function isAeadCipher(cipherAlias: string) {
|
||||
cipherAlias = cipherAlias.toLowerCase();
|
||||
return cipherAlias.endsWith('gcm') || cipherAlias.endsWith('poly1305');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue