<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On 7 August 2014 04:25, Jim Barber <span dir="ltr"><<a href="mailto:jim.barber@primaryhealthcare.com.au" target="_blank">jim.barber@primaryhealthcare.com.au</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Hopefully this is the correct mailing list to report an issue I've encountered.<br></blockquote><div><br></div><div>No it is not.  Bugs are reported using the CPAN RT system.<br><br>But as this is probably not a bug, here is ok.<br>


<br></div><div>I suggest you start by reading the documentation for Net::DNS::RR::TSIG and Net::DNS::Packet (sign_tsig) and adjust your example to match.<br></div><div><br> use Carp;<br> use Net::DNS;<br> <br> my $resolver = new Net::DNS::Resolver();<br>


 <br> my $key_name    = 'key_name';<br> my $algorithm    = '<a href="http://gss.microsoft.com" target="_blank">gss.microsoft.com</a>';<br> my $gss_context = 'gss_context';<br> <br> sub gss_sign {<br>

     carp sprintf( "gss_sign( %s, %s )\tcalled", map unpack('H*',$_), @_ );<br>     scalar reverse shift;    # fake sig<br> }<br> <br> my $tsig = Net::DNS::RR->new(<br>
     name       => $key_name,<br>     type         => "TSIG",<br>     algorithm => $algorithm,<br>     sign_func => \&gss_sign,<br>     keybin     => $gss_context,      # key  => $gss_context,<br>


     );<br> <br> my $query = Net::DNS::Packet->new('x');<br> $query->sign_tsig($tsig);<br> <br> my $reply = $resolver->send($query);<br><br></div><div></div><div>Note that the "key" is binary, not Base64 encoded. I guess this may be a large part of your problem. The version shipped with 0.68 had the conversions is the wrong places, which made it impossible to build an internal key management scheme which could handle both predefined HMAC-SHA functions and the external function needed for GSS. <br>


</div><div><br></div><div>In the key table, the algorithm name indicates the signing function to be used, and the key name indicates which key to use. This association can not be changed.<br><br></div><div>The TSIG that is presented to packet->sign_tsig() is never modified and can be reused;  the TSIG added to the packet is a copy with the MAC and other info added automatically.<br>

</div><div><br></div> <br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

>From version 0.68 to 0.78 of the Net::DNS perl module it looks like there were quite a lot of changes to the Net::DNS::RR::TSIG module.<br></blockquote><div>This was a complete rewrite, for two separate reasons:<br>
1) The internal architecture of Net::DNS::RR changed significantly between 0.68 and 0.69.<br></div><div>2) There was no support for TSIG verification or for signing multi-message transactions like zone transfers (added in 0.75).<br>


<br><br></div><div>It would be interesting to see if you can make a TSIG verified zone transfer work using your GSS setup.  This is the code I used for HMAC-SHA256 with BIND.<br><br> my $resolver = new Net::DNS::Resolver( nameservers => [@ip] );<br>


<br> $resolver->tsig( $tsig );<br><br> my @zone = $resolver->axfr( '<a href="http://example.com" target="_blank">example.com</a>', 'IN' );<br> <br> warn "Zone transfer failed: ", $resolver->errorstring, "\n" unless @zone;<br>


 <br> $_->print foreach @zone;<br><br><br></div><div><br></div></div></div></div>