Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify requirement 19: ASCII vs. Binary signature #797

Open
tschmidtb51 opened this issue Oct 17, 2024 · 6 comments
Open

Clarify requirement 19: ASCII vs. Binary signature #797

tschmidtb51 opened this issue Oct 17, 2024 · 6 comments
Assignees
Labels
csaf 2.1 csaf 2.1 work investigation needed anything that needs some investigation

Comments

@tschmidtb51
Copy link
Contributor

We should clarify whether we expect signatures to be in ASCII or binary format or both should be accepted. Therefore, we need to figure out whether it make a difference for implementers.

@tschmidtb51 tschmidtb51 added the investigation needed anything that needs some investigation label Oct 17, 2024
@bernhardreiter
Copy link
Contributor

The question should be evaluated for public key files as well. Relevant languages to check would include Java, Rust and Go (according to @tschmidtb51).

@bernhardreiter
Copy link
Contributor

bernhardreiter commented Oct 28, 2024

In general: Any additional variant will make a standard a little bit harder to understand, write and read. And several little variants will easily multiply the difficulty. So personally I'd rather allow one variant less unless it is really having a significant advantage. So the burden of proof would be on the proposed enhancement from my perspective.

There are two possible advantages for allowing both file formats for signatures and public keys:

  • An implementation would not need to transform (or recreate) the files if it got them already in one of two formats.
  • The binary files could save a bit of space as they are more compact.

CSAF 2.0 documents are in JSON, which is quite verbose. Compared to those documents, the size increase by using ASCII armored signatures and public key file is just a little. So if one format is to be selected, ASCII armored seems to be the better fit with in the CSAF 2.0 family of files.

For implementations that find and read CSAF documents, the potential drawback is that they may need to transform the files before processing.

In order to find out how implementations behave I focus on the parsing side of the files.
Reading happens more often than writing (and I lack data about what files are already existing on the potential CSAF Trusted Provider sides).

The next steps are to check which preferred methods for reading pubkeys and checking signatures are for the different languages.

GnuPG

And elder version of gpg (GnuPG) 2.2.40
does not make a difference when checking a detached signature as ascii or binary format.
Importing also behaves the same.

(Using GnuPG via the library GPGME is a common method to interact with GnuPG, which is a widespread OpenPGP implementation. It is used by many other programming languages.)

Java

https://gh.pgpainless.org/ or https://www.bouncycastle.org/

TODO

Rust

TODO

Go

https://github.com/ProtonMail/gopenpgp is a common choice if an OpenPGP/LibrePGP library in Go is wanted.
It is a fork from the Go standard library module, which is deprecated now.

Also used by https://github.com/csaf-poc/csaf_distribution.

Ease of implementation

Doing a documentation level research:
https://pkg.go.dev/github.com/ProtonMail/gopenpgp/[email protected]/crypto#PGPVerify

especially VerifyDetached() offers the option to set encoding to Auto which detects unarmored or armored detached signaturs.

https://pkg.go.dev/github.com/ProtonMail/gopenpgp/[email protected]/crypto#NewKey
also accepts both types.

So if the general functions are used to begin with, there is no extra
code when reading pubkeys or signatures in both formats.

@sthagen
Copy link
Contributor

sthagen commented Oct 29, 2024

"requirement 19" is a to me unclear reference. Can we rename the ticket or name the CSAF v2.0 or v2.1 specific target? Thanks.

@tschmidtb51
Copy link
Contributor Author

tschmidtb51 commented Oct 29, 2024

"requirement 19" is a to me unclear reference. Can we rename the ticket or name the CSAF v2.0 or v2.1 specific target? Thanks.

It is kind of independent of the version - the requirement is still the same. But I guess, we will focus first on CSAF 2.1

@tschmidtb51 tschmidtb51 added the csaf 2.1 csaf 2.1 work label Oct 29, 2024
@sthagen
Copy link
Contributor

sthagen commented Oct 30, 2024

I think I was not clear, sorry. My question is, what the relevance of "requirement 19" is, where I can find that ... or if this is some "catalog of requirements" not related to our specification but to some contract or suggested tool. Thanks.

@tschmidtb51
Copy link
Contributor Author

tschmidtb51 commented Oct 30, 2024

I think I was not clear, sorry. My question is, what the relevance of "requirement 19" is, where I can find that ... or if this is some "catalog of requirements" not related to our specification but to some contract or suggested tool. Thanks.

I'm sorry - my bad: The issue refers to the requirement 19 from section 7.1.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csaf 2.1 csaf 2.1 work investigation needed anything that needs some investigation
Projects
None yet
Development

No branches or pull requests

3 participants