Changeset 2148

Show
Ignore:
Timestamp:
04/09/11 20:29:01 (2 years ago)
Author:
ahu
Message:

sligthly improve error messages on checking the TSIG signatures on incoming zone transfers

Files:
1 modified

Legend:

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

    r2147 r2148  
    383383        theirMac = boost::dynamic_pointer_cast<TSIGRecordContent>(answer.first.d_content)->d_mac; 
    384384    } 
     385    if(theirMac.empty()) 
     386      throw ResolverException("No TSIG on AXFR response from "+d_remote.toStringWithPort()+" , should be signed with TSIG key '"+d_tsigkeyname+"'"); 
     387       
    385388    string message = makeTSIGMessageFromTSIGPacket(string(d_buf.get(), len), mdp.getTSIGPos(), d_tsigkeyname, d_trc, d_trc.d_mac, false); // insert our question MAC 
    386389    string ourMac=calculateMD5HMAC(d_tsigsecret, message); 
    387390    // ourMac[0]++; // sabotage 
    388391    if(ourMac != theirMac) 
    389       throw ResolverException("AXFR response from "+d_remote.toStringWithPort()+" was not signed correctly with TSIG key '"+d_tsigkeyname+"'"); 
     392      throw ResolverException("Signature failed to validate on AXFR response from "+d_remote.toStringWithPort()+" signed with TSIG key '"+d_tsigkeyname+"'"); 
    390393  } 
    391394