Skip to content

Commit

Permalink
Add option to add comments to keychain file (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
Poeloe authored Feb 2, 2024
1 parent 6785e1f commit 4a5f27f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dissect/target/helpers/keychain.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ def register_keychain_file(keychain_path: Path) -> None:
with keychain_path.open(mode="r") as fh:
rows = csv.reader(fh)
for row in rows:
# Skip comment rows (starting with #)
if row[0].startswith("#"):
continue
if len(row) != 4:
log.warning("Expecting 4 values per row in a keychain CSV file, found %d: %s. Skipping", len(row), row)
continue
Expand Down
1 change: 1 addition & 0 deletions tests/_data/helpers/keychain/keychain.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Test comment line
bitlocker,passphrase,,Password1234
,passphrase,,AnotherTestPassword
Bitlocker,recovery_key,,312268-409816-583517-486695-627121-599511-664389-145640
Expand Down

0 comments on commit 4a5f27f

Please sign in to comment.