Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1351741pxu; Fri, 16 Oct 2020 09:48:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNF6tWB+uxssbMNMoNXiPWKysnUOe+nQ+RyuADui+0ebWkQyi0SQg8tlKwgGGNwebzOvGA X-Received: by 2002:a17:906:b2d1:: with SMTP id cf17mr4668614ejb.321.1602866939660; Fri, 16 Oct 2020 09:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602866939; cv=none; d=google.com; s=arc-20160816; b=RXR8Km3lA181qMjS09fP+8YMITpX3eIrgU7b6yfa+OX90QrTvO8dREh/DTw2Quu2GK DjvoaAViHlyCHjTZioGyvVR1VuxCYWiY+bm/orrOi27kHVPLTJ27oof2seOhUE+w4Exf +KwUDtKJb5/lHXciLL8SrKrahfFAkYCkI+0l7X4lIOfxZYr6U1kxUqPUNNpl7t1+pAD6 PmpxaOpFdJqWOgeM6dOEA6maR0VNNrA22+5bgZORXZ1oFiPRxWVKwPfDxntEn8L1W5/v AthpSrbxVy2sZu74byJJ+e1inwV0jgF39Csjwx2QptIgyKYYtYxPyE8YIUvC4L/d1XYU GjmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:from:organization :dkim-signature; bh=y+hjVI66PfcmwJlWfVwVOTQ6i8qhG0kIQEYwSMKlTRs=; b=sXUbTeQ1eoiSI94a7/8raLk3rdY38YoR4hksHJCftWRBxIOrebE3WDOGAS84sywDwI EMNvipZndWtUBnAiXbjstlcvcPBvTcAO8rzHgS8fmPX8QR0hkt5BjgUVvDTrtJjjLlmN 1jjLmO9qQAo4WGYtSVSPBGXQ99pfXx1XjOKAApRf2ZO6U1xHphoXh1FctegwTi3onkTU cxE+uJiyuwbIh3XVXGN4YkuUNfAWjT+gV/OVuS/+LMOoqs/3Pg9PViBnQHGuvI2GjDSC kGKmlz20K3IpS6kDyF0Y12dJrykjKFlNb7C5j592Vvqht7EQRV2d0Ql7/Z3hRl+wkYnR NwFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RUybtcal; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e28si1918024edj.180.2020.10.16.09.48.22; Fri, 16 Oct 2020 09:48:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RUybtcal; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410012AbgJPQSg (ORCPT + 99 others); Fri, 16 Oct 2020 12:18:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33999 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409976AbgJPQSe (ORCPT ); Fri, 16 Oct 2020 12:18:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602865112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y+hjVI66PfcmwJlWfVwVOTQ6i8qhG0kIQEYwSMKlTRs=; b=RUybtcalXrFLkWeOefy5DSLyiNHq1BHsVjrO0yS5ApXru0ad+NAOd5m0P/fyoc4S+2bTSI ebe0K64cJYo4iKUjXz3bxQamD+BdgZ+Df86MotfPf1lJolYjsmMdTtKr6Dp/ZwrT8nY4dz tpJBc5dHSeYoPGhccXwnfnwAp5UgQWM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-hJhe2FRRP26PUE3ZREH50Q-1; Fri, 16 Oct 2020 12:18:31 -0400 X-MC-Unique: hJhe2FRRP26PUE3ZREH50Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7400A80365F; Fri, 16 Oct 2020 16:18:29 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-70.rdu2.redhat.com [10.10.120.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A5CB60C04; Fri, 16 Oct 2020 16:18:26 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: herbert@gondor.apana.org.au, davem@davemloft.net, trond.myklebust@hammerspace.com cc: dhowells@redhat.com, linux-crypto@vger.kernel.org, linux-nfs@vger.kernel.org, linux-afs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: gssapi, crypto and afs/rxrpc MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1444463.1602865106.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Oct 2020 17:18:26 +0100 Message-ID: <1444464.1602865106@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Herbert, Dave, Trond, I've written basic gssapi-derived security support for AF_RXRPC: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log= /?h=3Drxrpc-rxgk I've borrowed some bits from net/sunrpc/auth_gss/ but there's a lot in the= re that is quite specific to the sunrpc module that makes it hard to use for rxrpc (dprintk, struct xdr_buf). Further, I've implemented some more enctypes that aren't supported yet by gssapi (AES with sha256/sha384 and Camellia), and that requires some chang= es to the handling as AES with sha384 has a 24-byte checksum size and a 24-by= te calculated key size for Kc and Ki but a 32-byte Ke. Should I pull the core out and try to make it common? If so, should I mov= e it to crypto/ or lib/, or perhaps put it in net/gssapi/? There are two components to it: (1) Key derivation steps. My thought is to use xdr_netobj or something similar for to communica= te between the steps (though I'd prefer to change .data to be a void* ra= ther than u8*). (2) Encryption/checksumming. My thought is to make this interface use scattergather lists[*] since that's what the crypto encryption API requires (though not the hash A= PI). If I do this, should I create a "kerberos" crypto API for the data wrappin= g functions? I'm not sure that it quite matches the existing APIs because t= he size of the input data will likely not match the size of the output data a= nd it's "one shot" as it needs to deal with a checksum. Or I can just keep my implementation separate inside net/rxrpc/. David [*] That said, I'm not exactly sure how the sunrpc stuff works, so this mi= ght not work for that.