[Pkg-privacy-commits] [msva-perl] 174/356: hand pkc data over to Client.pm as a variable, instead of letting Client.pm read it from stdin directly

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository msva-perl.

commit 76cacb1adf0c7572ceae85600a217f9f294d042a
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Mon Oct 18 00:18:16 2010 -0400

    hand pkc data over to Client.pm as a variable, instead of letting Client.pm read it from stdin directly
---
 Crypt/Monkeysphere/MSVA/Client.pm | 39 ++++++++++++++-------------------------
 msva-query-agent                  |  9 ++++++++-
 2 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/Crypt/Monkeysphere/MSVA/Client.pm b/Crypt/Monkeysphere/MSVA/Client.pm
index dc4532f..2939ca0 100644
--- a/Crypt/Monkeysphere/MSVA/Client.pm
+++ b/Crypt/Monkeysphere/MSVA/Client.pm
@@ -45,15 +45,16 @@
     my $context = shift;
     my $peer = shift;
     my $pkctype = shift;
+    my $pkcdata = shift;
 
-    my $apd = create_apd($context, $peer, $pkctype);
+    my $apd = create_apd($context, $peer, $pkctype, $pkcdata);
 
     my $apdjson = to_json($apd);
 
     # get msva socket from environment
     my $msvasocket = $ENV{MONKEYSPHERE_VALIDATION_AGENT_SOCKET};
 
-    # creat the user agent
+    # create the user agent
     my $ua = LWP::UserAgent->new;
 
     my $headers = HTTP::Headers->new(
@@ -84,15 +85,7 @@
     my $context = shift;
     my $peer = shift;
     my $pkctype = shift;
-
-    my $pkcdata;
-    my $pkcdataraw;
-
-    # load raw pkc data from stdin
-    $pkcdataraw = do {
-      local $/; # slurp!
-      <STDIN>;
-    };
+    my $pkcdata = shift;
 
     msvalog('debug', "context: %s\n", $context);
     msvalog('debug', "peer: %s\n", $peer);
@@ -100,7 +93,7 @@
 
 
     if ($pkctype eq 'x509der') {
-      my $cert = Crypt::X509->new(cert => $pkcdataraw);
+      my $cert = Crypt::X509->new(cert => $pkcdata);
       if ($cert->error) {
 	die;
       };
@@ -114,19 +107,15 @@
 	die;
     };
 
-    # remap raw pkc data into numeric array
-    my @remap = map(ord, split(//,$pkcdataraw));
-
-    my %apd = (
-	context => $context,
-	peer => $peer,
-	pkc => {
-	    type => $pkctype,
-	    data => \@remap,
-	},
-	);
-
-    return \%apd;
+    return {
+            context => $context,
+            peer => $peer,
+            pkc => {
+                    type => $pkctype,
+                    # remap raw pkc data into numeric array
+                    data => [map(ord, split(//,$pkcdata))],
+                   },
+           };
   }
 
   1;
diff --git a/msva-query-agent b/msva-query-agent
index ea1f7f2..8dfd192 100755
--- a/msva-query-agent
+++ b/msva-query-agent
@@ -25,7 +25,14 @@ use Crypt::Monkeysphere::MSVA::Client;
 my $context = shift;
 my $peer = shift;
 my $pkctype = shift || 'x509der';
-my ($status,$ret) = Crypt::Monkeysphere::MSVA::Client->query_agent($context,$peer,$pkctype);
+
+# load raw pkc data from stdin
+my $pkcdata = do {
+  local $/; # slurp!
+  <STDIN>;
+};
+
+my ($status,$ret) = Crypt::Monkeysphere::MSVA::Client->query_agent($context,$peer,$pkctype, $pkcdata);
 
 msvalog('info', "status: %s\n", $status);
 msvalog('info', "valid: %s\n", $ret->{valid});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git



More information about the Pkg-privacy-commits mailing list