diff --git a/src/models/user.rs b/src/models/user.rs index cba287e..80d5a61 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -577,7 +577,16 @@ fn validate_ssh_key_list( ) -> std::result::Result<(), ValidationError> { lazy_static! { static ref SSH_KEY_REGEX: Regex = Regex::new( - r"ssh-(rsa|dsa|ecdsa|ed25519) [a-zA-Z0-9+/]{1,750}={0,3}( [^ ]+)?" + r"(?x)^ + ( + ssh-(rsa|dss|ecdsa|ed25519)| + ecdsa-sha2-nistp(256|384|521)| + sk-( + ecdsa-sha2-nistp256@openssh.com| + ssh-ed25519@openssh.com + ) + ) + \s[a-zA-Z0-9+/]{1,750}={0,3}( \S+)?" ) .unwrap(); }