summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@torproject.org>2019-05-16 12:38:08 +0200
committerNicolas Vigier <boklm@torproject.org>2019-05-16 12:38:08 +0200
commit6e60b0bd52a8e85c6f85eb531737258be914fc2d (patch)
tree3bd8ab88ef2ace9f17c2b5fc0c48379380b5ec13
parent87adfb7b7be7e7e0f437020dbf8a119673133412 (diff)
Bug 30480: Check that a signed tag object contains the expected tag namebug_30480
-rw-r--r--lib/RBM.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/RBM.pm b/lib/RBM.pm
index 4416a0c..b89fee8 100644
--- a/lib/RBM.pm
+++ b/lib/RBM.pm
@@ -308,6 +308,14 @@ sub git_commit_sign_id {
return gpg_get_fingerprint(@l);
}
+sub git_get_signed_tagname {
+ foreach my $l (split(/\n/, $_[0])) {
+ return '' unless $l;
+ return $1 if $l =~ m/^tag (.*)$/;
+ }
+ return '';
+}
+
sub git_tag_sign_id {
my ($project, $tag) = @_;
my $w = set_git_gpg_wrapper($project);
@@ -315,6 +323,7 @@ sub git_tag_sign_id {
= capture_exec('git', 'tag', '-v', $tag);
unset_git_gpg_wrapper($w);
return undef unless $success;
+ return undef unless git_get_signed_tagname($stdout) eq $tag;
return gpg_get_fingerprint(split /\n/, $stderr);
}