Re: [kitten] draft-ietf-kitten-rfc5653bis-02 review

Thomas Maslen <Thomas.Maslen@software.dell.com> Sun, 15 February 2015 01:23 UTC

Return-Path: <Thomas.Maslen@software.dell.com>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 28BDD1A0126 for <kitten@ietfa.amsl.com>; Sat, 14 Feb 2015 17:23:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.312
X-Spam-Level:
X-Spam-Status: No, score=-2.312 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 cEM7yjuTZSfe for <kitten@ietfa.amsl.com>; Sat, 14 Feb 2015 17:22:58 -0800 (PST)
Received: from amersmtp2.software.dell.com (amersmtp2.software.dell.com [12.106.87.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 747951A00FE for <kitten@ietf.org>; Sat, 14 Feb 2015 17:22:57 -0800 (PST)
Received: from amersmtp2.software.dell.com (127.0.0.1) id hrvqf40171sv for <kitten@ietf.org>; Sat, 14 Feb 2015 17:22:56 -0800 (envelope-from <Thomas.Maslen@software.dell.com>)
Received: from ALVHTXW02.prod.quest.corp ([10.1.135.18]) by amersmtp2.software.dell.com (SonicWALL 8.0.7.2831) with ESMTPS (version=TLSv1 cipher=AES128-SHA bits=128/128) id 201502150122560292199; Sat, 14 Feb 2015 17:22:56 -0800
Received: from ALVMBXW01.prod.quest.corp ([fe80::48dd:e065:86b3:9cee]) by ALVHTXW02.prod.quest.corp ([::1]) with mapi id 14.03.0224.002; Sat, 14 Feb 2015 17:22:56 -0800
From: Thomas Maslen <Thomas.Maslen@software.dell.com>
To: Benjamin Kaduk <kaduk@MIT.EDU>
Thread-Topic: [kitten] draft-ietf-kitten-rfc5653bis-02 review
Thread-Index: AQHQRZiqtINAbwvb/kCw227JtWH+lJzuJFmAgAKbcDI=
Date: Sun, 15 Feb 2015 01:22:55 +0000
Message-ID: <D5847DD823005F4E9DB94FE77DCEDF68319F0A7A@ALVMBXW01.prod.quest.corp>
References: <D5847DD823005F4E9DB94FE77DCEDF68319E4B4C@ALVMBXW02.prod.quest.corp>, <alpine.GSO.1.10.1502121726170.3953@multics.mit.edu>
In-Reply-To: <alpine.GSO.1.10.1502121726170.3953@multics.mit.edu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.1.104.155]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mlf-Version: 8.0.7.2831
X-Mlf-UniqueId: o201502150122560292199
Archived-At: <http://mailarchive.ietf.org/arch/msg/kitten/Z7_W42klczK6O2wGhzgmD-EDyfo>
Cc: "kitten@ietf.org" <kitten@ietf.org>
Subject: Re: [kitten] draft-ietf-kitten-rfc5653bis-02 review
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/kitten/>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Feb 2015 01:23:01 -0000

On Thu, 12 Feb 2015, Benjamin Kaduk wrote:
> [...]
> While there is a strong sequencing requirement for context-level tokens
> (the negotiation loop proceeds in lockstep), and so a stream-based method
> would definitely be workaboe there, the per-message operations do not have
> that ordering requirement.  I think it would be an unreasonable burden on
> an application to expect it to supply input streams to the per-message
> GSS operations which are guaranteed to only supply a single token.  Even
> though it is possible to do, it requires a lot of effort to do correctly.

Quite possibly I'm missing something obvious or just haven't thought this through, but:

Even in really complex scenarios, e.g. running with requestSequenceDet(false) + concurrent / unordered delivery of application messages from the peer (e.g. using UDP or a separate TCP connection for each) + multiple threads operating concurrently to receive these application messages and present their per-message tokens to the GSSContext instance, I believe that it's as easy (or as difficult) to use the stream-based methods as it is to use the byte-array methods.

Possibly relevant:  note that the spec (2853, 5653, 5653bis) doesn't promise anything about concurrency w.r.t. the methods of a GSSContext instance (nor about anything else in the API, for that matter) -- in particular, the Java keyword "synchronized" doesn't appear anywhere.  [Yes, it might be a good thing if this were more explicit in the spec, whereas at present it's very very implicit;  by contrast, GSSContext's Javadoc in the JDK

    http://docs.oracle.com/javase/1.5.0/docs/api/org/ietf/jgss/GSSContext.html

comes right out and says "Also note that none of the methods in this interface are synchronized. Therefore, it is not advisable to share a GSSContext among several threads unless some application level synchronization is in place"].

The byte-array methods may intuitively seem to be kinda sorta "more atomic" than the stream-based methods, but they aren't;  if you're using multiple threads to feed per-message tokens to a GSSContext instance then you're responsible for serializing the calls, regardless of whether you're using the byte-array methods or the stream-based methods.


[Skipping...]

> My ideological preference would be consistency between the flavors, but I
> would accept a solution that explicitly spelled out that the stream-based
> methods handled error tokens in one way and the byte-array methods handled
> error tokens in a different way.  The reason that I am arguing for the
> exception to carry the error token in the stream method is that it seems
> the best way to clearly spell out how to generate error tokens in the way
> which is most likely to be backwards-compatible.  Having the
> implementation automatically insert the error token into the stream seems
> like it introduces a risk of duplicating the token (albeit a very small
> one), and I don't see that risk if the exception carries the token.

I agree;  if, per the rfc5653bis drafts, GSSException is extended to carry the error token, then I think it's reasonable (and probably a good idea) to say that the implementation should always convey the error token in the GSSException, never in the OutputStream.

[One caveat, but it's probably not worth worrying about because this may be strictly hypothetical:  if there are any cases where an existing JGSS implementation has already been using the OutputStream to convey an error token (because that was the only approach that was available in 2853 or 5653) and real application code has been making use of this, then we might be outlawing something that has worked up until now...  but my guess is that this is only a hypothetical concern].