From: Miod Vallat Date: Fri, 25 Jul 2025 06:30:33 +0000 (+0200) Subject: Use ERCode symbolic names instead of their numerical values. X-Git-Tag: auth-5.1.0-alpha0^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d8260a9a9e076f3bf62e5eabde076cd1a429cf2;p=thirdparty%2Fpdns.git Use ERCode symbolic names instead of their numerical values. Signed-off-by: Miod Vallat --- diff --git a/pdns/tkey.cc b/pdns/tkey.cc index dc2590772..1421cd3a9 100644 --- a/pdns/tkey.cc +++ b/pdns/tkey.cc @@ -28,7 +28,7 @@ void PacketHandler::tkeyHandler(const DNSPacket& p, std::unique_ptr& auto inception = time(nullptr); // retain original name for response - tkey_out->d_error = 0; + tkey_out->d_error = RCode::NoError; tkey_out->d_mode = tkey_in.d_mode; tkey_out->d_algo = tkey_in.d_algo; // coverity[store_truncates_time_t] @@ -48,26 +48,26 @@ void PacketHandler::tkeyHandler(const DNSPacket& p, std::unique_ptr& } while(tmpName.chopOff()); if (meta.size() == 0) { - tkey_out->d_error = 20; + tkey_out->d_error = ERCode::BADNAME; } else { GssContext ctx(name); ctx.setLocalPrincipal(meta[0]); // try to get a context if (!ctx.accept(tkey_in.d_key, tkey_out->d_key)) { ctx.destroy(); - tkey_out->d_error = 19; + tkey_out->d_error = ERCode::BADMODE; } else { sign = true; } } } else { - tkey_out->d_error = 21; // BADALGO + tkey_out->d_error = ERCode::BADALG; } } else #endif { - tkey_out->d_error = 21; // BADALGO + tkey_out->d_error = ERCode::BADALG; #ifdef ENABLE_GSS_TSIG g_log<& ctx.destroy(); } else { - tkey_out->d_error = 20; // BADNAME (because we have no support for anything here) + tkey_out->d_error = ERCode::BADNAME; // (because we have no support for anything here) } } else { if (p.d_havetsig == false && tkey_in.d_mode != 2) { // unauthenticated @@ -97,7 +97,7 @@ void PacketHandler::tkeyHandler(const DNSPacket& p, std::unique_ptr& r->setRcode(RCode::NotAuth); return; } - tkey_out->d_error = 19; // BADMODE + tkey_out->d_error = ERCode::BADMODE; } tkey_out->d_keysize = tkey_out->d_key.size();