Commit graph

4 commits

Author SHA1 Message Date
Lukas Puehringer
ad47487011 Remove testutils and setup ssh tests inline
Follow Aditya's suggestion to "embed" all needed testfiles (ssh keys and
askpass script) as bytes and write them to a tmp dir where needed:
https://github.com/gittuf/gittuf/pull/414#discussion_r1618647676

Removes previously added testutils.go

**Interesting discovery**
In order to sign with an "rsa" key, ssh-keygen seems to expect an
"rsa.pub" in the same directory. This is not the case for encrypted rsa,
no for plaintext or encrypted ecdsa or ed25519.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2024-05-29 18:05:52 +02:00
Lukas Puehringer
d4b5116d52 Add new ssh package based on ssh-keygen
* A Key struct, similar to tuf.Key, to be included in TUF metadata (not
  yet implemented), which implements the DSSE Verifier interface, to
  verify signatures created with Signer.

* A Signer struct, which implements the DSSE Signer interface, to create
  signatures using `ssh-keygen` and a path to a key.

* An Import function, to import a Key using `ssh-keygen` and a path to a
  key.

For signing and Key import paths to either public or private, plaintext
or encrypted, rsa, ecdsa or ed25519 keys are supported (akin to git's
user.signingKey configuration).

Also adds basic smoke tests for the `ssh` package, and replaces updates
dsse tests to use this module.

Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
2024-05-27 17:02:39 +02:00
Aditya Sirish
fd7769e3f5
testartifacts: Update test keys
This commit enables testing with ED25519 keys. It also adds the openssh
representation of a public keys as test artifacts for signing Git
objects with SSH using the Git binary.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-07 10:11:49 -04:00
Aditya Sirish
03159de27f
*: Centralize test artifacts
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-01-15 00:23:47 -05:00