diff options
author | Billy Lynch <billy@chainguard.dev> | 2024-02-13 15:33:37 -0500 |
---|---|---|
committer | Billy Lynch <billy@chainguard.dev> | 2024-02-13 15:56:28 -0500 |
commit | 9fa13d83c6e473d0aca7b97a620b3f4a003993f6 (patch) | |
tree | bb994824c5dc8fcad5500a9832ea57046d4684cc /utils | |
parent | 0dfff253b0b0ad7886d82bf9713e738e1045df1b (diff) | |
download | go-git-9fa13d83c6e473d0aca7b97a620b3f4a003993f6.tar.gz |
git: signer, fix usage of crypto.Signer interface
crypto.Signer was incorrectly used before. Signer documentation says
that Signer.Sign should be used on digests, whereas we were using this
on message bodies.
To fix this, create our own Signer interface (+ signableObject borrowed
from #705) that describes more accurately what we want.
As before, the expectation is that signer implementations only need to
worry about acting on encoded message bodies rather than needing to
encode objects themselves.
This is technically a breaking change from the previous Signer
implementation, but since this is new and hasn't made it into cut
release yet, this seems like an acceptible change.
Also adds example test showing how signers can be made (uses base64 for
consistent outputs).
Diffstat (limited to 'utils')
0 files changed, 0 insertions, 0 deletions