if (algorithm != g_gsstsigdnsname) {
if(!db.getTSIGKey(tsigkeyname, algorithm, tsig64)) {
g_log<<Logger::Warning<<logPrefix<<"TSIG key not found"<<endl;
+ outpacket->setRcode(RCode::NotAuth);
+ sendPacket(outpacket,outsock);
return 0;
}
if (B64Decode(tsig64, tsigsecret) == -1) {
g_log<<Logger::Error<<logPrefix<<"unable to Base-64 decode TSIG key '"<<tsigkeyname<<"'"<<endl;
+ outpacket->setRcode(RCode::ServFail);
+ sendPacket(outpacket,outsock);
return 0;
}
}
}
if (!db.getTSIGKey(tsigkeyname, algorithm, tsig64)) {
g_log << Logger::Error << "TSIG key '" << tsigkeyname << "' for domain '" << target << "' not found" << endl;
+ outpacket->setRcode(RCode::NotAuth);
+ sendPacket(outpacket,outsock);
return 0;
}
if (B64Decode(tsig64, tsigsecret) == -1) {
g_log<<Logger::Error<<logPrefix<<"unable to Base-64 decode TSIG key '"<<tsigkeyname<<"'"<<endl;
+ outpacket->setRcode(RCode::ServFail);
+ sendPacket(outpacket,outsock);
return 0;
}
}