From: David Woodhouse Subject: Re: [PATCH v2 0/5] crypto: add algif_akcipher user space API Date: Wed, 28 Oct 2015 08:43:16 +0900 Message-ID: <1445989396.3405.131.camel@infradead.org> References: <1831785.BBs8Hj3CxY@myon.chronox.de> <9859277.cZClo5B21s@tauon.atsec.com> <1445987716.3405.127.camel@infradead.org> <1499937.MpmApGzYrd@tauon.atsec.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="sha-1"; protocol="application/x-pkcs7-signature"; boundary="=-tg30+AAgWjPyDGCCF7+W" Cc: Marcel Holtmann , Herbert Xu , linux-crypto-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Howells To: Stephan Mueller Return-path: In-Reply-To: <1499937.MpmApGzYrd-gNvIQDDl/k7Ia13z/PHSgg@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-crypto.vger.kernel.org --=-tg30+AAgWjPyDGCCF7+W Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2015-10-28 at 00:35 +0100, Stephan Mueller wrote: > Am Mittwoch, 28. Oktober 2015, 08:15:16 schrieb David Woodhouse: >=20 > Hi David, > >=20 > > Absolutely. The interface needs to support *both*. > >=20 > > 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#1= 1 URIs > > referring to keys in hardware as well as filenames. > >=20 > > 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. > >=20 > > 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 > Albeit that all sounds like the crown jewel, how do you propose that shal= l=20 > happen? >=20 > Assume that you have a web server that has a pub and priv key in its curr= ent=20 > configuration -- I guess that is the vast majority of configs. >=20 > Can you please elaborate how the process for such a web server shall real= ly=20 > work? 1. Create a kernel-side key. 2. Use it. That may require adding an API similar to the one you're proposing, but working with kernel keys instead of directly with akcipher. Or perhaps the key subsystem can already offer what you need in userspace. David? --=20 dwmw2 --=-tg30+AAgWjPyDGCCF7+W 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 ggLVMAkGA1U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