Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754139AbbKXLAQ (ORCPT ); Tue, 24 Nov 2015 06:00:16 -0500 Received: from mail.eperm.de ([89.247.134.16]:34558 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753009AbbKXLAN (ORCPT ); Tue, 24 Nov 2015 06:00:13 -0500 From: Stephan Mueller To: Herbert Xu Cc: Tom Herbert , netdev@vger.kernel.org, davem@davemloft.net, Sowmini Varadhan , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [RFC PATCH 2/2] Crypto kernel tls socket Date: Tue, 24 Nov 2015 12:00:06 +0100 Message-ID: <9662204.R2y95MbYda@tauon.atsec.com> User-Agent: KMail/4.14.9 (Linux/4.2.5-201.fc22.x86_64; KDE/4.14.13; x86_64; ; ) In-Reply-To: <20151124103455.GB623@gondor.apana.org.au> References: <20151124103455.GB623@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2027 Lines: 44 Am Dienstag, 24. November 2015, 18:34:55 schrieb Herbert Xu: Hi Herbert, >On Mon, Nov 23, 2015 at 09:43:02AM -0800, Dave Watson wrote: >> Userspace crypto interface for TLS. Currently supports gcm(aes) 128bit >> only, however the interface is the same as the rest of the SOCK_ALG >> interface, so it should be possible to add more without any user interface >> changes. > >SOCK_ALG exists to export crypto algorithms to user-space. So if >we decided to support TLS as an algorithm then I guess this makes >sense. > >However, I must say that it wouldn't have been my first pick. I'd >imagine a TLS socket to look more like a TCP socket, or perhaps a >KCM socket as proposed by Tom. If I may ask: what is the benefit of having TLS in kernel space? I do not see any reason why higher-level protocols should be in the kernel as they do not relate to accessing hardware. The only reason I could fathom is to keep the negotiated keys in a secure realm. But that could be done without having parts or the whole TLS protocol stack in the kernel. If the key management should stay in the kernel as a protection domain, I would rather think that the kernel should offer a plug- and-play of raw ciphers where user space is responsible to form a protocol. This way, we do not limit such key management to TLS, but allow any kind of protocol to use it. E.g. the kernel performs the key transport with RSA or key agreement with DH using keyring-based key material. The resulting shared secret is again maintained in the key ring where user space can use the symmetric ciphers of the kernel with those keys. User space would only see references to keys but no real keys. However, only user space knows when to invoke what cipher to implement a specific protocol. Ciao Stephan -- 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/