Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161126AbbEONqL (ORCPT ); Fri, 15 May 2015 09:46:11 -0400 Received: from casper.infradead.org ([85.118.1.10]:59129 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161059AbbEONqI (ORCPT ); Fri, 15 May 2015 09:46:08 -0400 Message-ID: <1431697560.4727.4.camel@infradead.org> Subject: Re: [PATCH 0/8] MODSIGN: Use PKCS#7 for module signatures [ver #4] From: David Woodhouse To: David Howells Cc: rusty@rustcorp.com.au, mmarek@suse.cz, mjg59@srcf.ucam.org, keyrings@linux-nfs.org, dmitry.kasatkin@gmail.com, mcgrof@suse.com, linux-kernel@vger.kernel.org, seth.forshee@canonical.com, linux-security-module@vger.kernel.org Date: Fri, 15 May 2015 14:46:00 +0100 In-Reply-To: <20150515123513.16723.96340.stgit@warthog.procyon.org.uk> References: <20150515123513.16723.96340.stgit@warthog.procyon.org.uk> Content-Type: multipart/signed; micalg="sha-1"; protocol="application/x-pkcs7-signature"; boundary="=-bR8SPebpHy6zXebmh6qX" X-Mailer: Evolution 3.16.1 (3.16.1-1.2.git20150428.fc22) Mime-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9601 Lines: 152 --=-bR8SPebpHy6zXebmh6qX Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2015-05-15 at 13:35 +0100, David Howells wrote: > Note that David Woodhouse is looking at making > sign-file work with PKCS#11, so bringing back -s might not be=20 > necessary. I actually already *had* it working with PKCS#11, at=20 http://git.infradead.org/users/dwmw2/modsign-pkcs11.git Then you went and rewrote it in C, so I'm still refactoring it. WIP at=20 http://git.infradead.org/users/dwmw2/modsign-pkcs11-c.git just needs me to add the ENGINE_by_id("pkcs11")... bits to scripts/sign-file.c. I'm also vacillating about whether to allow an external *cert* to be specified separately from the key. Do we... 1. Just require the X.509 DER cert in $(topdir)/signing_key.x509, 2. Automatically extract it from $CONFIG_MODULE_SIG_EXTERNAL_KEY which shall be a file (or PKCS#11 URI) containing *both* key and cert, or 3. Add a separate CONFIG_MODULE_SIG_EXTERNAL_CERT option. I'm probably inclined towards #2. I'll need to script something to automatically extract the key from a PEM file or PKCS#11 and drop it in DER form in $(topdir)/signing_key.x509 where needed. Using basically the same make rules we already *have* for creating a new key+cert on demand anyway. --=20 David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation --=-bR8SPebpHy6zXebmh6qX Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIISjjCCBicw ggUPoAMCAQICAw3vNzANBgkqhkiG9w0BAQUFADCBjDELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0 YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcx ODA2BgNVBAMTL1N0YXJ0Q29tIENsYXNzIDEgUHJpbWFyeSBJbnRlcm1lZGlhdGUgQ2xpZW50IENB MB4XDTE1MDUwNTA5NDM0MVoXDTE2MDUwNTA5NTMzNlowQjEcMBoGA1UEAwwTZHdtdzJAaW5mcmFk ZWFkLm9yZzEiMCAGCSqGSIb3DQEJARYTZHdtdzJAaW5mcmFkZWFkLm9yZzCCASIwDQYJKoZIhvcN AQEBBQADggEPADCCAQoCggEBAMkbm9kPbx1j/X4RVyf/pPKSYwelcco69TvnQQbKM8m8xkWjXJI1 jpJ1jMaGUZGFToINMSZi7lZawUozudWbXSKy1SikENSTJHffsdRAIlsp+hR8vWvjsKUry6sEdqPG doa5RY7+N4WRusWZDYW/RRWE6i9EL9qV86CVPYqw22U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3DQEJEAILMYGXoIGUMIGMMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzE4MDYGA1UEAxMv U3RhcnRDb20gQ2xhc3MgMSBQcmltYXJ5IEludGVybWVkaWF0ZSBDbGllbnQgQ0ECAw3vNzANBgkq hkiG9w0BAQEFAASCAQDILi5BCL7E1XI93uGI7Uz0fc04HdaWsOAeYLgXK+8quGbafNRM3SatG7AC FYKh+osXj+RoOrrVsltwddZhfpjPrQKHKQ6D2t15LlfTOKhDxRo8F82KAqUBdvlK4DCcZsr497Pj TqykjOs8/1gMhcAkMScg11X1eOlmPYOtECef+JTuqh/PAkRVkvkUoydX/H3/RcGcYE4IcVqpbnxW nXmvLnDZbBgruCxvh0U0l8nLf99GnhMn59EE+ksOiCCRksNM+5POa6sNydrbxfpugmDgEqcLz/9h Aa79NDPqJCLgmyK/RaM+3KTR1AlXJT0wAe+zLtlZXQJIJNn7LIGebvWAAAAAAAAA --=-bR8SPebpHy6zXebmh6qX-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/