Skip to content

Commit

Permalink
Fix crash when public key cannot be parsed. (#551) (#552)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d24d04)

Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
patchback[bot] and felixfontein authored Dec 28, 2022
1 parent 6f8131a commit e2ecd14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/551-publickey-info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "openssl_publickey_info - do not crash with internal error when public key cannot be parsed (https:/ansible-collections/community.crypto/pull/551)."
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def get_info(self, prefer_one_fingerprint=False):
try:
self.key = load_publickey(content=self.content, backend=self.backend)
except OpenSSLObjectError as e:
raise PublicKeyParseError(to_native(e))
raise PublicKeyParseError(to_native(e), {})

pk = self._get_public_key(binary=True)
result['fingerprints'] = get_fingerprint_of_bytes(
Expand Down

0 comments on commit e2ecd14

Please sign in to comment.