Skip to content

Commit 7a8a6e4

Browse files
authored
Merge pull request #287 from vin01/master
Detect putty & sshcom private keys
2 parents a66a330 + 45d3850 commit 7a8a6e4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pre_commit_hooks/detect_private_key.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
b'BEGIN EC PRIVATE KEY',
1010
b'BEGIN OPENSSH PRIVATE KEY',
1111
b'BEGIN PRIVATE KEY',
12+
b'PuTTY-User-Key-File-2',
13+
b'BEGIN SSH2 ENCRYPTED PRIVATE KEY',
1214
]
1315

1416

tests/detect_private_key_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
(b'-----BEGIN DSA PRIVATE KEY-----', 1),
99
(b'-----BEGIN EC PRIVATE KEY-----', 1),
1010
(b'-----BEGIN OPENSSH PRIVATE KEY-----', 1),
11+
(b'PuTTY-User-Key-File-2: ssh-rsa', 1),
12+
(b'---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----', 1),
1113
(b'ssh-rsa DATA', 0),
1214
(b'ssh-dsa DATA', 0),
1315
# Some arbitrary binary data

0 commit comments

Comments
 (0)