Re: [DNSOP] New draft on representing DNS messages in JSON

Andreas Gustafsson <gson@araneus.fi> Sat, 06 September 2014 14:02 UTC

Return-Path: <gson@araneus.fi>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 09A291A03D1 for <dnsop@ietfa.amsl.com>; Sat, 6 Sep 2014 07:02:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.765
X-Spam-Level:
X-Spam-Status: No, score=0.765 tagged_above=-999 required=5 tests=[BAYES_50=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_SOFTFAIL=0.665] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f_W7WIlQbKrP for <dnsop@ietfa.amsl.com>; Sat, 6 Sep 2014 07:02:56 -0700 (PDT)
Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E87D01A03C1 for <dnsop@ietf.org>; Sat, 6 Sep 2014 07:02:55 -0700 (PDT)
Received: from guava.gson.org (a91-153-56-171.elisa-laajakaista.fi [91.153.56.171]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 4B08D40065; Sat, 6 Sep 2014 17:02:49 +0300 (EEST)
Received: by guava.gson.org (Postfix, from userid 101) id 405BB75E39; Sat, 6 Sep 2014 17:02:48 +0300 (EEST)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <21515.5128.207638.132193@guava.gson.org>
Date: Sat, 06 Sep 2014 17:02:48 +0300
To: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <E87141BE-71E6-4F6F-9506-257A9FA681B7@vpnc.org>
References: <B4ACD73A-25EF-4063-81D4-DCFE6DB78AB1@vpnc.org> <E87141BE-71E6-4F6F-9506-257A9FA681B7@vpnc.org>
X-Mailer: VM 8.0.14 under 21.4.1 (i386--netbsdelf)
From: Andreas Gustafsson <gson@araneus.fi>
Archived-At: http://mailarchive.ietf.org/arch/msg/dnsop/SaqfdCMJ-n5bUa9zMa-vsTw2UuU
Cc: dnsop <dnsop@ietf.org>
Subject: Re: [DNSOP] New draft on representing DNS messages in JSON
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Sep 2014 14:02:58 -0000

In draft-hoffman-dns-in-json-01.txt, Section 2.5, Paul Hoffman wrote:
>   Given this, there are many possible choices for how to represent
>   domain names in JSON in a human-readable fashion.  In this list,
>   exampes are given for the label that has six octets 0x4341743A7FB52E
>   under the TLD "example".  Some examples are:
>
>   o  Show the character for all octets that are ASCII displayable
>      characters (0x21 to 0x7E, but not 0x2E), and the RFC 1035 "\DDD"
>      escaping for all other octets: "CAt:\D127\D181\D046.example."

There is no literal D in the \DDD encoding, so the final string should
read "CAt:\127\181\046.example."

>   o  Show the character for all octets that are ASCII displayable
>      characters (0x21 to 0x7E, but not 0x2E), and the normal JSON
>      escaping for all other octets: "CAt:&u007f&u00b5&u002e.example."

The normal JSON escaping uses backslashes, not ampersands, and so
would result in "CAt:\u007f\u00b5\u002e.example.".  But unless you are
actually suggesting a second layer of JSON-like escaping on top of
that applied by the JSON encoder, this will not work.  Firstly, when
using a standard JSON encoder, you do not have control over which
characters get escaped and which do not.  Secondly, even if you did
manage to produce a JSON document where "." and "\u002e" are intended
to mean different things, when that document is read by a standard
JSON decoder, they will result in identical string objects, and the
distinction will be lost.
-- 
Andreas Gustafsson, gson@araneus.fi