aboutsummaryrefslogtreecommitdiff
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-05-11 21:17:08 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-05-11 21:17:08 +0000
commit33fb013e16d81153e1e957b292ba465e6f5a6d6d (patch)
tree2c1d499021701020e4b433459d6b360b69c674c8 /sys/opencrypto
parent3a0b6a93a7002e7c8d1c7a86bae2d933834c3357 (diff)
downloadsrc-33fb013e16d81153e1e957b292ba465e6f5a6d6d.tar.gz
src-33fb013e16d81153e1e957b292ba465e6f5a6d6d.zip
Remove support for the ARC4 algorithm from OCF.
There are no longer any in-kernel consumers. The software implementation was also a non-functional stub. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24771
Notes
Notes: svn path=/head/; revision=360928
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/crypto.c13
-rw-r--r--sys/opencrypto/cryptodev.h4
-rw-r--r--sys/opencrypto/xform.c12
-rw-r--r--sys/opencrypto/xform_enc.h1
4 files changed, 4 insertions, 26 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index 1f064a64426d..a5b735238943 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -687,7 +687,6 @@ static enum alg_type {
[CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST,
[CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST,
[CRYPTO_AES_CBC] = ALG_CIPHER,
- [CRYPTO_ARC4] = ALG_CIPHER,
[CRYPTO_SHA1] = ALG_DIGEST,
[CRYPTO_NULL_HMAC] = ALG_DIGEST,
[CRYPTO_NULL_CBC] = ALG_CIPHER,
@@ -793,10 +792,8 @@ check_csp(const struct crypto_session_params *csp)
if (csp->csp_cipher_alg != CRYPTO_NULL_CBC) {
if (csp->csp_cipher_klen == 0)
return (false);
- if (csp->csp_cipher_alg != CRYPTO_ARC4) {
- if (csp->csp_ivlen == 0)
- return (false);
- }
+ if (csp->csp_ivlen == 0)
+ return (false);
}
if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN)
return (false);
@@ -860,10 +857,8 @@ check_csp(const struct crypto_session_params *csp)
if (csp->csp_cipher_alg != CRYPTO_NULL_CBC) {
if (csp->csp_cipher_klen == 0)
return (false);
- if (csp->csp_cipher_alg != CRYPTO_ARC4) {
- if (csp->csp_ivlen == 0)
- return (false);
- }
+ if (csp->csp_ivlen == 0)
+ return (false);
}
if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN)
return (false);
diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h
index 2f1eef20d318..68717e049a49 100644
--- a/sys/opencrypto/cryptodev.h
+++ b/sys/opencrypto/cryptodev.h
@@ -119,14 +119,12 @@
#define RIJNDAEL128_BLOCK_LEN 16
#define AES_BLOCK_LEN 16
#define AES_ICM_BLOCK_LEN 1
-#define ARC4_BLOCK_LEN 1
#define CAMELLIA_BLOCK_LEN 16
#define CHACHA20_NATIVE_BLOCK_LEN 64
#define EALG_MAX_BLOCK_LEN CHACHA20_NATIVE_BLOCK_LEN /* Keep this updated */
/* IV Lengths */
-#define ARC4_IV_LEN 1
#define AES_GCM_IV_LEN 12
#define AES_CCM_IV_LEN 12
#define AES_XTS_IV_LEN 8
@@ -147,8 +145,6 @@
#define AES_MAX_KEY RIJNDAEL_MAX_KEY
#define AES_XTS_MIN_KEY (2 * AES_MIN_KEY)
#define AES_XTS_MAX_KEY (2 * AES_MAX_KEY)
-#define ARC4_MIN_KEY 1
-#define ARC4_MAX_KEY 32
#define CAMELLIA_MIN_KEY 8
#define CAMELLIA_MAX_KEY 32
diff --git a/sys/opencrypto/xform.c b/sys/opencrypto/xform.c
index 513337bc93cc..b2896867d947 100644
--- a/sys/opencrypto/xform.c
+++ b/sys/opencrypto/xform.c
@@ -75,18 +75,6 @@ __FBSDID("$FreeBSD$");
MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers");
-/* Encryption instances */
-struct enc_xform enc_xform_arc4 = {
- CRYPTO_ARC4, "ARC4",
- ARC4_BLOCK_LEN, ARC4_IV_LEN, ARC4_MIN_KEY, ARC4_MAX_KEY,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
-};
-
-
/* Include the encryption algorithms */
#include "xform_null.c"
#include "xform_des1.c"
diff --git a/sys/opencrypto/xform_enc.h b/sys/opencrypto/xform_enc.h
index 5bab5b5edcc4..f324316cc925 100644
--- a/sys/opencrypto/xform_enc.h
+++ b/sys/opencrypto/xform_enc.h
@@ -77,7 +77,6 @@ extern struct enc_xform enc_xform_aes_icm;
extern struct enc_xform enc_xform_aes_nist_gcm;
extern struct enc_xform enc_xform_aes_nist_gmac;
extern struct enc_xform enc_xform_aes_xts;
-extern struct enc_xform enc_xform_arc4;
extern struct enc_xform enc_xform_camellia;
extern struct enc_xform enc_xform_chacha20;
extern struct enc_xform enc_xform_ccm;