[Pdns-users] PostgreSQL schema for DNSSEC signing

Peter van Dijk peter.van.dijk at netherlabs.nl
Fri Jan 10 10:42:18 UTC 2014


Hello Ken,

replying to both messages in-line.

On 09 Jan 2014, at 23:47 , ktm at rice.edu wrote:

> On Thu, Jan 09, 2014 at 10:26:07AM -0600, ktm at rice.edu wrote:
>>  WHILE lpos <= LENGTH(dnsname) LOOP
>>    rpos := INSTR(dnsname, '.', lpos);

rpos is set here, did you miss that?

> Okay, using the assumption that the code has a bug, here is the PostgreSQL
> version:
> 
> ------------------------------------------------
> test=> select dnsname_to_raw('moe.rice.edu');
>         dnsname_to_raw         
> --------------------------------
> \x036d6f6504726963650365647500
> (1 row)
> 
> This seems like it should be the correct result, but I would appreciate
> it if someone who knew would corroborate this. Thank you.

Above result is correct.

However:
This should be identical to above (only one trailing 00):
vagrant=> select dnsname_to_raw('moe.rice.edu.');
          dnsname_to_raw          
----------------------------------
 \x036d6f650472696365036564750000
(1 row)

This should perhaps be an error (but don’t worry too much, garbage in ..):
vagrant=> select dnsname_to_raw('moe.rice.edu..');
           dnsname_to_raw           
------------------------------------
 \x036d6f65047269636503656475000000
(1 row)


This may cause trouble at some point (I would expect \x00):
vagrant=> select dnsname_to_raw('');
ERROR:  upper bound of FOR loop cannot be null
CONTEXT:  PL/pgSQL function "dnsname_to_raw" line 28 at FOR with integer loop variable

And this should certainly be \x00:
vagrant=> select dnsname_to_raw('.');
 dnsname_to_raw 
----------------
 \x000000
(1 row)


Interesting work! I hope this helps :)

Kind regards,
-- 
Peter van Dijk
Netherlabs Computer Consulting BV - http://www.netherlabs.nl/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20140110/70ab5369/attachment-0001.sig>


More information about the Pdns-users mailing list