[kitten] CAMMAC ASN.1 module issues

Greg Hudson <ghudson@mit.edu> Sat, 25 October 2014 16:49 UTC

Return-Path: <ghudson@mit.edu>
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 AC12A1A0383 for <kitten@ietfa.amsl.com>; Sat, 25 Oct 2014 09:49:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.712
X-Spam-Level:
X-Spam-Status: No, score=-1.712 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, J_CHICKENPOX_31=0.6, 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 47z_ndmNiDZa for <kitten@ietfa.amsl.com>; Sat, 25 Oct 2014 09:49:29 -0700 (PDT)
Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu [18.9.25.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E4C1C1A0072 for <kitten@ietf.org>; Sat, 25 Oct 2014 09:49:28 -0700 (PDT)
X-AuditID: 1209190f-f79aa6d000005b45-75-544bd4977d79
Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 4E.56.23365.794DB445; Sat, 25 Oct 2014 12:49:27 -0400 (EDT)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s9PGnQHH000592 for <kitten@ietf.org>; Sat, 25 Oct 2014 12:49:27 -0400
Received: from localhost (equal-rites.mit.edu [18.18.1.59]) (authenticated bits=0) (User authenticated as ghudson@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s9PGnPQJ018451 for <kitten@ietf.org>; Sat, 25 Oct 2014 12:49:26 -0400
From: Greg Hudson <ghudson@mit.edu>
To: kitten@ietf.org
Date: Sat, 25 Oct 2014 12:49:25 -0400
Message-ID: <x7dwq7onlgq.fsf@equal-rites.mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsUixCmqrDv9ineIwetvEhZHN69icWD0WLLk J1MAYxSXTUpqTmZZapG+XQJXxv3JG9gLbgpVrF/yi7WB8SxfFyMnh4SAicTSHT1sELaYxIV7 64FsLg4hgdlMEisOrGKHcI4zSuxc95oJwulgkrh/qIsdpIVNQFli/f6tLCC2iICwxO6t75hB bGGg+OmmI6wgNouAqsTGrc/A6nkFDCVOb9/IAmELSpyc+QTMZhbQkrjx7yXTBEaeWUhSs5Ck FjAyrWKUTcmt0s1NzMwpTk3WLU5OzMtLLdI10cvNLNFLTSndxAgOD0n+HYzfDiodYhTgYFTi 4a1g8w4RYk0sK67MPcQoycGkJMornAQU4kvKT6nMSCzOiC8qzUktPsQowcGsJML79QJQjjcl sbIqtSgfJiXNwaIkzrvpB1+IkEB6YklqdmpqQWoRTFaGg0NJgvfSZaBGwaLU9NSKtMycEoQ0 EwcnyHAeoOF8V0CGFxck5hZnpkPkTzEqSonztoM0C4AkMkrz4Hph8fuKURzoFWHe3yBVPMDY h+t+BTSYCWhw/AYPkMEliQgpqQZG5QyzinPLGa2VS28yJR/zl09Lvnes7YXdP7E9S/fyPd6W cGz/Onb9Gz8SfJ4vep9T+cieMX7qA6vjR/YEzhM/Ij1D6OTraTMufak7Jdja1KCscjdpl+fh PEnOKes6TZ518/NmVr+2SZvs+aHv4a1qx4WbdGI25zbe5X6lpq70JFbh7arFk9mfK7EUZyQa ajEXFScCAC816866AgAA
Archived-At: http://mailarchive.ietf.org/arch/msg/kitten/UWxvvpA7ZbMdnwZ1bn5i-6ad-dA
Subject: [kitten] CAMMAC ASN.1 module issues
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: Sat, 25 Oct 2014 16:49:30 -0000

While working on creating test vectors for CAMMAC using asn1c, I noticed
into three issues with the ASN.1 module.  Two are just matters of form,
but the third will affect the encoding if we decide to change it.  I
believe we're at a slightly awkward stage of the workflow for this
draft, but at least we are still before IETF last call.

1. The ASN.1 module needs IMPORTS declarations for the RFC 4120 types it
uses.  I have submitted a pull request to Tom's github repository with
the necessary import statements.

2. There is no OID in the module declaration.  I don't know how
important this is in practice, but all of the other Kerberos-related
ASN.1 modules I looked at have OIDs.

3. Verifier is defined as an untagged CHOICE with just one initial
choice:

   Verifier             ::= CHOICE {
         mac            Verifier-MAC,
         ...
   }

The last time we used this kind of extensibility was PA-FX-FAST-REQUEST
in RFC 6113:

   PA-FX-FAST-REQUEST ::= CHOICE {
       armored-data [0] KrbFastArmoredReq,
       ...
   }

While armored-data has an explicit [0] context tag, Verifier's mac field
does not.  Therefore, the Verifier-MAC will appear in the DER encoding
of Verifier with just its usual sequence tag (universal 0x10).

On the positive side, the lack of a context tag here typically saves
four bytes per CAMMAC (two for each Verifier).  If we never add
additional choices to Verifier, the unused extensibility costs us
nothing on the wire; the DER encoding looks just like it would if we had
directly used Verifier-MAC within AD-CAMMAC.

But if we do add additional Verifier choices, there is an implementation
constraint.  We would likely use context tags for subsequent choices, as
it would be an ASN.1 violation to simply add another field with a
sequence type.  The ASN.1 decoder for Verifier would need to be able to
process either a context tag or universal sequence tag.  The current MIT
krb5 ASN.1 implementation can handle this (we don't make assumptions
that choices use context tags; we just match the tag we read against the
expected tag of each choice in turn), but I don't know about other
implementations.

My current preference is to leave this alone, but I wanted to make sure
it was discussed explicitly in the working group and doesn't just slip
through.  Apologies if we discussed this before.