[libnet-openid-common-perl] 19/34: default crypt::dh
gregor herrmann
gregoa at debian.org
Sun Feb 7 21:50:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to annotated tag v1.030099_001
in repository libnet-openid-common-perl.
commit 970adfd229f3281e79f04ebdb14539edb56cb1e0
Author: Robert Norris <rob at eatenbyagrue.org>
Date: Thu Nov 4 20:29:13 2010 +1100
default crypt::dh
---
dist.ini | 1 +
lib/Net/OpenID/Common.pm | 16 ++++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/dist.ini b/dist.ini
index da61ea6..468c2fa 100644
--- a/dist.ini
+++ b/dist.ini
@@ -19,6 +19,7 @@ Time::Local = 0
Digest::SHA1 = 0
MIME::Base64 = 0
Math::BigInt = 0
+Crypt::DH::GMP = 0
[Prereqs / TestRequires]
Test::More = 0
diff --git a/lib/Net/OpenID/Common.pm b/lib/Net/OpenID/Common.pm
index 9a57e46..c464c59 100644
--- a/lib/Net/OpenID/Common.pm
+++ b/lib/Net/OpenID/Common.pm
@@ -26,6 +26,8 @@ Maintained by Martin Atkins <mart at degeneration.co.uk>
# like this to avoid confusion.
package OpenID::util;
+use Crypt::DH::GMP;
+
use constant VERSION_1_NAMESPACE => "http://openid.net/signon/1.1";
use constant VERSION_2_NAMESPACE => "http://specs.openid.net/auth/2.0";
@@ -219,4 +221,18 @@ sub timing_indep_eq {
return !$result;
}
+sub get_dh {
+ my ($p, $g) = @_;
+
+ $p ||= "155172898181473697471232257763715539915724801966915404479707795314057629378541917580651227423698188993727816152646631438561595825688188889951272158842675419950341258706556549803580104870537681476726513255747040765857479291291572334510643245094715007229621094194349783925984760375594985848253359305585439638443";
+ $g ||= "2";
+
+ return if $p <= 10 or $g <= 1;
+
+ my $dh = Crypt::DH::GMP->new(p => $p, g => $g);
+ $dh->generate_keys;
+
+ return $dh;
+}
+
1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-openid-common-perl.git
More information about the Pkg-perl-cvs-commits
mailing list