1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-23 01:22:37 +03:00

Reorder AES crypt methods so stronger ones are first

This make it more likely that a stronger one will be negotiated rather
than a weaker variant.
This commit is contained in:
Dan Fandrich
2023-02-07 16:58:34 -08:00
parent 879a2e4bf6
commit eefc06f2ef

View File

@@ -310,11 +310,13 @@ static const LIBSSH2_CRYPT_METHOD libssh2_crypt_method_3des_cbc = {
};
#endif
/* These are the crypt methods that are available to be negotiated. Methods
towards the start are chosen in preference to ones further down the list. */
static const LIBSSH2_CRYPT_METHOD *_libssh2_crypt_methods[] = {
#if LIBSSH2_AES_CTR
&libssh2_crypt_method_aes128_ctr,
&libssh2_crypt_method_aes192_ctr,
&libssh2_crypt_method_aes256_ctr,
&libssh2_crypt_method_aes192_ctr,
&libssh2_crypt_method_aes128_ctr,
#endif /* LIBSSH2_AES */
#if LIBSSH2_AES
&libssh2_crypt_method_aes256_cbc,