Skip to content

Commit

Permalink
feat: add support for the 'ObscureKeystrokeTiming' option
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoss committed Nov 13, 2023
1 parent d25e7d0 commit baad3a8
Show file tree
Hide file tree
Showing 7 changed files with 104,454 additions and 102,259 deletions.
11 changes: 11 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ module.exports = grammar({
$.macs,
$.no_host_authentication_for_localhost,
$.number_of_password_prompts,
$.obscure_keystroke_timing,
$.password_authentication,
$.permit_local_command,
$.permit_remote_open,
Expand Down Expand Up @@ -618,6 +619,16 @@ module.exports = grammar({
number_of_password_prompts_value: $ => alias($.number,
"number_of_password_prompts_value"),

obscure_keystroke_timing: $ => option(
'ObscureKeystrokeTiming',
$.obscure_keystroke_timing_value
),
obscure_keystroke_timing_value: $ => choice(
ignoreCase('yes'),
ignoreCase('no'),
/interval:[1234567890]+/,
),

password_authentication: $ => option(
'PasswordAuthentication',
$.password_authentication_value
Expand Down
3 changes: 3 additions & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
(number_of_password_prompts) @keyword
(number_of_password_prompts_value) @constant.numeric.integer

(obscure_keystroke_timing) @keyword
(obscure_keystroke_timing_value) @constant.builtin.string

(password_authentication) @keyword
(password_authentication_value) @constant.builtin.boolean

Expand Down
95 changes: 95 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@
"type": "SYMBOL",
"name": "number_of_password_prompts"
},
{
"type": "SYMBOL",
"name": "obscure_keystroke_timing"
},
{
"type": "SYMBOL",
"name": "password_authentication"
Expand Down Expand Up @@ -6427,6 +6431,97 @@
"named": false,
"value": "number_of_password_prompts_value"
},
"obscure_keystroke_timing": {
"type": "SEQ",
"members": [
{
"type": "ALIAS",
"content": {
"type": "TOKEN",
"content": {
"type": "PREC",
"value": 1,
"content": {
"type": "PATTERN",
"value": "[oO][bB][sS][cC][uU][rR][eE][kK][eE][yY][sS][tT][rR][oO][kK][eE][tT][iI][mM][iI][nN][gG]"
}
}
},
"named": false,
"value": "ObscureKeystrokeTiming"
},
{
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[ \\t]"
},
{
"type": "STRING",
"value": "="
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "="
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "\""
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "obscure_keystroke_timing_value"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "\""
},
{
"type": "BLANK"
}
]
}
]
},
"obscure_keystroke_timing_value": {
"type": "CHOICE",
"members": [
{
"type": "PATTERN",
"value": "[yY][eE][sS]"
},
{
"type": "PATTERN",
"value": "[nN][oO]"
},
{
"type": "PATTERN",
"value": "interval:[1234567890]+"
}
]
},
"password_authentication": {
"type": "SEQ",
"members": [
Expand Down
28 changes: 28 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,10 @@
"type": "number_of_password_prompts",
"named": true
},
{
"type": "obscure_keystroke_timing",
"named": true
},
{
"type": "password_authentication",
"named": true
Expand Down Expand Up @@ -1886,6 +1890,26 @@
"named": true,
"fields": {}
},
{
"type": "obscure_keystroke_timing",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "obscure_keystroke_timing_value",
"named": true
}
]
}
},
{
"type": "obscure_keystroke_timing_value",
"named": true,
"fields": {}
},
{
"type": "password_authentication",
"named": true,
Expand Down Expand Up @@ -3066,6 +3090,10 @@
"type": "NumberOfPasswordPrompts",
"named": false
},
{
"type": "ObscureKeystrokeTiming",
"named": false
},
{
"type": "PKCS11Provider",
"named": false
Expand Down
Loading

0 comments on commit baad3a8

Please sign in to comment.