Re: [kitten] Clarification of gss_add_cred() behavior

Viktor Dukhovni <viktor1dane@dukhovni.org> Fri, 20 March 2015 00:36 UTC

Return-Path: <viktor1dane@dukhovni.org>
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 844841A1B53 for <kitten@ietfa.amsl.com>; Thu, 19 Mar 2015 17:36:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -101.9
X-Spam-Level:
X-Spam-Status: No, score=-101.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, USER_IN_WHITELIST=-100] 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 CBT3MeGwhYE2 for <kitten@ietfa.amsl.com>; Thu, 19 Mar 2015 17:36:26 -0700 (PDT)
Received: from mournblade.imrryr.org (mournblade.imrryr.org [38.117.134.19]) (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 8DE171A1B4E for <kitten@ietf.org>; Thu, 19 Mar 2015 17:36:26 -0700 (PDT)
Received: by mournblade.imrryr.org (Postfix, from userid 1034) id 87D0D283011; Fri, 20 Mar 2015 00:36:25 +0000 (UTC)
Date: Fri, 20 Mar 2015 00:36:25 +0000
From: Viktor Dukhovni <viktor1dane@dukhovni.org>
To: kitten@ietf.org
Message-ID: <20150320003625.GR4309@mournblade.imrryr.org>
References: <20150319025202.GB8099@localhost> <alpine.GSO.1.10.1503191446260.3953@multics.mit.edu> <20150319194002.GG4309@mournblade.imrryr.org> <alpine.GSO.1.10.1503191541510.3953@multics.mit.edu> <20150319195605.GM8099@localhost> <alpine.GSO.1.10.1503192019350.3953@multics.mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <alpine.GSO.1.10.1503192019350.3953@multics.mit.edu>
User-Agent: Mutt/1.5.23 (2014-03-12)
Archived-At: <http://mailarchive.ietf.org/arch/msg/kitten/b2EiBx3mxHvhmcgTtI2rg6NWZf8>
Subject: Re: [kitten] Clarification of gss_add_cred() behavior
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: kitten@ietf.org
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: Fri, 20 Mar 2015 00:36:30 -0000

On Thu, Mar 19, 2015 at 08:20:18PM -0400, Benjamin Kaduk wrote:

> On Thu, 19 Mar 2015, Nico Williams wrote:
> 
> > GSS_C_NO_NAME.  But then I can never use GSS_Add_cred() to acquire a
> > signle-element credential, and I must always use GSS_Acquire_cred() for
> > that (which is lame for several reasons).
> 
> Perhaps I'm just being slow today, but could you say more about what these
> reasons for lameness are?

    1.  Building a set of things via a different function for the
        first element than then the rest is ugly.

    2.  Calls to gss_acquire_cred() need a mechanism *set*, so one
	ends up building one-element sets for that, and disposing
	of those (though I'm working around that with automatic
	singleton mech sets):

		gss_OID mech = ...;
		gss_OID_set_desc onemech = { 1, mech };

		gss_acquire_cred(..., &onemech, ...);

	Naively, one would allocate an empty set, add the mech to
	that, handle errors, ... use the set, and deallocate it.

    3.  Unclear semantics with respect to error reporting from
	gss_acquire_cred.  Does it report the mechanism-specific
	minor code for the sole mechanism when oid set is a
	singleton?

    4.  The semantics of gss_add_cred() with GSS_C_NO_CREDENTIAL
	for the input cred are underspecified.  (Which mechs are
	use to construct the missing initial cred handle?  Is the
	desired_name ignored when the requested mech is "added",
	and in what sense is it "added" anyway, since other than
	name it would likely already be in that default credential?)

The interface would be simpler and more clear if gss_add_cred()
could just start from zero.

-- 
	Viktor.