Re: [TLS] raw public keys in the wild?

Richard Barnes <rlb@ipv.sx> Thu, 23 August 2018 21:08 UTC

Return-Path: <rlb@ipv.sx>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9264D130F01 for <tls@ietfa.amsl.com>; Thu, 23 Aug 2018 14:08:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level:
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ipv-sx.20150623.gappssmtp.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 CCvh0XuhcHjB for <tls@ietfa.amsl.com>; Thu, 23 Aug 2018 14:08:08 -0700 (PDT)
Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (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 6252512F1A2 for <tls@ietf.org>; Thu, 23 Aug 2018 14:08:08 -0700 (PDT)
Received: by mail-oi0-x234.google.com with SMTP id c190-v6so11759878oig.6 for <tls@ietf.org>; Thu, 23 Aug 2018 14:08:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipv-sx.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CEhDX7pzUs8BtgYdltIfbbgiDyL1OSoeXNa8+xIysyQ=; b=EixU8bhHq3hVLWQeAfpJkxSfpIrRBHI6aGoPcP3EWtrgOpEdUP6tjQFi0hv4BwVQZH 9MYE6+umIAmucw1NYLqDJdHcWAbnUGyBbcSe+s2u4HkoYY/Z6JEZZcejv/01XaYN+bzY BnddcNNMHBu2LWqW3pSUMhlWs29sEgLTrEeLf+bPv5LWSjzblLsOFUV6apVWFfqY6pW+ Dd3x+NJxH10Hqg5seLvFB/OZRX+CjWqonzIZSEZh1f6gghGy0Q+xibISrAbvmBlgeYkV ggpixPgzaDnraqCAm+YFWOWg+g+b+PyCV9t9BFd4jbcIESfQk+wsYuDepvvyHPO13p0e 74Rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CEhDX7pzUs8BtgYdltIfbbgiDyL1OSoeXNa8+xIysyQ=; b=tHzdH2gwJI7leGPJRIIr6dj8U2dS7PED2NnqE9S+F6gd8ALw21fHt5GE+cNlkRaz6R QaiiTm19UrNhZT7p6IN4uZzSNpJXreFYJg5kvdr4plJBZsu04ytDxtSpbzMqsLYK2EYw 6Nv5ZB75ic6YlAbmsliKNtfXL9OLAT4gMTTvYcLXh40MqTJVXWZ/MKOEAiO8GM4wGyKx 3UGJoLrGO4eJJd/ZFaU3bdjxehCKDKRb3+xqKPH015SOU+u7Fb7s0yc8b1n2FWdoTPRE 5y6v/Hg5qhxlaHJDJVM9OfZQY65xQPaHOmMCm2162VW9V+PToVdDrfHN1T3lsuAdZPW4 OyjA==
X-Gm-Message-State: APzg51Al8IEfkQdzAIhAMxi5SsXKIMxL2u4NAdU2bm0kK4I6OMeboUgp HqjycnuFl28bvImulZK0cuNCtUfegYP5jT5D3cFyMhI5pJU=
X-Google-Smtp-Source: ANB0VdY7ZFFfhmVT468dWh8AuTScs9pqG4VcXbvjH1I2y3Kwe+8eOwJBAOAuktLYKMWywyYR/ek5jEJXSTHRHaLc+rA=
X-Received: by 2002:aca:c74d:: with SMTP id x74-v6mr3862839oif.97.1535058487524; Thu, 23 Aug 2018 14:08:07 -0700 (PDT)
MIME-Version: 1.0
References: <A51CF46A-8C5F-4013-A4CE-EB90A9EE94CA@akamai.com> <E6C9F0E527F94F4692731382340B337804AEFB10@DENBGAT9EH2MSX.ww902.siemens.net> <D5FF0E0E-F9C3-4843-AB77-19F45E3C00D5@akamai.com> <8A2746A8-6B41-45C3-9D77-6AF3536C6E2D@siemens.com> <DM5PR2201MB1433B9D7F9AA3B7B688CD33C99310@DM5PR2201MB1433.namprd22.prod.outlook.com> <CAPt1N1mm9FzGknCUTOVZH_S=AsjutXS8qM7Ksa8xWwsSKKAgAg@mail.gmail.com> <EC6705A4-A6CB-45B4-B006-FC0AE42FA6DD@dukhovni.org> <CABcZeBO8tBN4a4SZirxbwNdRyep705dNgGZiuKydg=xu1JT_uQ@mail.gmail.com> <3321850E-D95E-457C-A574-2A1A3F7AC06C@dukhovni.org> <1534902946308.39422@cs.auckland.ac.nz> <20180822030846.GN28851@straasha.imrryr.org> <1534913286161.86694@cs.auckland.ac.nz>
In-Reply-To: <1534913286161.86694@cs.auckland.ac.nz>
From: Richard Barnes <rlb@ipv.sx>
Date: Thu, 23 Aug 2018 17:07:56 -0400
Message-ID: <CAL02cgTnmJnz5sNLDC8bJ5R0pfPsAUqudmTCZ+_Dm_5G2p2=zw@mail.gmail.com>
To: pgut001@cs.auckland.ac.nz
Cc: "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000dbd0f6057420a7d4"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/E59i1GS1Cznaa2txtDX4asLbM0c>
Subject: Re: [TLS] raw public keys in the wild?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 23 Aug 2018 21:08:11 -0000

Since we're talking about bare public keys / not verifying certificates
again, a brief reminder:

https://tools.ietf.org/html/draft-barnes-dane-uks-00

On Wed, Aug 22, 2018 at 12:49 AM Peter Gutmann <pgut001@cs.auckland.ac.nz>
wrote:

> Viktor Dukhovni <ietf-dane@dukhovni.org> writes:
>
> >Some DANE users have reached similar conclusions, though a bit of ASN.1
> >parsing is still required to "seek" to the SPKI, which is not at a fixed
> >offset in the certificate.
>
> It's actually much simpler than that because you've got a nice unique byte
> string, the OID, in front of the key.  My code jumps 64 bytes in and then
> scans from there looking for the byte string corresponding to SEQUENCE {
> RSA
> OID, NULL }.  What follows is the public key, you skip the wrapper bytes
> and
> grab the two integer values that follow.
>
> >  41   32:     SEQUENCE {
> >  43   13:       UTCTime 27/07/2014 14:59:59 GMT
> >  58   15:       GeneralizedTime 27/11/3013 14:59:59 GMT
> >         :       }
>
> Yeah, seen those sorts of things too, my code has special-case handling to
> clip validTo at 32-bit INT_MAX - 1 if it sees long lifetimes (getting
> pedantic, it's actually 2036 since some embedded libraries have problems
> with
> time_t values too close to INT_MAX).
>
> >It does not stricly comply with RFC5280, which forbids empty RDN sequences
> >for the issuer field, but this does not seem to be a problem in practice.
>
> Yup.  If all you're doing is a string search for the RSA OID, no-one cares
> what else is or isn't present.
>
> Peter.
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>