summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
committerNorbert Preining <norbert@preining.info>2024-03-15 03:06:35 +0000
commit12679ab7d3c2a210f4123163671b532b8b55d5f9 (patch)
tree0060d13467186ad977f4e73488ee20dd6c0017ab /systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm
parent62170822e034fdd3f81de7274835d0d3b0467100 (diff)
CTAN sync 202403150306
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm80
1 files changed, 0 insertions, 80 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm b/systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm
deleted file mode 100644
index bb1d9ae3c8..0000000000
--- a/systems/texlive/tlnet/tlpkg/tlperl/site/lib/LWP/Authen/Digest.pm
+++ /dev/null
@@ -1,80 +0,0 @@
-package LWP::Authen::Digest;
-
-use strict;
-use parent 'LWP::Authen::Basic';
-
-our $VERSION = '6.61';
-
-require Digest::MD5;
-
-sub _reauth_requested {
- my ($class, $auth_param, $ua, $request, $auth_header) = @_;
- my $ret = defined($$auth_param{stale}) && lc($$auth_param{stale}) eq 'true';
- if ($ret) {
- my $hdr = $request->header($auth_header);
- $hdr =~ tr/,/;/; # "," is used to separate auth-params!!
- ($hdr) = HTTP::Headers::Util::split_header_words($hdr);
- my $nonce = {@$hdr}->{nonce};
- delete $$ua{authen_md5_nonce_count}{$nonce};
- }
- return $ret;
-}
-
-sub auth_header {
- my($class, $user, $pass, $request, $ua, $h) = @_;
-
- my $auth_param = $h->{auth_param};
-
- my $nc = sprintf "%08X", ++$ua->{authen_md5_nonce_count}{$auth_param->{nonce}};
- my $cnonce = sprintf "%8x", time;
-
- my $uri = $request->uri->path_query;
- $uri = "/" unless length $uri;
-
- my $md5 = Digest::MD5->new;
-
- my(@digest);
- $md5->add(join(":", $user, $auth_param->{realm}, $pass));
- push(@digest, $md5->hexdigest);
- $md5->reset;
-
- push(@digest, $auth_param->{nonce});
-
- if ($auth_param->{qop}) {
- push(@digest, $nc, $cnonce, ($auth_param->{qop} =~ m|^auth[,;]auth-int$|) ? 'auth' : $auth_param->{qop});
- }
-
- $md5->add(join(":", $request->method, $uri));
- push(@digest, $md5->hexdigest);
- $md5->reset;
-
- $md5->add(join(":", @digest));
- my($digest) = $md5->hexdigest;
- $md5->reset;
-
- my %resp = map { $_ => $auth_param->{$_} } qw(realm nonce opaque);
- @resp{qw(username uri response algorithm)} = ($user, $uri, $digest, "MD5");
-
- if (($auth_param->{qop} || "") =~ m|^auth([,;]auth-int)?$|) {
- @resp{qw(qop cnonce nc)} = ("auth", $cnonce, $nc);
- }
-
- my(@order) = qw(username realm qop algorithm uri nonce nc cnonce response opaque);
- my @pairs;
- for (@order) {
- next unless defined $resp{$_};
-
- # RFC2617 says that qop-value and nc-value should be unquoted.
- if ( $_ eq 'qop' || $_ eq 'nc' ) {
- push(@pairs, "$_=" . $resp{$_});
- }
- else {
- push(@pairs, "$_=" . qq("$resp{$_}"));
- }
- }
-
- my $auth_value = "Digest " . join(", ", @pairs);
- return $auth_value;
-}
-
-1;