~ubuntu-branches/ubuntu/natty/otrs2/natty-updates

« back to all changes in this revision

Viewing changes to Kernel/System/Crypt/PGP.pm

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2007-04-14 17:58:55 UTC
  • mto: (20.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: package-import@ubuntu.com-20070414175855-9ne0w01yu1q44ch0
Tags: upstream-2.1.7
ImportĀ upstreamĀ versionĀ 2.1.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# --
2
2
# Kernel/System/Crypt/PGP.pm - the main crypt module
3
 
# Copyright (C) 2001-2005 Martin Edenhofer <martin+code@otrs.org>
 
3
# Copyright (C) 2001-2007 OTRS GmbH, http://otrs.org/
4
4
# --
5
 
# $Id: PGP.pm,v 1.10 2005/10/17 20:41:55 martin Exp $
 
5
# $Id: PGP.pm,v 1.12.2.1 2007/01/30 11:19:41 martin Exp $
6
6
# --
7
7
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
8
8
# the enclosed file COPYING for license information (GPL). If you
14
14
use strict;
15
15
 
16
16
use vars qw($VERSION);
17
 
$VERSION = '$Revision: 1.10 $';
 
17
$VERSION = '$Revision: 1.12.2.1 $';
18
18
$VERSION =~ s/^.*:\s(\d+\.\d+)\s.*$/$1/;
19
19
 
20
20
=head1 NAME
36
36
    my $Self = shift;
37
37
    my %Param = @_;
38
38
 
39
 
 
40
39
    $Self->{GPGBin} = $Self->{ConfigObject}->Get('PGP::Bin') || '/usr/bin/gpg';
41
40
    $Self->{Options} = $Self->{ConfigObject}->Get('PGP::Options') || '--batch --no-tty --yes';
42
41
 
352
351
            $Key{Key} .= $3;
353
352
            $Key{Created} .= $4;
354
353
            $Key{Identifier} .= $5;
 
354
            $Key{IdentifierMaster} .= $5;
355
355
        }
356
356
        if ($InKey && $Line =~ /^uid\s+(.*)/) {
357
 
            $Key{Identifier} .= $1;
 
357
            $Key{Identifier} .= ', '.$1;
358
358
        }
359
359
        if ($InKey && $Line =~ /^(ssb)\s(.+?)\/(.+?)\s(.+?)\s/) {
360
360
            $Key{Bit} = $2;
407
407
            $Key{Key} .= $3;
408
408
            $Key{Created} .= $4;
409
409
            $Key{Identifier} .= $5;
 
410
            $Key{IdentifierMaster} .= $5;
410
411
        }
411
412
        if ($InKey && $Line =~ /^uid\s+(.*)/) {
412
 
            $Key{Identifier} .= $1;
 
413
            $Key{Identifier} .= ', '.$1;
413
414
        }
414
415
        if ($InKey && $Line =~ /\[expires:\s(.+?)\]/) {
415
416
            $Key{Expires} = $1;
566
567
        $Message .= $_;
567
568
    }
568
569
    close (OUT);
569
 
    if ($Message =~ /encrypted with.+?\sID\s(.+?),\s/i) {
570
 
        my @Result = $Self->KeySearch(Search => $1);
571
 
        if (@Result) {
572
 
            return ($1, $Result[$#Result]->{Key});
 
570
    my @Lines = split(/\n/, $Message);
 
571
    foreach my $Line (@Lines) {
 
572
        if ($Line =~ /encrypted with.+?\sID\s(........)/i) {
 
573
            my @Result = $Self->PrivateKeySearch(Search => $1);
 
574
            if (@Result) {
 
575
                return ($1, $Result[$#Result]->{Key});
 
576
            }
573
577
        }
574
578
    }
575
579
    return;
589
593
 
590
594
=head1 VERSION
591
595
 
592
 
$Revision: 1.10 $ $Date: 2005/10/17 20:41:55 $
 
596
$Revision: 1.12.2.1 $ $Date: 2007/01/30 11:19:41 $
593
597
 
594
598
=cut