changes since v2: - fix swich/case indentation - BUG() on unknown payload types - improve test prereq by actually validating ssh-keygen functionality changes since v1: - struct signature_check is now used to input payload data into check_function - payload metadata parsing is completely internal to check_signature. the caller only need to set the payload type in the sigc struct - small nits and readability fixes - removed payload_signer parameter. since we now use the struct we can extend this later. Fabian Stelzer (7): ssh signing: use sigc struct to pass payload ssh signing: add key lifetime test prereqs ssh signing: make verify-commit consider key lifetime ssh signing: make git log verify key lifetime ssh signing: make verify-tag consider key lifetime ssh signing: make fmt-merge-msg consider key lifetime ssh signing: verify ssh-keygen in test prereq Documentation/config/gpg.txt | 5 ++ builtin/receive-pack.c | 6 ++- commit.c | 6 ++- fmt-merge-msg.c | 5 +- gpg-interface.c | 90 +++++++++++++++++++++++++------- gpg-interface.h | 15 ++++-- log-tree.c | 10 ++-- t/lib-gpg.sh | 36 ++++++++++--- t/t4202-log.sh | 43 +++++++++++++++ t/t6200-fmt-merge-msg.sh | 54 +++++++++++++++++++ t/t7031-verify-tag-signed-ssh.sh | 42 +++++++++++++++ t/t7528-signed-commit-ssh.sh | 42 +++++++++++++++ tag.c | 5 +- 13 files changed, 318 insertions(+), 41 deletions(-) Range-diff against v2: 1: 11d275b53f = 1: 9f71fd8639 ssh signing: use sigc struct to pass payload 2: 35ee285887 = 2: 5ee143bc38 ssh signing: add key lifetime test prereqs 3: ccfba23934 ! 3: 3183e84e2e ssh signing: make verify-commit consider key lifetime @@ gpg-interface.c: static int verify_ssh_signed_buffer(struct signature_check *sig + struct ident_split ident; + const char *signer_header; + -+ switch(sigc->payload_type) { -+ case SIGNATURE_PAYLOAD_COMMIT: -+ signer_header = "committer"; -+ break; -+ case SIGNATURE_PAYLOAD_TAG: -+ signer_header = "tagger"; -+ break; -+ default: -+ /* Ignore unknown payload types */ -+ return 0; ++ switch (sigc->payload_type) { ++ case SIGNATURE_PAYLOAD_COMMIT: ++ signer_header = "committer"; ++ break; ++ case SIGNATURE_PAYLOAD_TAG: ++ signer_header = "tagger"; ++ break; ++ case SIGNATURE_PAYLOAD_UNDEFINED: ++ case SIGNATURE_PAYLOAD_PUSH_CERT: ++ /* Ignore payloads we don't want to parse */ ++ return 0; ++ default: ++ BUG("invalid value for sigc->payload_type"); + } + + ident_line = find_commit_header(sigc->payload, signer_header, &ident_len); 4: ef8178f88b = 4: e35515867c ssh signing: make git log verify key lifetime 5: c12457020e = 5: e20177d950 ssh signing: make verify-tag consider key lifetime 6: fe17c60276 = 6: 2af2b6d098 ssh signing: make fmt-merge-msg consider key lifetime -: ---------- > 7: e6e2236a52 ssh signing: verify ssh-keygen in test prereq base-commit: cd3e606211bb1cf8bc57f7d76bab98cc17a150bc -- 2.31.1