Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E514C10FAF for ; Sun, 2 Nov 2014 10:07:51 +0000 (UTC) Received: (qmail 83349 invoked by uid 500); 2 Nov 2014 10:07:51 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 83274 invoked by uid 500); 2 Nov 2014 10:07:51 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 83262 invoked by uid 99); 2 Nov 2014 10:07:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2014 10:07:51 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [85.25.46.13] (HELO fornix.velox.ch) (85.25.46.13) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Nov 2014 10:07:25 +0000 Received: from cortex.velox.ch (77-57-164-164.dclient.hispeed.ch [77.57.164.164]) (authenticated bits=0) by fornix.velox.ch (8.14.4/8.14.4/2.2) with ESMTP id sA2A7LJI022991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 2 Nov 2014 11:07:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=velox.ch; s=fornix-727e; t=1414922842; bh=4dWPw0NnIGK/F4O0h95Rv3j5/hV6Kw/H6qDj3izbpxs=; h=Date:From:To:Subject:References:In-Reply-To; b=HTALalbXIKHOSJlhmOSlVJMIrxKCwhOYXh0tK+0PHTV+EDldFQMwGEe5Um/XtLa5/ gdjdaamdBmG3lDf16BMuTKXIkKCza/SvEFWcOgxIjhbPcWMdE67wgIunTtYYNudWAB LqZVRv6kGaGIbCO3hY/KyVzbYWe9Dy/OmTEEopoCPS7c8dQBJ/hfcFIVT6dqAB5brS +eOl21gtuVgZ+UP5+ljDx9VNw6b4gk0rZs7NmNQkoYrBql8ewUEBjABIcIDYSK3QNR 1/6sEHComK/GR/dS3/BI+Kulknq047o4BXjmGgWHqwlI1khQ7b2wJtFsdoCaj133HL fwQ6KdYdiSXxg== X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on cortex.velox.ch X-Spam-Level: Message-ID: <54560256.8040509@velox.ch> DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=velox.ch; s=cortex-8a58; t=1414922839; bh=4dWPw0NnIGK/F4O0h95Rv3j5/hV6Kw/H6qDj3izbpxs=; h=Date:From:To:Subject:References:In-Reply-To; b=xpWvwmaCJZKJ/rT+TRKM6c2hazEDu80utRd1uSoICnil6g2V3S04mUZwCQrgOv/9r OPkVtoRdJbm1D/3zeII4l8gtVpAND1BQDRiOC9lHl75CfslTLYeAKZQKlBu85uFED7 YMuIteamVsf6Xnk6neJD0sib4jEB5YIRxzoMSWFcDI90VGj5jE5UvYCohtXDaQFERR kWXtNjPMLHLobC6RVqUBWugnLaWbdO/nN4NkzF0xpXcOVi4q86tD6+lxLjImbauLCJ QhnxxQRZM0pVPRkxH8K6q3yaFxT/a8zTt0p1IIjZeDCHcA3fydCXxbxs7WygckmTYP oG21k7s7C32eg== Date: Sun, 02 Nov 2014 11:07:18 +0100 From: Kaspar Brand MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: [Patch] mod_ssl SSL_CLIENT_CERT_SUBJECTS - access to full client certificate chain References: <070C39DD-61EF-40A8-A6F7-8605EB972AB4@sharp.fm> <5454AC17.7030708@velox.ch> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-1.5 required=8.0 tests=AWL=0.011,BAYES_00=-1.5, NO_RECEIVED=-0.001,NO_RELAYS=-0.001,T_DKIM_INVALID=0.01 autolearn=no autolearn_force=no version=3.4.0 On 01.11.2014 13:41, Graham Leggett wrote: > The trouble with doing that is that it makes life really difficult to > match arbitrary certificate chains - you need to know in advance how > many certs are in each chain, and you need to perform a lot of > messing about to perform a match, and to ensure the subjects are in > the right order. Assuming that mod_ssl exported the subject DNs as SSL_CLIENT_S_DN_0, SSL_CLIENT_S_DN_1 etc., what would be left to the application is assembling them properly (by prepending "name=" and inserting comma separators) to get the string you're looking for. Seems fairly straightforward IMO, and shouldn't be too complex to code in the application. > The use case this solves is that I want to uniquely identify a > certificate and store that identity in an LDAP directory. I'm not in the position of making a judgement about the fitness of the suggested approach to your use case, of course (that's your call), but let me add that an X.509 certificate isn't uniquely identified by the subject DNs of its certification path. Uniqueness of an X.509 certificate is ensured through its (issuer DN, serial number) tuple. Certification paths (and hence the suggested SSL_CLIENT_CERT_SUBJECTS string) may change when cross-certified CAs are added to the mix, see e.g. RFC 4158. > The format chosen is the subjects of the certs encoded as RFC2253, > which are turned into a DN that is in turn RFC2253 encoded again. The > result is therefore still a valid DN, and so can be stored in any DN > formatted field in LDAP. This works nicely with 389ds. I don't dispute that such a string "can be stored in any DN formatted field in LDAP", but consider the use of the "name" RDN (OID 2.5.4.41) fairly nonstandard. X.520 defines "Name" as "the attribute supertype from which string attribute types typically used for naming may be formed" (and "string attribute types" referring to things like commonName, surname etc.). "distinguishedName" (2.5.4.49) would be more appropriate, though it isn't really meant for use as an RDN attribute type (but "an attribute for specifying the name of an object" in an X.500 DIT). > In terms of separating them, simply unpack the outer DN as per > RFC2253, leaving you with the inner subject DNs. In practise you’re > unlikely to want to separate them, instead you want to say “I want to > trust this specific certificate issued by this specific CA”. Back in > time matching the issuer was enough, but as soon as intermediate > certs came along it became significantly more difficult to do. > > (Having said the above I don’t disagree that the _n variables could > be useful, it’s just that they don’t solve the use case I am > facing). My concern with the proposed SSL_CLIENT_CERT_SUBJECTS variable is that it hardcodes a specific use case instead of adding a generic way to retrieve the subject DNs of the complete certification path. The latter is what should be implemented in mod_ssl, while constructing SSL_CLIENT_CERT_SUBJECTS (or similar stuff) should be done in the application, IMO. Kaspar