X-Scanned-BY: MIMEDefang 2.68 on 10.5.11.23 MIME-Version: 1.0 In-Reply-To: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 References: <543560E8.5070902@redhat.com> Message-ID: <54356872.6040204@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Organization: Red Hat X-RT-Original-Encoding: utf-8 Received: from mx.pao1.isc.org (mx.pao1.isc.org [149.20.64.53]) by bugs.isc.org (Postfix) with ESMTP id 6D5372D2004F for ; Wed, 8 Oct 2014 16:38:15 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.redhat.com", Issuer "DigiCert SHA2 Extended Validation Server CA" (not verified)) by mx.pao1.isc.org (Postfix) with ESMTPS id D6777349314 for ; Wed, 8 Oct 2014 16:38:13 +0000 (UTC) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s98GcClt007242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 8 Oct 2014 12:38:13 -0400 Received: from pspacek.brq.redhat.com (pspacek.brq.redhat.com [10.34.128.7]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s98GcBeW025572 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 8 Oct 2014 12:38:12 -0400 Delivered-To: bind9-bugs@bugs.isc.org Subject: Re: [ISC-Bugs #37410] PKCS#11 PIN length is silently limited to 32 characters [patch] User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 Return-Path: X-Original-To: bind9-bugs@bugs.isc.org Date: Wed, 08 Oct 2014 18:38:10 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org To: bind9-bugs@isc.org Content-Transfer-Encoding: 7bit From: Petr Spacek RT-Message-ID: Content-Length: 1760 On 8.10.2014 18:25, Francis Dupont via RT wrote: > On Wed Oct 08 16:06:09 2014, pspacek@redhat.com wrote: >> It seems that all versions of BIND with native PKCS#11 support are >> limited to >> 32 bytes of PIN length and didn't actually check the PIN length which >> can later cause login failures. > > => yes, the PIN length should be limited to something > reasonable and 32 octets seemed the right value. > In fact the PIN maximum length is a property of the HSM > so I'll dig in the new PKCS#11 v2.40 specs I copied from OASIS > some hours ago to see if there is useful about it in them... > >> First patch adds check for PIN length to prevent too long PINs from >> causing login failures later. > > => IMHO it is a good idea. > >> Second patch extends maximal PIN length to 1023 bytes so it should be >> enough for everyone including me :-) > > => 1023 octets are a very large value for a PIN. BTW > with an enforced low limit of retries a short (4 digits) value > is common, i.e.: > - a PIN is not a password I'm not opposing to that however I do not see a reason to artificially limit PIN length on *client* side. HSM will deal with it if the PIN value is too long for that particular implementation of PKCS#11. IMHO maximum PIN length advertised by HSM for purposes of PIN initialization to let user know what PIN he can enter for that particular HSM. > - no limit at all on retries is a *bad* idea > (explain this to Apple with its cloud :-). In this particular case I'm using SoftHSM so there is no secure way how to enforce limit on retries. That is the reason why I wanted to use very long PIN. I hope it explains my motivation. (And yes, I know that SoftHSM is really cheap HSM :-)) Have a nice day! -- Petr Spacek @ Red Hat