$VERSION = '0.7';
- my $gnupg = GnuPG::Interface->new();
+ my $gnupg = GnuPG::Interface::->new();
$gnupg->options->quiet(1);
$gnupg->options->batch(1);
my $default_keyserver = 'hkp://pool.sks-keyservers.net';
my $default_keyserver_policy = 'unlessvalid';
- my $logger = Crypt::Monkeysphere::MSVA::Logger->new($ENV{MSVA_LOG_LEVEL});
+ my $logger = Crypt::Monkeysphere::MSVA::Logger::->new($ENV{MSVA_LOG_LEVEL});
sub logger {
return $logger;
}
- my $rsa_decoder = Convert::ASN1->new;
+ my $rsa_decoder = Convert::ASN1::->new();
$rsa_decoder->prepare(q<
SEQUENCE {
sub get_client_info {
my $socket = shift;
- my $sock = IO::Socket->new_from_fd($socket, 'r');
+ my $sock = IO::Socket::->new_from_fd($socket, 'r');
# check SO_PEERCRED -- if this was a TCP socket, Linux
# might not be able to support SO_PEERCRED (even on the loopback),
# though apparently some kernels (Solaris?) are able to.
msvalog('verbose', "Port: %04x\nAddr: %s\n", $port, $iaddrstring);
my $remmatch = lc(sprintf("%s:%04x", $iaddrstring, $port));
my $infofile = '/proc/net/'.$proto;
- my $f = new IO::File;
+ my $f = IO::File::->new();
if ( $f->open('< '.$infofile)) {
my @header = split(/ +/, <$f>);
my ($localaddrix, $uidix, $inodeix);
sub der2key {
my $rawdata = shift;
- my $cert = Crypt::X509->new(cert => $rawdata);
+ my $cert = Crypt::X509::->new(cert => $rawdata);
my $key = {error => 'I do not know what happened here'};
sub fetch_uid_from_keyserver {
my $uid = shift;
- my $cmd = IO::Handle->new();
- my $out = IO::Handle->new();
- my $nul = IO::File->new("< /dev/null");
+ my $cmd = IO::Handle::->new();
+ my $out = IO::Handle::->new();
+ my $nul = IO::File::->new("< /dev/null");
my $ks = get_keyserver();
msvalog('debug', "start ks query to %s for UserID: %s\n", $ks, $uid);
my $pid = $gnupg->wrap_call
- ( handles => GnuPG::Handles->new( command => $cmd, stdout => $out, stderr => $nul ),
+ ( handles => GnuPG::Handles::->new( command => $cmd, stdout => $out, stderr => $nul ),
command_args => [ '='.$uid ],
commands => [ '--keyserver',
$ks,
}
# make sure that the returned integers are Math::BigInts:
- $key->{exponent} = Math::BigInt->new($key->{exponent}) unless (ref($key->{exponent}));
- $key->{modulus} = Math::BigInt->new($key->{modulus}) unless (ref($key->{modulus}));
+ $key->{exponent} = Math::BigInt::->new($key->{exponent}) unless (ref($key->{exponent}));
+ $key->{modulus} = Math::BigInt::->new($key->{modulus}) unless (ref($key->{modulus}));
msvalog('debug', "pubkey info:\nmodulus: %s\nexponent: %s\n",
$key->{modulus}->as_hex(),
$key->{exponent}->as_hex(),
$server->server_close();
}
$self->port($port);
- $self->{updatemonitor} = Crypt::Monkeysphere::MSVA::Monitor->new($logger);
+ $self->{updatemonitor} = Crypt::Monkeysphere::MSVA::Monitor::->new($logger);
}
sub spawn_master_subproc {
my $cmd = '<unknown>';
# FIXME: not very portable
my $procfh;
- $procfh = new IO::File(sprintf('/proc/%d/cmdline', $clientpid));
+ $procfh = IO::File::->new(sprintf('/proc/%d/cmdline', $clientpid));
if (defined $procfh) {
$cmd = <$procfh>;
$procfh->close;
Gtk2->init();
# create a new dialog with some buttons - one stock, one not.
my $dialog = Gtk2::Dialog->new(sprintf('Monkeysphere validation agent [%s]', $peer),
- undef,
- [],
- 'gtk-no' => 'cancel',
- 'gtk-yes' => 'ok');
+ undef,
+ [],
+ 'gtk-no' => 'cancel',
+ 'gtk-yes' => 'ok');
require Linux::Inotify2;
- $self->{inotify} = new Linux::Inotify2
+ $self->{inotify} = Linux::Inotify2::->new()
or die "unable to create new inotify object: $!";
my $flags = 0xc06;
ca_file => undef,
);
- my $ua = LWP::UserAgent->new();
+ my $ua = LWP::UserAgent::->new();
printf("VERSION 1\nPROGRAM %s gpgkeys_hkpms msva-perl/%s\n",
$self->{config}->{program}, # this is kind of cheating :/
$self->{logger}->log('debug', "command: %s\n", $self->{config}->{command});
if (lc($self->{config}->{command}) eq 'search') {
# for COMMAND = SEARCH, we want op=index, and we want to rejoin all args with spaces.
- my $uri = new URI(sprintf('https://%s/pks/lookup', $self->{config}->{host}));
+ my $uri = URI::->new(sprintf('https://%s/pks/lookup', $self->{config}->{host}));
my $arg = join(' ', @{$self->{args}});
$uri->query_form(op => 'index',
options => 'mr',
);
$arg =~ s/\n/ /g ; # swap out newlines for spaces
printf("\n%s %s BEGIN\n", $self->{config}->{command}, $arg);
+ $self->{logger}->log('debug', "URI: %s\n", $uri);
my $resp = $ua->get($uri);
if ($resp->is_success) {
print($resp->decoded_content);
printf("\n%s %s END\n", $self->{config}->{command}, $arg);
} elsif (lc($self->{config}->{command}) eq 'get') {
# for COMMAND = GET, we want op=get, and we want to issue each query separately.
- my $uri = new URI(sprintf('https://%s/pks/lookup', $self->{config}->{host}));
+ my $uri = URI::->new(sprintf('https://%s/pks/lookup', $self->{config}->{host}));
foreach my $arg (@{$self->{args}}) {
printf("\n%s %s BEGIN\n", $self->{config}->{command}, $arg);
$uri->query_form(op => 'get',
if ($arg eq sprintf('KEY %s END', $keyid)) {
$self->{logger}->log('debug', "Found KEY END line with %d lines of data elapsed\n", scalar(@keydata));
# for sending keys, we want to POST to /pks/add, with a keytext variable.
- my $uri = new URI(sprintf('https://%s/pks/add', $self->{config}->{host}));
+ my $uri = URI::->new(sprintf('https://%s/pks/add', $self->{config}->{host}));
my $resp = $ua->post($uri, {keytext => join("\n", @keydata)});
if ($resp->is_success) {
printf("\n%s", $resp->decoded_content);
my $default_log_level = 'error';
my $client;
if (exists($ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET})) {
- $client = Crypt::Monkeysphere::MSVA::Client->new(
- socket => $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET},
- log_level => $default_log_level,
- );
+ $client = Crypt::Monkeysphere::MSVA::Client::->new(
+ socket => $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET},
+ log_level => $default_log_level,
+ );
}
my $self = { config => { },
args => [ ],
- logger => (defined($client) ? $client->{logger} : Crypt::Monkeysphere::MSVA::Logger->new($default_log_level)),
+ logger => (defined($client) ? $client->{logger} : Crypt::Monkeysphere::MSVA::Logger::->new($default_log_level)),
cache => { },
client => $client,
actually_check => 1,
}
-my $hkpms = Crypt::Monkeysphere::MSVA::HKPMS->new();
+my $hkpms = Crypt::Monkeysphere::MSVA::HKPMS::->new();
my $input = # load gpg instructions from stdin:
do {