]> git.sthu.org Git - pgp-tools.git/commitdiff
Handle multiple sigs with different classes properly
authorweasel <weasel@b513b33f-fedd-0310-b452-c3deb5f4c849>
Wed, 6 Jul 2005 11:47:00 +0000 (11:47 +0000)
committerweasel <weasel@b513b33f-fedd-0310-b452-c3deb5f4c849>
Wed, 6 Jul 2005 11:47:00 +0000 (11:47 +0000)
git-svn-id: svn://svn.debian.org/pgp-tools/trunk@117 b513b33f-fedd-0310-b452-c3deb5f4c849

gpgsigs/gpgsigs

index 7da3c1f1606f156c43a92241cd8bd9f79f8e05ef..c49ef00bfda9b4548eb14356e7fbffb77f823347 100755 (executable)
@@ -196,8 +196,19 @@ while (<SIGS>) {
                } else {
                        $class = 's';
                };
-               $sigs->{$key}->{$uid}->{$1.$2} = $class;
-               $sigs->{$key}->{$uid}->{$2} = $class;
+               # Handle the case where one UID was signed multiple times
+               # with different signature classes.
+               my $before = $sigs->{$key}->{$uid}->{$1.$2};
+               if (defined $before) {
+                       if ($before eq 'S' || $before eq 's') {
+                               $sigs->{$key}->{$uid}->{$1.$2} = $class;
+                       } elsif ($before < $class) {
+                               $sigs->{$key}->{$uid}->{$1.$2} = $class;
+                       };
+               } else {
+                       $sigs->{$key}->{$uid}->{$1.$2} .= $class;
+               };
+               $sigs->{$key}->{$uid}->{$2} = $sigs->{$key}->{$uid}->{$1.$2}
                next;
        }
        if ( m/^uat:/ ) {