return \@ops;
}
-# temporary scaffolding; last piece of read_directive_file that does not
-# really fit elsewhere and will be removed when the new key index is
-# implemented to directly map long key IDs to email addresses
-sub verify_clearsigned_message; # declaration; permitted but not required
-sub guess_email_address_from_signature {
- my $directive_file_contents = shift;
-
- my @addresses;
-
- # If we don't know whose project this file belongs to, because the
- # 'directory:' line is messed up or not there, we'd still like to let the
- # uploader know something went wrong. So let's see if we can match the
- # directive file signature against one of our public keyrings.
- {
- my @tmp_keyrings;
- open(TMP,"/usr/bin/find $package_config_base -name pubring.gpg|");
- while(<TMP>) {
- chomp;
- m,^(/?${RE_filename_relative})$, or next;
- push @tmp_keyrings, $1;
- }
- close(TMP);
-
- my $tmp_result = verify_clearsigned_message
- ($directive_file_contents, @tmp_keyrings);
-
- unless ($tmp_result->{exitcode} != 0 || defined $tmp_result->{TILT}) {
- if (($tmp_result->{raw_log} =~ /Good signature from .*?<(.*?)>/))
- { push @addresses, $1 }
- }
- }
-
- return @addresses;
-}
-
=item validate_directive ( $packet, $oplist )
Validate the commands in OPLIST as applicable to PACKET. PACKET is an
my $directive_file = $packet->[0];
my $upload_file = ''; my $sig_file = '';
- # temporary scaffolding until the "any known key" issue is resolved
- my $have_any_directive_signature = 0;
-
unless ($directive_only) {
foreach (@{$packet}[1..$#$packet]) {
if (m/[.]sig$/) { $sig_file =$_ } else { $upload_file = $_ }
$directive = read_directive_from_string($directive_text);
- # TODO: also store the keyring containing a key in the key index and
- # check for a valid but inappropriate signature during RP phase
- push @email_addresses,
- guess_email_address_from_signature($directive_text);
- $have_any_directive_signature = scalar @email_addresses;
-
$oplist = interpret_directive($directive);
$op_header = $oplist->[0][1];
my $E = $@; # preserve the exception, since many functions use eval
+ my $have_any_directive_signature = 0;
{ my @fprs; # scratchpad for key fingerprints of valid signatures
last unless $directive_text; # skip if no signature at all