Show
Ignore:
Timestamp:
05/13/10 19:16:47 (3 years ago)
Author:
ahu
Message:

fix up NSEC3 rendering/generation/parsing

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/nsecrecords.cc

    r1611 r1614  
    109109 
    110110  rtr.xfrHexBlob(d_salt); 
    111   rtr.xfrHexBlob(d_nexthash); 
    112  
     111  rtr.xfrBase32HexBlob(d_nexthash); 
     112   
    113113  while(!rtr.eof()) { 
    114114    uint16_t type; 
     
    128128  pw.xfr8BitInt(d_nexthash.length()); 
    129129  pw.xfrBlob(d_nexthash); 
    130  
     130   
    131131  uint8_t res[34]; 
    132132  memset(res, 0, sizeof(res)); 
     
    158158 
    159159  pr.xfr8BitInt(len); 
     160   
    160161  pr.xfrBlob(ret->d_nexthash, len); 
    161  
     162   
    162163  string bitmap; 
    163164  pr.xfrBlob(bitmap); 
     
    172173   
    173174  if(bitmap[0]) 
    174     throw MOADNSException("Can't deal with NSEC mappings > 255 yet"); 
     175    throw MOADNSException("Can't deal with NSEC3 mappings > 255 yet"); 
    175176   
    176177  unsigned int bitmaplen=bitmap[1]; 
    177178  if(bitmap.size()!=2+bitmaplen) 
    178     throw MOADNSException("Can't deal with multi-part NSEC mappings yet"); 
     179    throw MOADNSException("Can't deal with multi-part NSEC3 mappings yet"); 
    179180   
    180181  for(unsigned int n=0 ; n < bitmaplen ; ++n) { 
     
    199200  rtw.xfrHexBlob(d_salt); 
    200201  rtw.xfrBase32HexBlob(d_nexthash); 
    201    
    202202  for(set<uint16_t>::const_iterator i=d_set.begin(); i!=d_set.end(); ++i) { 
    203203    ret+=" "; 
     
    223223  RecordTextReader rtr(content, zone); 
    224224  rtr.xfr8BitInt(d_algorithm);  
    225         rtr.xfr8BitInt(d_flags);  
    226         rtr.xfr16BitInt(d_iterations);  
     225  rtr.xfr8BitInt(d_flags);  
     226  rtr.xfr16BitInt(d_iterations);  
    227227  rtr.xfrHexBlob(d_salt); 
    228228}