fix(psk): add more PSK ciphers support
This commit is contained in:
parent
925787bc59
commit
6d8dd430fd
|
@ -2290,12 +2290,15 @@ end}.
|
|||
%% In erlang, we only support the following PSK ciphers (ssl_cipher:psk_suites(3))
|
||||
AvaiableCiphers = ["RSA-PSK-AES256-GCM-SHA384","RSA-PSK-AES256-CBC-SHA384",
|
||||
"RSA-PSK-AES128-GCM-SHA256","RSA-PSK-AES128-CBC-SHA256",
|
||||
"RSA-PSK-AES256-CBC-SHA","RSA-PSK-AES128-CBC-SHA"
|
||||
"RSA-PSK-AES256-CBC-SHA","RSA-PSK-AES128-CBC-SHA",
|
||||
%% The below ciphers are supported
|
||||
%% But they aren't visible in `ssl:cipher_suites`
|
||||
"PSK-AES256-GCM-SHA384","PSK-AES128-GCM-SHA256",
|
||||
"PSK-AES256-CBC-SHA384","PSK-AES256-CBC-SHA",
|
||||
"PSK-AES128-CBC-SHA256","PSK-AES128-CBC-SHA"
|
||||
],
|
||||
%% Compatible with legacy PSK Cipher strings
|
||||
PskMapping = fun("PSK-AES128-CBC-SHA") -> {true, "RSA-PSK-AES128-CBC-SHA"};
|
||||
("PSK-AES256-CBC-SHA") -> {true, "RSA-PSK-AES256-CBC-SHA"};
|
||||
("PSK-3DES-EDE-CBC-SHA") -> {true, "PSK-3DES-EDE-CBC-SHA"};
|
||||
PskMapping = fun("PSK-3DES-EDE-CBC-SHA") -> {true, "PSK-3DES-EDE-CBC-SHA"};
|
||||
("PSK-RC4-SHA") -> {true, "PSK-RC4-SHA"};
|
||||
(C) -> case lists:member(C, AvaiableCiphers) of
|
||||
true -> {true, C};
|
||||
|
|
Loading…
Reference in New Issue