Skip to content

Commit

Permalink
Change: update windows oid matching code
Browse files Browse the repository at this point in the history
  • Loading branch information
amy-gb committed Jan 15, 2025
1 parent 7f5e932 commit 437fd08
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions troubadix/plugins/valid_oid.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ def check_content(

# product-specific OIDs
if "1.3.6.1.4.1.25623.1.2." in oid:
name_patter = get_special_script_tag_pattern(SpecialScriptTag.NAME)
name_match = name_patter.search(file_content)
name_pattern = get_special_script_tag_pattern(SpecialScriptTag.NAME)
name_match = name_pattern.search(file_content)
if not name_match or not name_match.group("value"):
yield LinterError(
"VT is missing a script name!",
Expand Down Expand Up @@ -389,16 +389,15 @@ def check_content(

# Fixed OID-scheme for Windows OIDs
if "1.3.6.1.4.1.25623.1.3." in oid:
family = family_match.group("value")
if not family_match or not family:
if not family_match or not family_match.group("value"):
yield LinterError(
"VT is missing a script family!",
file=nasl_file,
plugin=self.name,
)
return

if family != windows_family_template:
if family_match.group("value") != windows_family_template:
yield LinterError(
f"script_oid() {is_using_reserved} 'Windows' ("
f"{str(oid)})",
Expand Down

0 comments on commit 437fd08

Please sign in to comment.