From patchwork Tue Jun 11 23:09:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 166496 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2934695ilk; Tue, 11 Jun 2019 16:09:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwNn0wgvVv4IiY4cQW/QL9RJ5v2jxQUW1HQ6iwkZ4SpRO9JHs+aw1r2S9uij/rHPvKZJh+ X-Received: by 2002:a17:902:76c6:: with SMTP id j6mr53474212plt.263.1560294589089; Tue, 11 Jun 2019 16:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560294589; cv=none; d=google.com; s=arc-20160816; b=PKlM96eRhU27BDcGSxIdpPpC6DBXE4NUrbAcH7NlsHeSm3wIhbs/1BIkajK1EMIrBX RgSidmC+WdJZYL78FMgSuq9OzcZMMYOOhGQxZ/LlDkZ98YPAxTCIDKsV2GWbsCmITztC iOkKQxwWtC+jrfZQnXqiQ4NkDcXS+HeKw6qQHHd76OERch4ZxNlZ3eevvM4FuM/GKE1m 8aD4mTBPggJOWZQaVn5NgKT9XXy7izd2nU0WOU3ywjoy9G1whxA/CFTXCta5qhhm6o8h QJLWAPmYTTwEXPvFilCEIB5jXaQKfblRDYn9gofKlg92I2lSBbugA27Yd30gS6cYcZ8T saGQ== 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=CIifZCUue8/4Y/P1zH6Zg7Xsj8MwZXtqrWfo61KVM2k=; b=N8CbsetO+IpyqylCbiWGIrTsQYJ5/exijU0v1IVDCte5If9bq1qOhJWA0T9axRq6Yp ZA+e0hzBamevfCb0iN0ZqQuebKLINqjD97ybBdElDLWTux5Ox0QZhM5zqFFKyB1/XR/W amgYRtmWZJtqijxH0fLHBPACHu2aQxcxPpY2he3tY14iBBuFB6FSS/8gPStx3MzWJ8EM k9AFoIGBngUf2qFPcdfIOiJwsa9Rqq5TCLsTH6HIzub1niy8aGYWk6eR0iPF4uRsas0T Xi+RK4WNB5+vkPn5Q04T/SyAx2oD3HfYurkZaoT2wv9vz45OJ5+095BQSxS1OPRHlik4 wBlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UQekfdeV; 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 h21si13653976pgv.266.2019.06.11.16.09.47; Tue, 11 Jun 2019 16:09:49 -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=UQekfdeV; 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 S2407906AbfFKXJq (ORCPT + 3 others); Tue, 11 Jun 2019 19:09:46 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39232 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404669AbfFKXJq (ORCPT ); Tue, 11 Jun 2019 19:09:46 -0400 Received: by mail-wr1-f66.google.com with SMTP id x4so12151600wrt.6 for ; Tue, 11 Jun 2019 16:09:44 -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=CIifZCUue8/4Y/P1zH6Zg7Xsj8MwZXtqrWfo61KVM2k=; b=UQekfdeVS8lseMx9lOmMJne0plJNxlseJ6ZVLIBdjP+RGSEdPLrAJUYbk6MqcaT87t PsLyY4xtthRgo7BySrzvB8eNnqQSXaFqTt7qnO+LM310gAkELr/i79OyDDe7LT5Uu/zP 0ZU9tPpnrLMYPu1ilAB4OKsj06O0KlHEsEe23k0Q3tU0V3zvtRv53v1PJbu4vW5n5aQt /qgvF1RdOyKdAbgpHzaqRyvEDPdCnqgGPf68lI7VWsnFfQ9Uva2uEtOY11bK116BYYbh Q4g/rKbi+XDy5yS20kiNcuSfhBU2Wxy0UUJysbffsW8brONF4qcR1ktD+nHvgZh7j71x Ge0w== 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=CIifZCUue8/4Y/P1zH6Zg7Xsj8MwZXtqrWfo61KVM2k=; b=bzb+UoIkAxNqfj3ruPCBONvceBqG0mtNYFHZzLxbUXYRB8bQIkWwytMIV/kJGMEOdS 7eSCcGEu/bLLZEYA16WczwsNATaDNInY2oRNBbf07zr6N+o3bHaMfkROAnU/z+tCKS/C J5iAWpEG8l7eCJdehBCGki72ca/ZHcEHyCMHc76a+cn7CMRaEKmdoPEhNz3LU47KO1Kd nCWbUFGDv5J6kUBngW0yvNah8dANjMWwYi2aduUue8qa+f5SLVTAIuGmY634lOh4GBFV P9tGN1AFICtlyLYnqNq1R7RhBRAm87BKU9ZpdhQwR3egAQoX8fAvq9CLypMlviBSweTk wr/A== X-Gm-Message-State: APjAAAV2aFNT9isJb0XZ/J6Yw1IVwZGW4JX1ajCJhsZQdPzpfXaFLIRB Y9L41lmgOms04B0W69P0v2zKkDfv3oKNNnXC X-Received: by 2002:adf:f508:: with SMTP id q8mr23904187wro.299.1560294583919; Tue, 11 Jun 2019 16:09:43 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:24bb:7f31:25fe:43a7]) by smtp.gmail.com with ESMTPSA id g11sm10827813wrq.89.2019.06.11.16.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 16:09:42 -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 v4 0/7] crypto: rc4 cleanup Date: Wed, 12 Jun 2019 01:09:31 +0200 Message-Id: <20190611230938.19265-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 sinve v3: - fix some remaining occurrences where a tfm non-NULL test should be replaced with a fips_enabled test - use kzfree() or memzero_explicit() to clear the arc4 ctx where appropriate - clean up the function naming of the crypto arc4 driver when removing the cipher part - remove .h declaration of a function that is being removed - revert a prior CIFS change that moved a variable from the stack to the heap, which is no longer necessary - remove arc4 softdep from the cifs code 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 | 116 ++------------------ drivers/net/ppp/Kconfig | 3 +- drivers/net/ppp/ppp_mppe.c | 97 +++------------- fs/cifs/Kconfig | 2 +- fs/cifs/cifsencrypt.c | 62 +++-------- fs/cifs/cifsfs.c | 1 - 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 | 4 +- net/mac80211/ieee80211_i.h | 4 +- net/mac80211/key.h | 1 + net/mac80211/main.c | 6 +- net/mac80211/mlme.c | 3 +- net/mac80211/tkip.c | 8 +- net/mac80211/tkip.h | 4 +- net/mac80211/wep.c | 49 ++------- net/mac80211/wep.h | 5 +- net/mac80211/wpa.c | 4 +- net/wireless/Kconfig | 1 + net/wireless/lib80211_crypt_tkip.c | 48 +++----- net/wireless/lib80211_crypt_wep.c | 51 +++------ 26 files changed, 195 insertions(+), 369 deletions(-) create mode 100644 lib/crypto/Makefile create mode 100644 lib/crypto/arc4.c -- 2.20.1