From: weasel Date: Wed, 6 Jul 2005 11:47:00 +0000 (+0000) Subject: Handle multiple sigs with different classes properly X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=3175d1a064086673de558bd83968929a3d20604d;p=pgp-tools.git Handle multiple sigs with different classes properly git-svn-id: svn://svn.debian.org/pgp-tools/trunk@117 b513b33f-fedd-0310-b452-c3deb5f4c849 --- diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs index 7da3c1f..c49ef00 100755 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -196,8 +196,19 @@ while () { } 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:/ ) {