From 3175d1a064086673de558bd83968929a3d20604d Mon Sep 17 00:00:00 2001 From: weasel Date: Wed, 6 Jul 2005 11:47:00 +0000 Subject: [PATCH] Handle multiple sigs with different classes properly git-svn-id: svn://svn.debian.org/pgp-tools/trunk@117 b513b33f-fedd-0310-b452-c3deb5f4c849 --- gpgsigs/gpgsigs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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:/ ) { -- 2.39.5