@@ -1677,6 +1677,24 @@ test_expect_success GPGSSH 'setup sshkey signed branch' '
1677
1677
git commit -S -m signed_commit
1678
1678
'
1679
1679
1680
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' create signed commits with keys having defined lifetimes' '
1681
+ test_config gpg.format ssh &&
1682
+ touch file &&
1683
+ git add file &&
1684
+
1685
+ echo expired >file && test_tick && git commit -a -m expired -S"${GPGSSH_KEY_EXPIRED}" &&
1686
+ git tag expired-signed &&
1687
+
1688
+ echo notyetvalid >file && test_tick && git commit -a -m notyetvalid -S"${GPGSSH_KEY_NOTYETVALID}" &&
1689
+ git tag notyetvalid-signed &&
1690
+
1691
+ echo timeboxedvalid >file && test_tick && git commit -a -m timeboxedvalid -S"${GPGSSH_KEY_TIMEBOXEDVALID}" &&
1692
+ git tag timeboxedvalid-signed &&
1693
+
1694
+ echo timeboxedinvalid >file && test_tick && git commit -a -m timeboxedinvalid -S"${GPGSSH_KEY_TIMEBOXEDINVALID}" &&
1695
+ git tag timeboxedinvalid-signed
1696
+ '
1697
+
1680
1698
test_expect_success GPGSM ' log x509 fingerprint' '
1681
1699
echo "F8BF62E0693D0694816377099909C779FA23FD65 | " >expect &&
1682
1700
git log -n1 --format="%GF | %GP" signed-x509 >actual &&
@@ -1714,6 +1732,31 @@ test_expect_success GPGSSH 'log --graph --show-signature ssh' '
1714
1732
grep "${GOOD_SIGNATURE_TRUSTED}" actual
1715
1733
'
1716
1734
1735
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' log shows failure on expired signature key' '
1736
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
1737
+ git log --graph --show-signature -n1 expired-signed >actual &&
1738
+ ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
1739
+ '
1740
+
1741
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' log shows failure on not yet valid signature key' '
1742
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
1743
+ git log --graph --show-signature -n1 notyetvalid-signed >actual &&
1744
+ ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
1745
+ '
1746
+
1747
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' log show success with commit date and key validity matching' '
1748
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
1749
+ git log --graph --show-signature -n1 timeboxedvalid-signed >actual &&
1750
+ grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&
1751
+ ! grep "${GPGSSH_BAD_SIGNATURE}" actual
1752
+ '
1753
+
1754
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' log shows failure with commit date outside of key validity' '
1755
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
1756
+ git log --graph --show-signature -n1 timeboxedinvalid-signed >actual &&
1757
+ ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
1758
+ '
1759
+
1717
1760
test_expect_success GPG ' log --graph --show-signature for merged tag' '
1718
1761
test_when_finished "git reset --hard && git checkout main" &&
1719
1762
git checkout -b plain main &&
0 commit comments