mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
Handle win style CRLF newlines in vault text (#27590)
When parsing a vaulttext blob, use .splitlines() instead of split(b'\n') to handle \n newlines and windows style \r\n (CRLF) new lines. The vaulttext enevelope at this point is just the header line and a hexlify()'ed blob, so CRLF is a valid newline here. Fixes #22914
This commit is contained in:
parent
8f18ca45f1
commit
2b0a7338d4
2 changed files with 9 additions and 1 deletions
|
@ -159,7 +159,7 @@ def parse_vaulttext_envelope(b_vaulttext_envelope, default_vault_id=None):
|
|||
# used by decrypt
|
||||
default_vault_id = default_vault_id or C.DEFAULT_VAULT_IDENTITY
|
||||
|
||||
b_tmpdata = b_vaulttext_envelope.split(b'\n')
|
||||
b_tmpdata = b_vaulttext_envelope.splitlines()
|
||||
b_tmpheader = b_tmpdata[0].strip().split(b';')
|
||||
|
||||
b_version = b_tmpheader[1].strip()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue