[jose] Jws Json Unencoded option and JSON payloads

Sergey Beryozkin <sberyozkin@gmail.com> Tue, 24 May 2016 14:28 UTC

Return-Path: <sberyozkin@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A387912D82B for <jose@ietfa.amsl.com>; Tue, 24 May 2016 07:28:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 HWjRDkoK-TkY for <jose@ietfa.amsl.com>; Tue, 24 May 2016 07:28:41 -0700 (PDT)
Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7E5CA12D836 for <jose@ietf.org>; Tue, 24 May 2016 07:28:40 -0700 (PDT)
Received: by mail-wm0-x235.google.com with SMTP id a136so77217351wme.0 for <jose@ietf.org>; Tue, 24 May 2016 07:28:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=gg910RNTYqzF8mnowS8n/xwOEmqV9eEExAJCOkncv2Q=; b=A6ZVHVlMMW+3hQAxx7o4FmLjBkD03D4/dWTUyn8BJbrO2qlgnbELbIFHMfHsR3OhHZ DhuMBHoyIErrFeodupEDpc5WhMMi69ru5/TVq5Z5o6Nw8aGvs9NM+wxRoLW+ujc/6G/N hp7nMbbsi/DMxtBg9auEQ4LW1Nm9lJDg+RzJPw3+ywvcl9BZ0dNfi11ac0GVWVzZ/fY0 BEtrf5u3sszfFdDbvMXhxrXSwI1jSWMvr/TopOPGYUfG99SXpZ8JEdbnSc6mWrqSLTki fk7Z1bOT8ijaYQmXxgLof00mE4qQqG0qB/zH3N8zL+ldKZ5wEYE+N+tdfQyC43lcfVq/ fnKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=gg910RNTYqzF8mnowS8n/xwOEmqV9eEExAJCOkncv2Q=; b=ElYWQe11XxxELSOUQGF82lTHHX3N22jM6YKOgYNo7ehG15FfnAuQmLe2nXYsGMLwuc DbigEXRHYUbnHdf6oY+8CAUEuB2BIhKKnVR/GZ6my5wPIqRXnsdQVfcQjIrou0SmBFaC Nqukg18p9EhzxYLPWKphW2vWwiphxDGPxX1JHboG/0iJ32grehWvay47dUXLG6p6ui/I 9CHvhHZVPynM2hoVGRD43N6gHV1bV0E8XuJtd/8Xd0JfjlKMRDTD0tEG7BmHTbtHDNeW uzGB7f66EXNFnZ7zY0vDn4YxoCpTaZd62Pw3dPa9ZAj9WkJul7Pte9NweTG+YSSux9C1 K/rg==
X-Gm-Message-State: AOPr4FX3zKDtO5l09qpDdfw1NpGwUz4/UO9ZR35HF2JBKNAW3hn2wP1MaDNJ9e5dTak7yQ==
X-Received: by 10.28.138.13 with SMTP id m13mr24234649wmd.3.1464100119079; Tue, 24 May 2016 07:28:39 -0700 (PDT)
Received: from [192.168.2.7] ([79.97.121.181]) by smtp.googlemail.com with ESMTPSA id l74sm4026177wmb.15.2016.05.24.07.28.37 for <jose@ietf.org> (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 May 2016 07:28:38 -0700 (PDT)
To: "jose@ietf.org" <jose@ietf.org>
From: Sergey Beryozkin <sberyozkin@gmail.com>
Message-ID: <57446515.8070900@gmail.com>
Date: Tue, 24 May 2016 15:28:37 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/jose/zfuxQeUQ4m3I4zYRgEPgN5aKD2M>
Subject: [jose] Jws Json Unencoded option and JSON payloads
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 24 May 2016 14:28:45 -0000

Hi

I've been experimenting recently with JWS JSON and
https://tools.ietf.org/html/rfc7797

I did some tests awhile back with the plain text payload, all was good, 
but now I've tried passing an encoded JSON, example, {"a":"b"} which 
resulted in

{
   "payload": "{"a":"b"}"
   ...
}

which caused a parse error on the receiving side. I found

https://tools.ietf.org/html/rfc7797#section-8

referring to the fact it is the responsibility of the application to 
deal with it.

My question is, why, when "b64":false is set, it is not possible to have

{
"payload": {"a":"b"}
...
}

for payloads which are in JSON format as opposed to having a restriction 
the JWS JSON payload should always be a JSON string ?

Thanks, Sergey