From patchwork Tue Jun 11 13:47:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 166450 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2387758ilk; Tue, 11 Jun 2019 06:47:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxao1MOMmYd4FxjKAhKvo53fJoyaBvTIWazXqC3fIsS2ktnWC/yFfy1YUztamPHtNnGE7Q8 X-Received: by 2002:a17:902:102c:: with SMTP id b41mr26520222pla.204.1560260878544; Tue, 11 Jun 2019 06:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560260878; cv=none; d=google.com; s=arc-20160816; b=OdQq0AGryELERTC5xg05VkDOrBwMT1QIHOazdi79JRVmXWx1PYMjP10qlnNKkFyyQ+ Gc8E+mw37kSow3DRw3jEV1pzZApxq/F5PL3oEZI8s0OujLUbQ7iVxWMwRrDB5H6Kzj2d eiLEv2jJB/BrDq2OvpjM8DIVS3OFQYwbYvQlVb7YLG3ofnAqFxRjPU8hY8SfiFp1JU4B NCCRFqUTa8tTMXuclMh6CoQde3GDAkvnKdmP2nFOwnzmaFbQtngkLEaxl9eNWuBajh2n tPX1QKqr7p5Ev91OXP+bi5v7cb8GcVE8gLL3CEQjr8z+uhwRfrATNrDzMHTl3kMgn/h8 iPjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SPvq1TSklyvGf3Mu8PrbXdN3TXq8wdRsziixaPTYMwE=; b=BAYrWdvQnPg627XlMN/nd3Nlc13RvMqrA1HCOZqlLP7LLiWkEL3hNRx0d1xS6xR48H nRXiMkvSQ5UxceNRgGIfB52vXwwlNLlvGO++kfVD9zza7oeg33j7ZdCFvenzly3ISE9k E25iaYdTFMnAq0AbfNYP9pVLqfMwGu6bRSeWk3PW3DIvlMnn1uNvNjfdh1WwPZCZkQmX o43Qw1L8TYfNbW/+7wpQVROg2wrlfRFOV2xZrrbf3DFmy6+5GfwNiTvc9xlIyBdvzYoI kjOSHNk+BMZkow8nrgIWF9bIqXJiGl9cFLkoaamIZlqu4sPFCydNsS+BhpHMz4+1ggWG jpUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuAM88dN; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w127si14336788pfw.200.2019.06.11.06.47.58; Tue, 11 Jun 2019 06:47:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MuAM88dN; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389251AbfFKNr5 (ORCPT + 3 others); Tue, 11 Jun 2019 09:47:57 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53828 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388299AbfFKNr5 (ORCPT ); Tue, 11 Jun 2019 09:47:57 -0400 Received: by mail-wm1-f68.google.com with SMTP id x15so3041805wmj.3 for ; Tue, 11 Jun 2019 06:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SPvq1TSklyvGf3Mu8PrbXdN3TXq8wdRsziixaPTYMwE=; b=MuAM88dNq8yvZonActjV5w2mTXFiruMmu7kwM8C7MXTERQS6rHBcEeyCzHQN8RUi6g i/Wo1/xkL2bK7mB6Vhlcbqt3KrGWx1FtG8oZoNH7gv1VuL4JMqiBmtCvEAgStByzfpXx G465wKK2wFE8G4HYYkEq37GPfiyEV+KxvQwuO4f1HG/n+gQWTODyEY1osQ5lsr7KvxWd fB3qOf5fkWtr5t0tDU2OFXOGPnJPfphTwDtjNSdxelfYIZHmNrIGZinxJWs/Btx0uoe5 ltP7tvtTZsqSycT8sVqxfoMjpmcI3ZGj+3ofE1qTxSMOTY00O7K1Z5LIWdNuc9324Q5J 2fGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SPvq1TSklyvGf3Mu8PrbXdN3TXq8wdRsziixaPTYMwE=; b=Ors3eWOPw3z8rc/IylTr2eQjWqedM4f1nbYZc4Oxkue67jn5OLJMcfP/u4juLMBxiL BylFg5efdbNZWxXqVJUdj6nK79aqZ2bnkl9DX+SWTzuvMRIHNql3xZYloLub4z8BeGW/ aoUwlMh6dzW6R74fcPWoCDPDt9vvAehmuNJtI/lnFi9jq+1AMiOpG8tEe0fDVMZ8WhfW gNww4YWsxdnZ0h5MxTWVEfcvMvNdkOsB+hR4uWA9L+6SwJ3qXqPAlsE8IzkN4QM4t/XZ GVkOnuyf9M6H6V6WSu9CurnffJM8n8wzcRRjku0plBunMM7QAR0juBzoVnIbE9eLGZvC zU6g== X-Gm-Message-State: APjAAAXWPtROnBQHsz+9A++a4IXzP9JJP6Aa/OdF9I6gNscuLfWAdtGq OIy5rNAcPN1KOlK+uepd+CDpnqxPX/lsN8l4 X-Received: by 2002:a1c:3b02:: with SMTP id i2mr16758612wma.23.1560260874369; Tue, 11 Jun 2019 06:47:54 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:24bb:7f31:25fe:43a7]) by smtp.gmail.com with ESMTPSA id o126sm3964305wmo.31.2019.06.11.06.47.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 06:47:53 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: Ard Biesheuvel , Herbert Xu , "David S. Miller" , Eric Biggers , Johannes Berg Subject: [PATCH v3 0/7] crypto: rc4 cleanup Date: Tue, 11 Jun 2019 15:47:43 +0200 Message-Id: <20190611134750.2974-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This is a follow-up to, and supersedes [0], which moved some WEP code from the cipher to the skcipher interface, in order to reduce the use of the bare cipher interface in non-crypto subsystem code. Since using the skcipher interface to invoke the generic C implementation of an algorithm that is known at compile time is rather pointless, this series moves those users to a new arc4 library interface instead, which is based on the existing code. Along the way, the arc4 cipher implementation is removed entirely, and only the ecb(arc4) code is preserved, which is used in a number of places in the kernel, and is known to be used by at least 'iwd' from user space via the algif_skcipher API. Changes since v2: - drop the crypto_ prefix from the arc4 library functions and types - rename the source file to arc4.c but keep the lib prefix for the actual module to prevent a clash with the crypto API driver - preserve the existing behavior wrt the fips_enabled flag, which prevents any use of ARC4 (note that the fips_enabled flag evaluates to 'false' at compile time for kernels that lack the feature, so with these patches, we get rid of most of the runtime logic regarding FIPS for builds that don't have it enabled) [0] https://lore.kernel.org/linux-crypto/20190607144944.13485-1-ard.biesheuvel@linaro.org/ Cc: Herbert Xu Cc: "David S. Miller" Cc: Eric Biggers Cc: Johannes Berg Ard Biesheuvel (7): crypto: arc4 - refactor arc4 core code into separate library net/mac80211: move WEP handling to ARC4 library interface net/lib80211: move WEP handling to ARC4 library code net/lib80211: move TKIP handling to ARC4 library code crypto: arc4 - remove cipher implementation ppp: mppe: switch to RC4 library interface fs: cifs: switch to RC4 library interface MAINTAINERS | 1 + crypto/Kconfig | 4 + crypto/arc4.c | 104 +------------------- drivers/net/ppp/Kconfig | 3 +- drivers/net/ppp/ppp_mppe.c | 95 +++--------------- fs/cifs/Kconfig | 2 +- fs/cifs/cifsencrypt.c | 53 +++------- include/crypto/arc4.h | 10 ++ lib/Makefile | 2 +- lib/crypto/Makefile | 4 + lib/crypto/arc4.c | 72 ++++++++++++++ net/mac80211/Kconfig | 2 +- net/mac80211/cfg.c | 3 - net/mac80211/ieee80211_i.h | 4 +- net/mac80211/key.h | 1 + net/mac80211/main.c | 6 +- net/mac80211/mlme.c | 2 - net/mac80211/tkip.c | 8 +- net/mac80211/tkip.h | 4 +- net/mac80211/wep.c | 47 ++------- net/mac80211/wep.h | 4 +- net/mac80211/wpa.c | 4 +- net/wireless/Kconfig | 1 + net/wireless/lib80211_crypt_tkip.c | 46 +++------ net/wireless/lib80211_crypt_wep.c | 49 +++------ 25 files changed, 179 insertions(+), 352 deletions(-) create mode 100644 lib/crypto/Makefile create mode 100644 lib/crypto/arc4.c -- 2.20.1