From: David Woodhouse Subject: Re: [PATCH v2 0/5] crypto: add algif_akcipher user space API Date: Wed, 28 Oct 2015 08:15:16 +0900 Message-ID: <1445987716.3405.127.camel@infradead.org> References: <1831785.BBs8Hj3CxY@myon.chronox.de> <1979544.kURdYDnObN@tauon.atsec.com> <1445937541.3405.75.camel@infradead.org> <9859277.cZClo5B21s@tauon.atsec.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="sha-1"; protocol="application/x-pkcs7-signature"; boundary="=-Zw8eq4OSDmP9kXNFxcZ0" Cc: Marcel Holtmann , Herbert Xu , linux-crypto@vger.kernel.org, linux-kernel , linux-api@vger.kernel.org, David Howells To: Stephan Mueller Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:44462 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932124AbbJ0XPf (ORCPT ); Tue, 27 Oct 2015 19:15:35 -0400 In-Reply-To: <9859277.cZClo5B21s@tauon.atsec.com> Sender: linux-crypto-owner@vger.kernel.org List-ID: --=-Zw8eq4OSDmP9kXNFxcZ0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-10-27 at 11:50 +0100, Stephan Mueller wrote: >=20 > >expose that critically limited API to userspace. We need to expose an > >API which supports hardware keys, and basically that means using the > >kernel's key subsystem. >=20 > Agreed. But at the same time, that interface should be able to support th= e use=20 > case where the software wants to be in control (just take OpenSSL as the= =20 > simple example where you can add an engine for the Linux kernel backed RS= A=20 > operation). Absolutely. The interface needs to support *both*. I've spent a lot of time chasing through userspace stacks, fixing broken assumptions that we will *always* have the actual key material in a file =E2=80=94 and making libraries and applications accept PKCS#11 UR= Is referring to keys in hardware as well as filenames. I am violently opposed to exposing an API from the kernel which makes that *same* fundamental mistake, and ties its users to using *only* software keys. FROM THE BEGINNING, users of this new API should be able to cope with the fact that they might not *have* the key material, and that they might simply be referring to a key which exists elsewhere. Such as in the TPM, or within an SGX software enclave. --=20 dwmw2 --=-Zw8eq4OSDmP9kXNFxcZ0 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/RRWE6i9EL9qV86CVPYqw22UBOUw4/j/HVGCV6TSB8yE5iEwhk/hUuzRr FZm1MJMR7mCS7BCR8Lr5jFY61lWpBiXNXIxLZCvDc26KR5L5tYX43iUVO3fzES1GRVoYnxxk2tmz fcsZG5vK+Trc9L8OZJfkYrEHH3+Iw41MQ0w/djVtYr1+HYldx0QmYXAtnhIj+UMCAwEAAaOCAtkw ggLVMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcD BDAdBgNVHQ4EFgQUszC96C3w5/2+d+atSr0IpT26YI4wHwYDVR0jBBgwFoA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