Skip to content

Commit

Permalink
ssh: types for legacy algorithm sets
Browse files Browse the repository at this point in the history
  • Loading branch information
u3s committed Jan 10, 2025
1 parent af13edf commit 8e6d09e
Showing 1 changed file with 67 additions and 51 deletions.
118 changes: 67 additions & 51 deletions lib/ssh/src/ssh.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -128,64 +128,80 @@
-type open_socket() :: gen_tcp:socket().

-type subsystem_spec() :: {Name::string(), mod_args()} .

-type algs_list() :: list( alg_entry() ).
-type alg_entry() :: {kex, [kex_alg()]}
-type alg_entry() :: {kex, [kex_alg()]}
| {public_key, [pubkey_alg()]}
| {cipher, double_algs(cipher_alg())}
| {mac, double_algs(mac_alg())}
| {compression, double_algs(compression_alg())} .

-type kex_alg() :: 'diffie-hellman-group-exchange-sha1' |
'diffie-hellman-group-exchange-sha256' |
'diffie-hellman-group1-sha1' |
'diffie-hellman-group14-sha1' |
'diffie-hellman-group14-sha256' |
'diffie-hellman-group16-sha512' |
'diffie-hellman-group18-sha512' |
'curve25519-sha256' |
'[email protected]' |
'curve448-sha512' |
'ecdh-sha2-nistp256' |
'ecdh-sha2-nistp384' |
'ecdh-sha2-nistp521'
.

-type pubkey_alg() :: 'ecdsa-sha2-nistp256' |
'ecdsa-sha2-nistp384' |
'ecdsa-sha2-nistp521' |
'ssh-ed25519' |
'ssh-ed448' |
'rsa-sha2-256' |
'rsa-sha2-512' |
'ssh-dss' |
'ssh-rsa'
.

-type cipher_alg() :: '3des-cbc' |
'AEAD_AES_128_GCM' |
'AEAD_AES_256_GCM' |
'aes128-cbc' |
'aes128-ctr' |
'[email protected]' |
'aes192-ctr' |
'aes192-cbc' |
'aes256-cbc' |
'aes256-ctr' |
'[email protected]' |
'[email protected]'
.
-type kex_alg() ::
'diffie-hellman-group-exchange-sha256' |
'diffie-hellman-group14-sha256' |
'diffie-hellman-group16-sha512' |
'diffie-hellman-group18-sha512' |
'curve25519-sha256' |
'[email protected]' |
'curve448-sha512' |
'ecdh-sha2-nistp256' |
'ecdh-sha2-nistp384' |
'ecdh-sha2-nistp521' |
legacy_kex_alg().

-type legacy_kex_alg() ::
%% Gone in OpenSSH 7.3.p1
'diffie-hellman-group1-sha1' |
%% Gone in OpenSSH 8.2
'diffie-hellman-group14-sha1' |
'diffie-hellman-group-exchange-sha1'.

-type pubkey_alg() ::
'ecdsa-sha2-nistp256' |
'ecdsa-sha2-nistp384' |
'ecdsa-sha2-nistp521' |
'ssh-ed25519' |
'ssh-ed448' |
'rsa-sha2-256' |
'rsa-sha2-512'.

-type legacy_pubkey_alg() ::
'ssh-rsa' |
%% Gone in OpenSSH 7.3.p1:
'ssh-dss'.

-type cipher_alg() ::
'aes128-ctr' |
'[email protected]' |
'aes192-ctr' |
'aes256-ctr' |
'[email protected]' |
'[email protected]' |
legacy_cipher_alg()
.

-type mac_alg() :: 'AEAD_AES_128_GCM' |
'AEAD_AES_256_GCM' |
'hmac-sha1' |
'[email protected]' |
'hmac-sha1-96' |
'hmac-sha2-256' |
'hmac-sha2-512' |
'[email protected]' |
'[email protected]'
.
-type legacy_cipher_alg() ::
'AEAD_AES_128_GCM' |
'AEAD_AES_256_GCM' |
%% Gone in OpenSSH 7.6
'aes128-cbc' |
'aes192-cbc' |
'aes256-cbc' |
'3des-cbc'.

-type mac_alg() ::
'hmac-sha1' |
'[email protected]' |
'hmac-sha2-256' |
'hmac-sha2-512' |
'[email protected]' |
'[email protected]' |
legacy_mac_alg().

-type legacy_mac_alg() ::
'AEAD_AES_128_GCM' |
'AEAD_AES_256_GCM' |
'hmac-sha1-96'.

-type compression_alg() :: 'none' |
'zlib' |
Expand Down

0 comments on commit 8e6d09e

Please sign in to comment.