Skip to content

Commit c6bd586

Browse files
committed
Fixes parsing of broken PGP armored structures. Very atypical but we've already found a few on GitHub accounts.
1 parent f20e709 commit c6bd586

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/gitxray/include/gx_ugly_openpgp_parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ def ugly_inhouse_openpgp_block(pgp_armored_input):
121121
base64_str = re.sub(r'Charset: (.+)\r?\n?', '', base64_str)
122122
base64_str = re.sub(r'Version: (.+)\r?\n?', '', base64_str)
123123
base64_str = re.sub(r'Comment: (.+)\r?\n?', '', base64_str)
124-
base64_str = re.sub(r'-----END PGP SIGNATURE-----|-----END PGP PUBLIC KEY BLOCK-----', '', base64_str)
124+
base64_str = re.sub(r'-----END PGP (.+)', '', base64_str)
125125
base64_str = re.sub(r'\s+', '', base64_str)
126-
127126
decoded_blob = base64.b64decode(base64_str.encode('ascii', 'ignore'))
128127

129128
try:

0 commit comments

Comments
 (0)