Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sshd lens for additional list #806

Merged
merged 1 commit into from
Mar 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lenses/sshd.aug
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module Sshd =
let indent = del /[ \t]*/ " "

let key_re = /[A-Za-z0-9]+/
- /MACs|Match|AcceptEnv|Subsystem|Ciphers|((GSSAPI|)Kex|HostKey|CASignature)Algorithms|PubkeyAcceptedKeyTypes|(Allow|Deny)(Groups|Users)/i
- /MACs|Match|AcceptEnv|Subsystem|Ciphers|((GSSAPI|)Kex|HostKey|CASignature|PubkeyAccepted)Algorithms|PubkeyAcceptedKeyTypes|(Allow|Deny)(Groups|Users)/i

let comment = Util.comment
let comment_noindent = Util.comment_noindent
Expand Down Expand Up @@ -124,12 +124,14 @@ module Sshd =
let casignaturealgorithms = list /CASignatureAlgorithms/i "CASignatureAlgorithms"

let pubkeyacceptedkeytypes = list /PubkeyAcceptedKeyTypes/i "PubkeyAcceptedKeyTypes"

let pubkeyacceptedalgorithms = list /PubkeyAcceptedAlgorithms/i "PubkeyAcceptedAlgorithms"

let entry = accept_env | allow_groups | allow_users
| deny_groups | subsystem | deny_users
| macs | ciphers | kexalgorithms | hostkeyalgorithms
| gssapikexalgorithms | casignaturealgorithms
| pubkeyacceptedkeytypes | other_entry
| pubkeyacceptedkeytypes | pubkeyacceptedalgorithms | other_entry

let condition_entry =
let k = /[A-Za-z0-9]+/ in
Expand Down
9 changes: 8 additions & 1 deletion lenses/tests/test_sshd.aug
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ Match Group \"Domain users\"

(* Test: Sshd.lns
Parse Ciphers, KexAlgorithms, HostKeyAlgorithms as lists (GH issue #69)
Parse GSSAPIKexAlgorithms, PubkeyAcceptedKeyTypes, CASignatureAlgorithms as lists (GH PR #721) *)
Parse GSSAPIKexAlgorithms, PubkeyAcceptedKeyTypes, CASignatureAlgorithms as lists (GH PR #721)
Parse PubkeyAcceptedAlgorithms as a list (GH issue #804) *)
test Sshd.lns get "Ciphers [email protected],[email protected],aes256-ctr,aes128-ctr
KexAlgorithms diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,ssh-rsa
GSSAPIKexAlgorithms gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-
PubkeyAcceptedKeyTypes ecdsa-sha2-nistp256,[email protected],ecdsa-sha2-nistp384
PubkeyAcceptedAlgorithms ecdsa-sha2-nistp256,[email protected],ecdsa-sha2-nistp384
CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521\n" =
{ "Ciphers"
{ "1" = "[email protected]" }
Expand Down Expand Up @@ -135,6 +137,11 @@ CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp52
{ "2" = "[email protected]" }
{ "3" = "ecdsa-sha2-nistp384" }
}
{ "PubkeyAcceptedAlgorithms"
{ "1" = "ecdsa-sha2-nistp256" }
{ "2" = "[email protected]" }
{ "3" = "ecdsa-sha2-nistp384" }
}
{ "CASignatureAlgorithms"
{ "1" = "ecdsa-sha2-nistp256" }
{ "2" = "ecdsa-sha2-nistp384" }
Expand Down