亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tsig.pm

?? 雷傲極酷超級論壇LeoBBS X 040601 簡體正式版
?? PM
字號:
package Net::DNS::RR::TSIG;

# $Id: TSIG.pm,v 1.2 2002/10/14 21:11:46 ctriv Exp $

use strict;
use vars qw(@ISA);

use Net::DNS::Packet;
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);

# 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) {
		my $alg;
		($alg, $offset) = Net::DNS::Packet::dn_expand($data, $offset);
		$self->{"algorithm"} = $alg;

		my ($time_high, $time_low) = unpack("\@$offset nN", $$data);
		$self->{"time_signed"} = $time_low;	# bug
		$offset += &Net::DNS::INT16SZ + &Net::DNS::INT32SZ;

		my ($fudge, $macsize) = unpack("\@$offset nn", $$data);
		$self->{"fudge"} = $fudge;
		$self->{"mac_size"} = $macsize;
		$offset += &Net::DNS::INT16SZ + &Net::DNS::INT16SZ;

		my $mac = substr($$data, $offset, $macsize);
		$self->{"mac"} = $mac;
		$offset += $macsize;

		my ($oid, $error, $olen) = unpack("\@$offset nnn", $$data);
		$self->{"original_id"} = $oid;
		$self->{"error"} = $error;
		$self->{"other_len"} = $olen;
		$offset += &Net::DNS::INT16SZ + &Net::DNS::INT16SZ
                        +  &Net::DNS::INT16SZ;

		my $odata = substr($$data, $offset, $olen);
		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 = "; no data";
	}

	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<use Net::DNS::RR>;

=head1 DESCRIPTION

Class for DNS Transaction Signature (TSIG) resource records.

=head1 METHODS

=head2 algorithm

    $rr->algorithm($algorithm_name);
    print "algorithm = ", $rr->algorithm, "\n";

Gets or sets the domain name that specifies the name of the algorithm.
The only algorithm currently supported is HMAC-MD5.SIG-ALG.REG.INT.

=head2 time_signed

    $rr->time_signed(time);
    print "time signed = ", $rr->time_signed, "\n";

Gets or sets the signing time as the number of seconds since 1 Jan 1970
00:00:00 UTC.

The default signing time is the current time.

=head2 fudge

    $rr->fudge(60);
    print "fudge = ", $rr->fudge, "\n";

Gets or sets the "fudge", i.e., the seconds of error permitted in the
signing time.

The default fudge is 300 seconds.

=head2 mac_size

    print "MAC size = ", $rr->mac_size, "\n";

Returns the number of octets in the message authentication code (MAC).
The programmer must call a Net::DNS::Packet object's data method
before this will return anything meaningful.

=head2 mac

    print "MAC = ", $rr->mac, "\n";

Returns the message authentication code (MAC) as a string of hex
characters.  The programmer must call a Net::DNS::Packet object's
data method before this will return anything meaningful.

=head2 original_id

    $rr->original_id(12345);
    print "original ID = ", $rr->original_id, "\n";

Gets or sets the original message ID.

=head2 error

    print "error = ", $rr->error, "\n";

Returns the RCODE covering TSIG processing.  Common values are
NOERROR, BADSIG, BADKEY, and BADTIME.  See RFC 2845 for details.

=head2 other_len

    print "other len = ", $rr->other_len, "\n";

Returns the length of the Other Data.  Should be zero unless the
error is BADTIME.

=head2 other_data

    print "other data = ", $rr->other_data, "\n";

Returns the Other Data.  This field should be empty unless the
error is BADTIME, in which case it will contain the server's
time as the number of seconds since 1 Jan 1970 00:00:00 UTC.

=head2 sig_data

     my $sigdata = $tsig->sig_data($packet);

Returns the packet packed according to RFC2845 in a form for signing. This
is only needed if you want to supply an external signing function, such as is 
needed for TSIG-GSS. 

=head2 sign_func

     sub my_sign_fn($$) {
	     my ($key, $data) = @_;
	     
	     return some_digest_algorithm($key, $data);
     }

     $tsig->sign_func(\&my_sign_fn);

This sets the signing function to be used for this TSIG record. 

The default signing function is HMAC-MD5.

=head1 BUGS

This code is still under development.  Use with caution on production
systems.

The time_signed and other_data fields should be 48-bit unsigned
integers (RFC 2845, Sections 2.3 and 4.5.2).  The current implementation
ignores the upper 16 bits; this will cause problems for times later
than 19 Jan 2038 03:14:07 UTC.

The only builtin algorithm currently supported is
HMAC-MD5.SIG-ALG.REG.INT. You can use other algorithms by supplying an
appropriate sign_func.

=head1 COPYRIGHT

Copyright (c) 2000 Michael Fuhr.  All rights reserved.  This program
is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.

=head1 ACKNOWLEDGMENT

Most of the code in the Net::DNS::RR::TSIG module was contributed
by Chris Turbeville. 

Support for external signing functions was added by Andrew Tridgell.

=head1 SEE ALSO

L<perl(1)>, L<Net::DNS>, L<Net::DNS::Resolver>, L<Net::DNS::Packet>,
L<Net::DNS::Header>, L<Net::DNS::Question>, L<Net::DNS::RR>,
RFC 2845

=cut

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国v精品久久久网| 久久综合色天天久久综合图片| 91精品国产麻豆国产自产在线| 久久久九九九九| 亚洲综合在线视频| 韩国女主播成人在线| 欧美在线free| 欧美高清一级片在线观看| 性欧美大战久久久久久久久| 国产传媒久久文化传媒| 欧美日韩免费一区二区三区| 中文字幕av不卡| 日本视频免费一区| 色偷偷88欧美精品久久久| 精品国产三级a在线观看| 玉米视频成人免费看| 国产麻豆午夜三级精品| 91精品国产91久久久久久一区二区| 国产日韩高清在线| 久久精品国产秦先生| 欧美视频完全免费看| 中文字幕日韩一区二区| 黄色资源网久久资源365| 欧美日本一区二区三区| 亚洲主播在线播放| 91在线观看美女| 国产精品婷婷午夜在线观看| 精品写真视频在线观看| 欧美精品久久一区二区三区| 自拍偷拍亚洲激情| 99v久久综合狠狠综合久久| 国产欧美日韩另类视频免费观看| 日韩电影在线看| 欧美精品日韩精品| 五月婷婷另类国产| 9191成人精品久久| 奇米在线7777在线精品| 91精品国产综合久久香蕉的特点 | 成人午夜看片网址| 久久精品一区八戒影视| 精品一区精品二区高清| 精品国产伦一区二区三区观看体验| 天堂成人国产精品一区| 欧美日韩一区三区| 午夜a成v人精品| 日韩亚洲欧美中文三级| 另类人妖一区二区av| 精品久久久久久久一区二区蜜臀| 国产一区二区三区黄视频| 久久精品免视看| 成人动漫一区二区在线| 尤物av一区二区| 欧美三级韩国三级日本三斤| 日韩二区三区在线观看| 欧美成人艳星乳罩| 国产精品乡下勾搭老头1| 国产精品久久夜| 欧亚一区二区三区| 免费观看日韩av| 中文字幕一区二区日韩精品绯色| 色先锋aa成人| 九色porny丨国产精品| 国产午夜精品福利| 色综合久久综合| 石原莉奈在线亚洲二区| 精品999在线播放| 波多野结衣一区二区三区| 一卡二卡欧美日韩| 精品国产伦一区二区三区观看体验| 国产91精品免费| 亚洲电影一级片| 国产精品人成在线观看免费 | 99精品热视频| 蜜乳av一区二区| 中文字幕国产一区| 欧美日本一区二区三区| 成人小视频免费在线观看| 亚洲国产你懂的| 国产精品久线在线观看| 欧美一区二区播放| 成人18精品视频| 免费在线看成人av| 亚洲精品中文字幕乱码三区| 欧美福利视频一区| 色嗨嗨av一区二区三区| 久久成人免费网站| 亚洲一区二区三区中文字幕| 精品国产网站在线观看| 欧美日韩一级黄| 成人一区二区三区视频在线观看| 日韩成人dvd| 一区二区三区在线视频免费 | 2020日本不卡一区二区视频| 在线观看国产日韩| 国产成人丝袜美腿| 久久精品国产一区二区| 亚洲一区二区欧美日韩| 中文字幕日韩精品一区| 欧美极品美女视频| 亚洲精品一区二区三区99| 欧美色网一区二区| 色丁香久综合在线久综合在线观看| 国产成人综合在线播放| 麻豆国产91在线播放| 日韩精品欧美精品| 亚洲第一成人在线| 亚洲另类春色国产| 一色屋精品亚洲香蕉网站| 久久久国产综合精品女国产盗摄| 精品日韩一区二区三区免费视频| 精品视频免费看| 欧美三级韩国三级日本一级| 91国产免费观看| 色欧美88888久久久久久影院| 成人av电影在线| 成人免费视频免费观看| 不卡欧美aaaaa| av高清不卡在线| 色猫猫国产区一区二在线视频| 99精品视频一区二区| 91在线porny国产在线看| 一本一本久久a久久精品综合麻豆| 不卡欧美aaaaa| 一道本成人在线| 欧美日韩大陆在线| 91精品国产一区二区三区| 日韩免费观看高清完整版| 2021中文字幕一区亚洲| 国产蜜臀97一区二区三区 | 久久精品一级爱片| 日本一区二区电影| 亚洲精品老司机| 亚洲成av人片一区二区三区| 无码av中文一区二区三区桃花岛| 蜜桃视频在线观看一区二区| 黑人巨大精品欧美一区| 成人精品免费网站| 欧洲精品一区二区三区在线观看| 色欧美日韩亚洲| 色8久久精品久久久久久蜜| 欧美亚洲一区二区在线| 日韩视频在线一区二区| 欧美国产精品v| 亚洲福利国产精品| 另类的小说在线视频另类成人小视频在线 | 午夜激情久久久| 久久狠狠亚洲综合| 成人av在线影院| 欧美精品v国产精品v日韩精品| 日韩欧美一区二区在线视频| 国产日韩欧美激情| 亚洲国产精品久久艾草纯爱 | 久久女同互慰一区二区三区| 国产精品久久久久影院色老大| 亚洲无线码一区二区三区| 精彩视频一区二区三区| 成人久久视频在线观看| 67194成人在线观看| 国产精品麻豆久久久| 日韩国产一区二| 91视视频在线直接观看在线看网页在线看| 91福利精品视频| 国产日韩精品一区二区三区| 一区2区3区在线看| 高清shemale亚洲人妖| 欧美日韩国产高清一区二区三区| 国产区在线观看成人精品 | 成人高清视频在线| 欧美一卡在线观看| 亚洲综合色区另类av| 国产精品一二三在| 在线电影院国产精品| 日韩理论片在线| 丁香桃色午夜亚洲一区二区三区| 欧美亚男人的天堂| 欧美激情一区二区三区在线| 日韩激情一区二区| 色综合天天综合网天天狠天天| 精品国产制服丝袜高跟| 亚洲国产aⅴ成人精品无吗| 成人高清视频免费观看| 精品国产精品网麻豆系列| 亚洲成人综合网站| 在线一区二区三区| 自拍av一区二区三区| 国产99久久久久久免费看农村| 日韩视频一区二区在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 懂色av一区二区夜夜嗨| 欧美成人video| 久久精品国产99国产精品| 欧美日韩小视频| 亚洲国产精品视频| 欧美午夜不卡在线观看免费| 依依成人综合视频| 日本高清免费不卡视频| 亚洲三级久久久| 91污片在线观看| 一区二区三区在线观看国产| jlzzjlzz国产精品久久|