@@ -91,6 +91,26 @@ test_expect_success GPGSSH 'created ssh signed commit and tag' '
91
91
git tag -s -u"${GPGSSH_KEY_UNTRUSTED}" -m signed-ssh-tag-msg-untrusted signed-untrusted-ssh-tag left
92
92
'
93
93
94
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' create signed tags with keys having defined lifetimes' '
95
+ test_when_finished "test_unconfig commit.gpgsign" &&
96
+ test_config gpg.format ssh &&
97
+ git checkout -b signed-expiry-ssh &&
98
+ touch file &&
99
+ git add file &&
100
+
101
+ echo expired >file && test_tick && git commit -a -m expired -S"${GPGSSH_KEY_EXPIRED}" &&
102
+ git tag -s -u "${GPGSSH_KEY_EXPIRED}" -m expired-signed expired-signed &&
103
+
104
+ echo notyetvalid >file && test_tick && git commit -a -m notyetvalid -S"${GPGSSH_KEY_NOTYETVALID}" &&
105
+ git tag -s -u "${GPGSSH_KEY_NOTYETVALID}" -m notyetvalid-signed notyetvalid-signed &&
106
+
107
+ echo timeboxedvalid >file && test_tick && git commit -a -m timeboxedvalid -S"${GPGSSH_KEY_TIMEBOXEDVALID}" &&
108
+ git tag -s -u "${GPGSSH_KEY_TIMEBOXEDVALID}" -m timeboxedvalid-signed timeboxedvalid-signed &&
109
+
110
+ echo timeboxedinvalid >file && test_tick && git commit -a -m timeboxedinvalid -S"${GPGSSH_KEY_TIMEBOXEDINVALID}" &&
111
+ git tag -s -u "${GPGSSH_KEY_TIMEBOXEDINVALID}" -m timeboxedinvalid-signed timeboxedinvalid-signed
112
+ '
113
+
94
114
test_expect_success ' message for merging local branch' '
95
115
echo "Merge branch ${apos}left${apos}" >expected &&
96
116
@@ -139,6 +159,44 @@ test_expect_success GPGSSH 'message for merging local tag signed by unknown ssh
139
159
! grep "${GPGSSH_BAD_SIGNATURE}" actual &&
140
160
grep "${GPGSSH_KEY_NOT_TRUSTED}" actual
141
161
'
162
+
163
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' message for merging local tag signed by expired ssh key' '
164
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
165
+ git checkout main &&
166
+ git fetch . expired-signed &&
167
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
168
+ grep "^Merge tag ${apos}expired-signed${apos}" actual &&
169
+ ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
170
+ '
171
+
172
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' message for merging local tag signed by not yet valid ssh key' '
173
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
174
+ git checkout main &&
175
+ git fetch . notyetvalid-signed &&
176
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
177
+ grep "^Merge tag ${apos}notyetvalid-signed${apos}" actual &&
178
+ ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
179
+ '
180
+
181
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' message for merging local tag signed by valid timeboxed ssh key' '
182
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
183
+ git checkout main &&
184
+ git fetch . timeboxedvalid-signed &&
185
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
186
+ grep "^Merge tag ${apos}timeboxedvalid-signed${apos}" actual &&
187
+ grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual &&
188
+ ! grep "${GPGSSH_BAD_SIGNATURE}" actual
189
+ '
190
+
191
+ test_expect_success GPGSSH,GPGSSH_VERIFYTIME ' message for merging local tag signed by invalid timeboxed ssh key' '
192
+ test_config gpg.ssh.allowedSignersFile "${GPGSSH_ALLOWED_SIGNERS}" &&
193
+ git checkout main &&
194
+ git fetch . timeboxedinvalid-signed &&
195
+ git fmt-merge-msg <.git/FETCH_HEAD >actual &&
196
+ grep "^Merge tag ${apos}timeboxedinvalid-signed${apos}" actual &&
197
+ ! grep "${GPGSSH_GOOD_SIGNATURE_TRUSTED}" actual
198
+ '
199
+
142
200
test_expect_success ' message for merging external branch' '
143
201
echo "Merge branch ${apos}left${apos} of $(pwd)" >expected &&
144
202
0 commit comments