Skip to content

Fix #1747#2276

Merged
drwetter merged 1 commit intotestssl:3.1devfrom
dcooper16:pem_fileout
Nov 18, 2022
Merged

Fix #1747#2276
drwetter merged 1 commit intotestssl:3.1devfrom
dcooper16:pem_fileout

Conversation

@dcooper16
Copy link
Copy Markdown
Collaborator

This PR fixes #1747 by converting PEM encoded certificates that are sent to fileout() to a single line. As suggested in #1747, '\n' is added after the '----- BEGIN ... -----' line and before the '------ END ... ------' line.

In order to ensure that '\n' appears in the string in the JSON and CSV files, '\\n' is sent to fileout() so that printf -- "%b" converts '\\n' to '\n' rather than converting '\n' to a newline character.

In order to prevent fileout() from converting '\\n' to '\ ', this PR moves the fix for #2049 (see PR #2050) from fileout() to fatal().

This commit fixes testssl#1747 by converting PEM encoded certificates that are sent to fileout() to a single line. As suggested in testssl#1747, '\n' is added after the '----- BEGIN ... -----' line and before the '------ END ... ------' line.

In order to ensure that '\n' appears in the string in the JSON and CSV files, '\\n' is sent to fileout() so that 'printf -- "%b"' converts '\\n' to '\n' rather than converting '\n' to a newline character.

In order to prevent fileout() from converting '\\n' to '\ ', this commit move the fix for testssl#2049 (see PR testssl#2050) from fileout() to fatal().
@drwetter
Copy link
Copy Markdown
Collaborator

Thanks, David.

The CI run ran for hours. Just restarted it

@drwetter drwetter merged commit 462a602 into testssl:3.1dev Nov 18, 2022
@dcooper16 dcooper16 deleted the pem_fileout branch November 18, 2022 14:13
dcooper16 pushed a commit to dcooper16/testssl.sh that referenced this pull request Nov 25, 2022
This commit fixes incorrect indentations introduced in testssl#2276 and testssl#2278, and also removes the extra whitespace that would have been removed by testssl#2279.
@dcooper16 dcooper16 mentioned this pull request Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove spaces from certificates in JSON

2 participants