diff options
author | Fabian Stelzer <fs@gigacodes.de> | 2021-12-09 09:52:43 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-09 13:38:04 -0800 |
commit | 02769437e1421d837f6de27cfb5c14087cfec8dd (patch) | |
tree | c22e72f64810c036e48f4b17adbfc963e43c7e92 /gpg-interface.h | |
parent | t/fmt-merge-msg: make gpgssh tests more specific (diff) | |
download | tgif-02769437e1421d837f6de27cfb5c14087cfec8dd.tar.xz |
ssh signing: use sigc struct to pass payload
To be able to extend the payload metadata with things like its creation
timestamp or the creators ident we remove the payload parameters to
check_signature() and use the already existing sigc->payload field
instead, only adding the length field to the struct. This also allows
us to get rid of the xmemdupz() calls in the verify functions. Since
sigc is now used to input data as well as output the result move it to
the front of the function list.
- Add payload_length to struct signature_check
- Populate sigc.payload/payload_len on all call sites
- Remove payload parameters to check_signature()
- Remove payload parameters to internal verify_* functions and use sigc
instead
- Remove xmemdupz() used for verbose output since payload is now already
populated.
Signed-off-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.h')
-rw-r--r-- | gpg-interface.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gpg-interface.h b/gpg-interface.h index beefacbb1e..5ee7d8b6b9 100644 --- a/gpg-interface.h +++ b/gpg-interface.h @@ -17,6 +17,7 @@ enum signature_trust_level { struct signature_check { char *payload; + size_t payload_len; char *output; char *gpg_status; @@ -70,9 +71,8 @@ const char *get_signing_key(void); * Either a GPG KeyID or a SSH Key Fingerprint */ const char *get_signing_key_id(void); -int check_signature(const char *payload, size_t plen, - const char *signature, size_t slen, - struct signature_check *sigc); +int check_signature(struct signature_check *sigc, + const char *signature, size_t slen); void print_signature_buffer(const struct signature_check *sigc, unsigned flags); |