?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
package Net::DNS::RR::TSIG;
#
# $Id: TSIG.pm 388 2005-06-22 10:06:05Z olaf $
#
use strict;
BEGIN {
eval { require bytes; }
}
use vars qw(@ISA $VERSION);
use Digest::HMAC_MD5;
use MIME::Base64;
use constant DEFAULT_ALGORITHM => "HMAC-MD5.SIG-ALG.REG.INT";
use constant DEFAULT_FUDGE => 300;
@ISA = qw(Net::DNS::RR);
$VERSION = (qw$LastChangedRevision: 388 $)[1];
# a signing function for the HMAC-MD5 algorithm. This can be overridden using
# the sign_func element
sub sign_hmac {
my ($key, $data) = @_;
$key =~ s/ //g;
$key = decode_base64($key);
my $hmac = Digest::HMAC_MD5->new($key);
$hmac->add($data);
return $hmac->digest;
}
sub new {
my ($class, $self, $data, $offset) = @_;
if ($self->{"rdlength"} > 0) {
($self->{"algorithm"}, $offset) = Net::DNS::Packet::dn_expand($data, $offset);
my ($time_high, $time_low) = unpack("\@$offset nN", $$data);
$self->{"time_signed"} = $time_low; # bug
$offset += Net::DNS::INT16SZ() + Net::DNS::INT32SZ();
@{$self}{qw(fudge mac_size)} = unpack("\@$offset nn", $$data);
$offset += Net::DNS::INT16SZ() + Net::DNS::INT16SZ();
$self->{"mac"} = substr($$data, $offset, $self->{'mac_size'});
$offset += $self->{'mac_size'};
@{$self}{qw(original_id error other_len)} = unpack("\@$offset nnn", $$data);
$offset += Net::DNS::INT16SZ() * 3;
my $odata = substr($$data, $offset, $self->{'other_len'});
my ($odata_high, $odata_low) = unpack("nN", $odata);
$self->{"other_data"} = $odata_low;
}
return bless $self, $class;
}
sub new_from_string {
my ($class, $self, $string) = @_;
if ($string && ($string =~ /^(.*)$/)) {
$self->{"key"} = $1;
}
$self->{"algorithm"} = DEFAULT_ALGORITHM;
$self->{"time_signed"} = time;
$self->{"fudge"} = DEFAULT_FUDGE;
$self->{"mac_size"} = 0;
$self->{"mac"} = "";
$self->{"original_id"} = 0;
$self->{"error"} = 0;
$self->{"other_len"} = 0;
$self->{"other_data"} = "";
$self->{"sign_func"} = \&sign_hmac;
# RFC 2845 Section 2.3
$self->{"class"} = "ANY";
return bless $self, $class;
}
sub error {
my $self = shift;
my $rcode;
my $error = $self->{"error"};
if (defined($error)) {
$rcode = $Net::DNS::rcodesbyval{$error} || $error;
}
return $rcode;
}
sub mac_size {
my $self = shift;
return length(defined($self->{"mac"}) ? $self->{"mac"} : "");
}
sub mac {
my $self = shift;
my $mac = unpack("H*", $self->{"mac"}) if defined($self->{"mac"});
return $mac;
}
sub rdatastr {
my $self = shift;
my $error = $self->error;
$error = "UNDEFINED" unless defined $error;
my $rdatastr;
if (exists $self->{"algorithm"}) {
$rdatastr = "$self->{algorithm}. $error";
if ($self->{"other_len"} && defined($self->{"other_data"})) {
$rdatastr .= " $self->{other_data}";
}
} else {
$rdatastr = "";
}
return $rdatastr;
}
# return the data that needs to be signed/verified. This is useful for
# external TSIG verification routines
sub sig_data {
my ($self, $packet) = @_;
my ($newpacket, $sigdata);
# XXX this is horrible. $pkt = Net::DNS::Packet->clone($packet); maybe?
bless($newpacket = {},"Net::DNS::Packet");
%{$newpacket} = %{$packet};
bless($newpacket->{"header"} = {},"Net::DNS::Header");
$newpacket->{"additional"} = [];
%{$newpacket->{"header"}} = %{$packet->{"header"}};
@{$newpacket->{"additional"}} = @{$packet->{"additional"}};
shift(@{$newpacket->{"additional"}});
$newpacket->{"header"}{"arcount"}--;
$newpacket->{"compnames"} = {};
# Add the request MAC if present (used to validate responses).
$sigdata .= pack("H*", $self->{"request_mac"})
if $self->{"request_mac"};
$sigdata .= $newpacket->data;
# Don't compress the record (key) name.
my $tmppacket = Net::DNS::Packet->new("");
$sigdata .= $tmppacket->dn_comp(lc($self->{"name"}), 0);
$sigdata .= pack("n", $Net::DNS::classesbyname{uc($self->{"class"})});
$sigdata .= pack("N", $self->{"ttl"});
# Don't compress the algorithm name.
$tmppacket->{"compnames"} = {};
$sigdata .= $tmppacket->dn_comp(lc($self->{"algorithm"}), 0);
$sigdata .= pack("nN", 0, $self->{"time_signed"}); # bug
$sigdata .= pack("n", $self->{"fudge"});
$sigdata .= pack("nn", $self->{"error"}, $self->{"other_len"});
$sigdata .= pack("nN", 0, $self->{"other_data"})
if $self->{"other_data"};
return $sigdata;
}
sub rr_rdata {
my ($self, $packet, $offset) = @_;
my $rdata = "";
if (exists $self->{"key"}) {
# form the data to be signed
my $sigdata = $self->sig_data($packet);
# and call the signing function
$self->{"mac"} = &{$self->{"sign_func"}}($self->{"key"}, $sigdata);
$self->{"mac_size"} = length($self->{"mac"});
# construct the signed TSIG record
$packet->{"compnames"} = {};
$rdata .= $packet->dn_comp($self->{"algorithm"}, 0);
$rdata .= pack("nN", 0, $self->{"time_signed"}); # bug
$rdata .= pack("nn", $self->{"fudge"}, $self->{"mac_size"});
$rdata .= $self->{"mac"};
$rdata .= pack("nnn",($packet->{"header"}->{"id"},
$self->{"error"},
$self->{"other_len"}));
$rdata .= pack("nN", 0, $self->{"other_data"})
if $self->{"other_data"};
}
return $rdata;
}
1;
__END__
=head1 NAME
Net::DNS::RR::TSIG - DNS TSIG resource record
=head1 SYNOPSIS
C