Skip to content

trim carriage-return at the end of signature comments#8

Merged
aead merged 1 commit intomainfrom
carriage-return
Apr 8, 2021
Merged

trim carriage-return at the end of signature comments#8
aead merged 1 commit intomainfrom
carriage-return

Conversation

@aead
Copy link
Copy Markdown
Owner

@aead aead commented Apr 8, 2021

This commit fixes a bug when parsing minisign signatures.
Before, any carriage return ('\r') at the end of a
trusted / untrusted comment was not removed. This lead to
signature verification failures. In particular, the verification
of the comment signature fails when e.g. the OS uses \r\n for
newlines instead of \n.

Byte representation of a trusted comment - with and without the
trailing carriage return.

[116 105 109 101 115 116 97 109 112 58 49 54 49 55 55 50 49 48 50 51 9 102 105 108 101 58 114 111 98 116 101 115 116 46 112 115 49 13]
[116 105 109 101 115 116 97 109 112 58 49 54 49 55 55 50 49 48 50 51 9 102 105 108 101 58 114 111 98 116 101 115 116 46 112 115 49]

Fixes #7

This commit fixes a bug when parsing minisign signatures.
Before, any carriage return ('\r') at the end of a
trusted / untrusted comment was not removed. This lead to
signature verification failures. In particular, the verification
of the comment signature fails when e.g. the OS uses `\r\n` for
newlines instead of `\n`.

Byte representation of a trusted comment - with and without the
trailing carriage return.
```
[116 105 109 101 115 116 97 109 112 58 49 54 49 55 55 50 49 48 50 51 9 102 105 108 101 58 114 111 98 116 101 115 116 46 112 115 49 13]
[116 105 109 101 115 116 97 109 112 58 49 54 49 55 55 50 49 48 50 51 9 102 105 108 101 58 114 111 98 116 101 115 116 46 112 115 49]
```

Fixes #7
@aead aead mentioned this pull request Apr 8, 2021
@aead aead merged commit 2d3f973 into main Apr 8, 2021
@aead aead deleted the carriage-return branch April 10, 2021 11:36
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.

Signature verification broken

1 participant