From patchwork Mon Apr 22 15:04:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 238599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4DE532C010D for ; Tue, 23 Apr 2013 02:00:00 +1000 (EST) Received: from localhost ([::1]:60568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIMs-0005KD-2T for incoming@patchwork.ozlabs.org; Mon, 22 Apr 2013 11:09:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIJ5-0000al-A4 for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUIJ3-0001Z0-9O for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:05:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUIJ2-0001Yl-UG for qemu-devel@nongnu.org; Mon, 22 Apr 2013 11:05:25 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3MF5OKM011841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Apr 2013 11:05:24 -0400 Received: from localhost.localdomain (vpn1-6-224.ams2.redhat.com [10.36.6.224]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r3MF4xGw020026; Mon, 22 Apr 2013 11:05:23 -0400 From: Alon Levy To: qemu-devel@nongnu.org Date: Mon, 22 Apr 2013 18:04:43 +0300 Message-Id: <1366643098-2566-14-git-send-email-alevy@redhat.com> In-Reply-To: <1366643098-2566-1-git-send-email-alevy@redhat.com> References: <1366643098-2566-1-git-send-email-alevy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id r3MF5OKM011841 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: mlureau@redhat.com Subject: [Qemu-devel] [PATCH v3 13/28] libcacard: remove default libcoolkey loading X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Marc-André Lureau Use only the modules defined in the NSS database. --- libcacard/vcard_emul_nss.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c index 6b1ca8a..9ba80fb 100644 --- a/libcacard/vcard_emul_nss.c +++ b/libcacard/vcard_emul_nss.c @@ -870,7 +870,7 @@ VCardEmulError vcard_emul_init(const VCardEmulOptions *options) { SECStatus rv; - PRBool ret, has_readers = PR_FALSE, need_coolkey_module; + PRBool ret, has_readers = PR_FALSE; VReader *vreader; VReaderEmul *vreader_emul; SECMODListLock *module_lock; @@ -983,30 +983,15 @@ vcard_emul_init(const VCardEmulOptions *options) /* make sure we have some PKCS #11 module loaded */ module_lock = SECMOD_GetDefaultModuleListLock(); module_list = SECMOD_GetDefaultModuleList(); - need_coolkey_module = !has_readers; SECMOD_GetReadLock(module_lock); for (mlp = module_list; mlp; mlp = mlp->next) { SECMODModule *module = mlp->module; if (module_has_removable_hw_slots(module)) { - need_coolkey_module = PR_FALSE; break; } } SECMOD_ReleaseReadLock(module_lock); - if (need_coolkey_module) { - SECMODModule *module; - module = SECMOD_LoadUserModule( - (char *)"library=libcoolkeypk11.so name=Coolkey", - NULL, PR_FALSE); - if (module == NULL) { - return VCARD_EMUL_FAIL; - } - SECMOD_DestroyModule(module); /* free our reference, Module will still - * be on the list. - * until we destroy it */ - } - /* now examine all the slots, finding which should be readers */ /* We should control this with options. For now we mirror out any * removable hardware slot */