Codechange: make NetworkAuthenticationMethodMask an EnumBitSet

This commit is contained in:
Rubidium
2025-02-06 16:19:01 +01:00
committed by rubidium42
parent 693a5f42b9
commit fef2baf041
5 changed files with 23 additions and 23 deletions
+7 -7
View File
@@ -174,15 +174,15 @@ public:
/** The authentication method that can be used. */
enum NetworkAuthenticationMethod : uint8_t {
NETWORK_AUTH_METHOD_X25519_KEY_EXCHANGE_ONLY, ///< No actual authentication is taking place, just perform a x25519 key exchange. This method is not supported for the admin connection.
NETWORK_AUTH_METHOD_X25519_PAKE, ///< Authentication using x25519 password-authenticated key agreement.
NETWORK_AUTH_METHOD_X25519_AUTHORIZED_KEY, ///< Authentication using x22519 key exchange and authorized keys.
NETWORK_AUTH_METHOD_END, ///< Must ALWAYS be on the end of this list!! (period)
enum class NetworkAuthenticationMethod : uint8_t {
X25519_KeyExchangeOnly, ///< No actual authentication is taking place, just perform a x25519 key exchange. This method is not supported for the admin connection.
X25519_PAKE, ///< Authentication using x25519 password-authenticated key agreement.
X25519_AuthorizedKey, ///< Authentication using x22519 key exchange and authorized keys.
End, ///< Must ALWAYS be on the end of this list!! (period)
};
/** The mask of authentication methods that can be used. */
using NetworkAuthenticationMethodMask = uint16_t;
using NetworkAuthenticationMethodMask = EnumBitSet<NetworkAuthenticationMethod, uint16_t>;
/**
* Base class for cryptographic authentication handlers.
@@ -296,7 +296,7 @@ public:
*/
virtual std::string GetPeerPublicKey() const = 0;
static std::unique_ptr<NetworkAuthenticationServerHandler> Create(const NetworkAuthenticationPasswordProvider *password_provider, const NetworkAuthenticationAuthorizedKeyHandler *authorized_key_handler, NetworkAuthenticationMethodMask client_supported_method_mask = ~static_cast<NetworkAuthenticationMethodMask>(0));
static std::unique_ptr<NetworkAuthenticationServerHandler> Create(const NetworkAuthenticationPasswordProvider *password_provider, const NetworkAuthenticationAuthorizedKeyHandler *authorized_key_handler, NetworkAuthenticationMethodMask client_supported_method_mask = {NetworkAuthenticationMethod::X25519_KeyExchangeOnly, NetworkAuthenticationMethod::X25519_PAKE, NetworkAuthenticationMethod::X25519_AuthorizedKey});
};
#endif /* NETWORK_CRYPTO_H */