chiark / gitweb /
import-dsc: Check the signature
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 Oct 2016 20:11:37 +0000 (21:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 19:50:47 +0000 (19:50 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index ef81599..c6d1be7 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -5304,6 +5304,19 @@ sub cmd_import_dsc {
     $dscdata = do { local $/ = undef; <D>; };
     D->error and fail "read $dscfn: $!";
     close C;
+
+    # we don't normally need this so import it here
+    use Dpkg::Source::Package;
+    my $dp = new Dpkg::Source::Package filename => $dscfn;
+    {
+       local $SIG{__WARN__} = undef;
+       if (!$dp->is_signed()) {
+           warn "$us: warning: importing unsigned .dsc\n";
+       } else {
+           my $r = $dp->check_signature();
+       }
+    }
+
     parse_dscdata();
 
     my $dgit_commit = $dsc->{$ourdscfield[0]};