From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0043AC5519F for ; Thu, 12 Nov 2020 16:54:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 894AA206FA for ; Thu, 12 Nov 2020 16:54:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GsapZQbL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728770AbgKLQyR (ORCPT ); Thu, 12 Nov 2020 11:54:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28006 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727739AbgKLQyR (ORCPT ); Thu, 12 Nov 2020 11:54:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605200054; 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: in-reply-to:in-reply-to:references:references; bh=HGrk85a0VZVfDIo9MNpIfHt62UYe1QlF3HTUKbfYRUc=; b=GsapZQbL8DVm/n5mMrRMSm11HLSKYL2+OHEB5eI0QdhW9i2a5mFpArmN8fFQw7GikGPCcm iQZDtzhrp946POy5pZprJ/UmW7PVgYrL5su/xAt7dnVEpayjTinvvvo6m6qSLWo3iLAP1V RJHoW7srkbhl5Sgsq1hRAnzE20IikEw= 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-359-Qnmvm0OEMaqqpFKUqCkxbg-1; Thu, 12 Nov 2020 11:54:11 -0500 X-MC-Unique: Qnmvm0OEMaqqpFKUqCkxbg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77D7A6D254; Thu, 12 Nov 2020 16:54:09 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-115-47.rdu2.redhat.com [10.10.115.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id D55EB5D993; Thu, 12 Nov 2020 16:54:06 +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 In-Reply-To: <22138FE2-9E79-4E24-99FC-74A35651B0C1@oracle.com> References: <22138FE2-9E79-4E24-99FC-74A35651B0C1@oracle.com> <2F96670A-58DC-43A6-A20E-696803F0BFBA@oracle.com> <160518586534.2277919.14475638653680231924.stgit@warthog.procyon.org.uk> <2380561.1605195776@warthog.procyon.org.uk> To: Chuck Lever Cc: dhowells@redhat.com, CIFS , Linux NFS Mailing List , Herbert Xu , "open list:NETWORKING [GENERAL]" , open list , Trond Myklebust , Bruce Fields , linux-crypto@vger.kernel.org, linux-fsdevel , linux-afs@lists.infradead.org Subject: Re: [RFC][PATCH 00/18] crypto: Add generic Kerberos library MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2422486.1605200046.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Thu, 12 Nov 2020 16:54:06 +0000 Message-ID: <2422487.1605200046@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Chuck Lever wrote: > Really? My understanding of the Linux kernel SUNRPC implementation is > that it uses asynchronous, even for small data items. Maybe I'm using > the terminology incorrectly. Seems to be synchronous, at least in its use of skcipher: grep -e skcipher * gss_krb5_crypto.c:#include gss_krb5_crypto.c: struct crypto_sync_skcipher *tfm, gss_krb5_crypto.c: if (length % crypto_sync_skcipher_blocksize(tfm) !=3D 0= ) gss_krb5_crypto.c: if (crypto_sync_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLO= CKSIZE) { gss_krb5_crypto.c: crypto_sync_skcipher_ivsize(tfm)); gss_krb5_crypto.c: memcpy(local_iv, iv, crypto_sync_skcipher_ivsize(tfm))= ; gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, tfm); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_set_crypt(req, sg, sg, length, local_i= v); gss_krb5_crypto.c: ret =3D crypto_skcipher_encrypt(req); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_crypto.c: struct crypto_sync_skcipher *tfm, gss_krb5_crypto.c: if (length % crypto_sync_skcipher_blocksize(tfm) !=3D 0= ) gss_krb5_crypto.c: if (crypto_sync_skcipher_ivsize(tfm) > GSS_KRB5_MAX_BLO= CKSIZE) { gss_krb5_crypto.c: crypto_sync_skcipher_ivsize(tfm)); gss_krb5_crypto.c: memcpy(local_iv, iv, crypto_sync_skcipher_ivsize(tfm))= ; gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, tfm); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_set_crypt(req, sg, sg, length, local_i= v); gss_krb5_crypto.c: ret =3D crypto_skcipher_decrypt(req); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_crypto.c: struct skcipher_request *req; gss_krb5_crypto.c: struct crypto_sync_skcipher *tfm =3D gss_krb5_crypto.c: crypto_sync_skcipher_reqtfm(desc->req); gss_krb5_crypto.c: fraglen =3D thislen & (crypto_sync_skcipher_blocksize(t= fm) - 1); gss_krb5_crypto.c: skcipher_request_set_crypt(desc->req, desc->infrags, de= sc->outfrags, gss_krb5_crypto.c: ret =3D crypto_skcipher_encrypt(desc->req); gss_krb5_crypto.c:gss_encrypt_xdr_buf(struct crypto_sync_skcipher *tfm, st= ruct xdr_buf *buf, gss_krb5_crypto.c: BUG_ON((buf->len - offset) % crypto_sync_skcipher_block= size(tfm) !=3D 0); gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, tfm); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_crypto.c: struct skcipher_request *req; gss_krb5_crypto.c: struct crypto_sync_skcipher *tfm =3D gss_krb5_crypto.c: crypto_sync_skcipher_reqtfm(desc->req); gss_krb5_crypto.c: fraglen =3D thislen & (crypto_sync_skcipher_blocksize(t= fm) - 1); gss_krb5_crypto.c: skcipher_request_set_crypt(desc->req, desc->frags, desc= ->frags, gss_krb5_crypto.c: ret =3D crypto_skcipher_decrypt(desc->req); gss_krb5_crypto.c:gss_decrypt_xdr_buf(struct crypto_sync_skcipher *tfm, st= ruct xdr_buf *buf, gss_krb5_crypto.c: BUG_ON((buf->len - offset) % crypto_sync_skcipher_block= size(tfm) !=3D 0); gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, tfm); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_crypto.c:gss_krb5_cts_crypt(struct crypto_sync_skcipher *cipher, = struct xdr_buf *buf, gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, cipher); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_set_crypt(req, sg, sg, len, iv); gss_krb5_crypto.c: ret =3D crypto_skcipher_encrypt(req); gss_krb5_crypto.c: ret =3D crypto_skcipher_decrypt(req); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_crypto.c: struct crypto_sync_skcipher *cipher, *aux_cipher; gss_krb5_crypto.c: blocksize =3D crypto_sync_skcipher_blocksize(cipher); gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, aux_cipher); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_crypto.c: struct crypto_sync_skcipher *cipher, *aux_cipher; gss_krb5_crypto.c: blocksize =3D crypto_sync_skcipher_blocksize(cipher); gss_krb5_crypto.c: skcipher_request_set_sync_tfm(req, aux_cipher); gss_krb5_crypto.c: skcipher_request_set_callback(req, 0, NULL, NULL); gss_krb5_crypto.c: skcipher_request_zero(req); gss_krb5_keys.c:#include gss_krb5_keys.c: struct crypto_sync_skcipher *cipher; gss_krb5_keys.c: cipher =3D crypto_alloc_sync_skcipher(gk5e->encrypt_name,= 0, 0); gss_krb5_keys.c: if (crypto_sync_skcipher_setkey(cipher, inkey->data, inke= y->len)) gss_krb5_keys.c: crypto_free_sync_skcipher(cipher); gss_krb5_mech.c:#include gss_krb5_mech.c: struct krb5_ctx *ctx, struct crypto_sync_skcipher **res) gss_krb5_mech.c: *res =3D crypto_alloc_sync_skcipher(ctx->gk5e->encrypt_na= me, 0, 0); gss_krb5_mech.c: if (crypto_sync_skcipher_setkey(*res, key.data, key.len))= { gss_krb5_mech.c: crypto_free_sync_skcipher(*res); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->seq); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->enc); gss_krb5_mech.c:static struct crypto_sync_skcipher * gss_krb5_mech.c: struct crypto_sync_skcipher *cp; gss_krb5_mech.c: cp =3D crypto_alloc_sync_skcipher(cname, 0, 0); gss_krb5_mech.c: if (crypto_sync_skcipher_setkey(cp, key, ctx->gk5e->keyle= ngth)) { gss_krb5_mech.c: crypto_free_sync_skcipher(cp); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->enc); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->seq); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->initiator_enc_aux); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->acceptor_enc); gss_krb5_mech.c: crypto_free_sync_skcipher(ctx->initiator_enc); gss_krb5_mech.c: crypto_free_sync_skcipher(kctx->seq); gss_krb5_mech.c: crypto_free_sync_skcipher(kctx->enc); gss_krb5_mech.c: crypto_free_sync_skcipher(kctx->acceptor_enc); gss_krb5_mech.c: crypto_free_sync_skcipher(kctx->initiator_enc); gss_krb5_mech.c: crypto_free_sync_skcipher(kctx->acceptor_enc_aux); gss_krb5_mech.c: crypto_free_sync_skcipher(kctx->initiator_enc_aux); gss_krb5_seqnum.c:#include gss_krb5_seqnum.c: struct crypto_sync_skcipher *key, gss_krb5_seqnum.c: struct crypto_sync_skcipher *key =3D kctx->seq; gss_krb5_wrap.c:#include gss_krb5_wrap.c: blocksize =3D crypto_sync_skcipher_blocksize(kctx->enc); gss_krb5_wrap.c: blocksize =3D crypto_sync_skcipher_blocksize(kctx->enc); David