From: Mark Schouten Date: Mon, 23 Jun 2014 08:10:54 +0000 (+0200) Subject: Add dnskey and set the content to actual private data X-Git-Tag: auth-3.4.0-rc1~125^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1485%2Fhead;p=thirdparty%2Fpdns.git Add dnskey and set the content to actual private data --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 1359ba4e3b..70238530cb 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -511,8 +511,11 @@ static void apiZoneCryptokeys(HttpRequest* req, HttpResponse* resp) { key.AddMember("id", value.second.id, doc.GetAllocator()); key.AddMember("active", value.second.active, doc.GetAllocator()); key.AddMember("keytype", (value.second.keyOrZone ? "ksk" : "zsk"), doc.GetAllocator()); + Value dnskey(value.first.getDNSKEY().getZoneRepresentation().c_str(), doc.GetAllocator()); + key.AddMember("dnskey", dnskey, doc.GetAllocator()); if (req->path_parameters.count("key_id")) { - Value content(value.first.getDNSKEY().getZoneRepresentation().c_str(), doc.GetAllocator()); + DNSSECPrivateKey dpk=dk.getKeyById(zonename, lexical_cast(req->path_parameters["key_id"])); + Value content(dpk.getKey()->convertToISC().c_str(), doc.GetAllocator()); key.AddMember("content", content, doc.GetAllocator()); }