Skip to content

Commit

Permalink
Add trailing newline on signature output
Browse files Browse the repository at this point in the history
A minisign signature consists of lines of text.

On Windows, text files are newline-delimited: newlines are needed only to separate lines, and a line can be valid without a newline after it (should it be the last line in a file).

On UNIX, text files are newline-terminated: to be a fully legal text file, each line _including the last one_ is expected to have a trailing newline.

The upstream C minisign tool follows UNIX conventions for signature output in this respect. With this PR, the golang tool does likewise.
  • Loading branch information
charles-dyfis-net authored and aead committed Jan 22, 2023
1 parent 6214f2a commit c8b5358
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func (s Signature) String() string {
buffer.WriteByte('\n')

buffer.WriteString(base64.StdEncoding.EncodeToString(s.CommentSignature[:]))
buffer.WriteByte('\n')

return buffer.String()
}

Expand Down

0 comments on commit c8b5358

Please sign in to comment.