-
Notifications
You must be signed in to change notification settings - Fork 54
Conversation
Also, add a passphrase fetcher to the keyring, and have that fetcher passed to every key.
e36001d
to
3a5327e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; though admittedly rusty in opengpg signing (but refreshing my knowledge now). It all appears clear and intuitive. Nearly all comments are on comments :), though one small unit test question.
pkg/signature/keys.go
Outdated
"golang.org/x/crypto/openpgp/packet" | ||
) | ||
|
||
// PassphraseFetcher recieves a keyname, and is responsible for returning the associated passphrase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i before e, except after c :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol. Fixing
pkg/signature/keys.go
Outdated
|
||
// Key returns the key with the given ID. | ||
// | ||
// ID is a hex ID or (conventionally) and email address. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/and/an
pkg/signature/keys.go
Outdated
return nil, errors.New("multiple matching keys found") | ||
} | ||
|
||
// Save writes a keycring to disk as a binary entity list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/keycring/keyring
}() | ||
|
||
newfile := filepath.Join(dirname, "save.gpg") | ||
is.NoError(kr.Save(newfile, true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To thoroughly test clobber=true
functionality, would we want to pre-create/pre-populate newfile
before this Save
?
pkg/signature/signature.go
Outdated
|
||
// Signer can sign bundles | ||
// | ||
// Signatures are OpenPGP Section 7 clear signed blocks represented as ASCII-armored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the convention is clear signed
be one word
pkg/signature/signature.go
Outdated
|
||
// Attest generates an attestation (detached signature) for a signed bundle. | ||
// | ||
// This ONLY works on signed bundle files, and it rerequires the signed bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should read requires
?
pkg/signature/signature.go
Outdated
|
||
// We clearsign instead of using the openpgp.ArmoredDetachedSignText because the | ||
// later does not handle subkeys at all. It ONLY allows using the private key on | ||
// the main entity. Yet all the helper methods for that are unexported. This it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/This/Thus
?
Addressed all of @vdice 's concerns |
This adds
pkg/signature
, which is a library for signing, attesting, and verifying bundles.I decided to do this as a standalone PR before adding signature support to all of the commands, as this is a fairly big addition.