diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2015-12-10 21:00:52 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2015-12-10 21:00:52 +0000 |
commit | f8196c9053a4bd0674a35ba5b08854493ca2cc30 (patch) | |
tree | f9aab4c851c9ac42d4bd79eb7fdc60a3d928ef10 /sys/dev | |
parent | 7bb5519d01a9350a84b9452629d43758cd3c1028 (diff) |
Remove plain DES from the kernel crypto framework, including the crypto
accelerator drivers. No longer used by anything. ok sthen@ mikeb@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/hifn7751.c | 18 | ||||
-rw-r--r-- | sys/dev/pci/safe.c | 25 | ||||
-rw-r--r-- | sys/dev/pci/ubsec.c | 19 |
3 files changed, 15 insertions, 47 deletions
diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 45a163c9181..e3331572720 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.173 2015/11/13 15:29:55 naddy Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.174 2015/12/10 21:00:51 naddy Exp $ */ /* * Invertex AEON / Hifn 7751 driver @@ -295,7 +295,6 @@ hifn_attach(struct device *parent, struct device *self, void *aux) case HIFN_PUSTAT_ENA_1: algs[CRYPTO_MD5_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; algs[CRYPTO_SHA1_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; - algs[CRYPTO_DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; } if (sc->sc_flags & HIFN_HAS_AES) algs[CRYPTO_AES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; @@ -1866,7 +1865,6 @@ hifn_newsession(u_int32_t *sidp, struct cryptoini *cri) return (EINVAL); mac = 1; break; - case CRYPTO_DES_CBC: case CRYPTO_3DES_CBC: case CRYPTO_AES_CBC: if (cry) @@ -1983,8 +1981,7 @@ hifn_process(struct cryptop *crp) crd1->crd_alg == CRYPTO_SHA1_HMAC) { maccrd = crd1; enccrd = NULL; - } else if (crd1->crd_alg == CRYPTO_DES_CBC || - crd1->crd_alg == CRYPTO_3DES_CBC || + } else if (crd1->crd_alg == CRYPTO_3DES_CBC || crd1->crd_alg == CRYPTO_AES_CBC) { if ((crd1->crd_flags & CRD_F_ENCRYPT) == 0) cmd->base_masks |= HIFN_BASE_CMD_DECODE; @@ -1999,15 +1996,13 @@ hifn_process(struct cryptop *crp) } else { if ((crd1->crd_alg == CRYPTO_MD5_HMAC || crd1->crd_alg == CRYPTO_SHA1_HMAC) && - (crd2->crd_alg == CRYPTO_DES_CBC || - crd2->crd_alg == CRYPTO_3DES_CBC || + (crd2->crd_alg == CRYPTO_3DES_CBC || crd2->crd_alg == CRYPTO_AES_CBC) && ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) { cmd->base_masks = HIFN_BASE_CMD_DECODE; maccrd = crd1; enccrd = crd2; - } else if ((crd1->crd_alg == CRYPTO_DES_CBC || - crd1->crd_alg == CRYPTO_3DES_CBC || + } else if ((crd1->crd_alg == CRYPTO_3DES_CBC || crd1->crd_alg == CRYPTO_AES_CBC) && (crd2->crd_alg == CRYPTO_MD5_HMAC || crd2->crd_alg == CRYPTO_SHA1_HMAC) && @@ -2027,11 +2022,6 @@ hifn_process(struct cryptop *crp) cmd->enccrd = enccrd; cmd->base_masks |= HIFN_BASE_CMD_CRYPT; switch (enccrd->crd_alg) { - case CRYPTO_DES_CBC: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES | - HIFN_CRYPT_CMD_MODE_CBC | - HIFN_CRYPT_CMD_NEW_IV; - break; case CRYPTO_3DES_CBC: cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_3DES | HIFN_CRYPT_CMD_MODE_CBC | diff --git a/sys/dev/pci/safe.c b/sys/dev/pci/safe.c index 73053f62192..44bf9f0edc9 100644 --- a/sys/dev/pci/safe.c +++ b/sys/dev/pci/safe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safe.c,v 1.40 2015/07/16 16:12:15 mpi Exp $ */ +/* $OpenBSD: safe.c,v 1.41 2015/12/10 21:00:51 naddy Exp $ */ /*- * Copyright (c) 2003 Sam Leffler, Errno Consulting @@ -253,7 +253,6 @@ safe_attach(struct device *parent, struct device *self, void *aux) if (devinfo & SAFE_DEVINFO_DES) { printf(" 3DES"); algs[CRYPTO_3DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; - algs[CRYPTO_DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; } if (devinfo & SAFE_DEVINFO_AES) { printf(" AES"); @@ -377,8 +376,7 @@ safe_process(struct cryptop *crp) maccrd = crd1; enccrd = NULL; cmd0 |= SAFE_SA_CMD0_OP_HASH; - } else if (crd1->crd_alg == CRYPTO_DES_CBC || - crd1->crd_alg == CRYPTO_3DES_CBC || + } else if (crd1->crd_alg == CRYPTO_3DES_CBC || crd1->crd_alg == CRYPTO_AES_CBC) { maccrd = NULL; enccrd = crd1; @@ -391,14 +389,12 @@ safe_process(struct cryptop *crp) } else { if ((crd1->crd_alg == CRYPTO_MD5_HMAC || crd1->crd_alg == CRYPTO_SHA1_HMAC) && - (crd2->crd_alg == CRYPTO_DES_CBC || - crd2->crd_alg == CRYPTO_3DES_CBC || + (crd2->crd_alg == CRYPTO_3DES_CBC || crd2->crd_alg == CRYPTO_AES_CBC) && ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) { maccrd = crd1; enccrd = crd2; - } else if ((crd1->crd_alg == CRYPTO_DES_CBC || - crd1->crd_alg == CRYPTO_3DES_CBC || + } else if ((crd1->crd_alg == CRYPTO_3DES_CBC || crd1->crd_alg == CRYPTO_AES_CBC) && (crd2->crd_alg == CRYPTO_MD5_HMAC || crd2->crd_alg == CRYPTO_SHA1_HMAC) && @@ -414,11 +410,7 @@ safe_process(struct cryptop *crp) } if (enccrd) { - if (enccrd->crd_alg == CRYPTO_DES_CBC) { - cmd0 |= SAFE_SA_CMD0_DES; - cmd1 |= SAFE_SA_CMD1_CBC; - ivsize = 2*sizeof(u_int32_t); - } else if (enccrd->crd_alg == CRYPTO_3DES_CBC) { + if (enccrd->crd_alg == CRYPTO_3DES_CBC) { cmd0 |= SAFE_SA_CMD0_3DES; cmd1 |= SAFE_SA_CMD1_CBC; ivsize = 2*sizeof(u_int32_t); @@ -1279,8 +1271,7 @@ safe_newsession(u_int32_t *sidp, struct cryptoini *cri) if (macini) return (EINVAL); macini = c; - } else if (c->cri_alg == CRYPTO_DES_CBC || - c->cri_alg == CRYPTO_3DES_CBC || + } else if (c->cri_alg == CRYPTO_3DES_CBC || c->cri_alg == CRYPTO_AES_CBC) { if (encini) return (EINVAL); @@ -1292,10 +1283,6 @@ safe_newsession(u_int32_t *sidp, struct cryptoini *cri) return (EINVAL); if (encini) { /* validate key length */ switch (encini->cri_alg) { - case CRYPTO_DES_CBC: - if (encini->cri_klen != 64) - return (EINVAL); - break; case CRYPTO_3DES_CBC: if (encini->cri_klen != 192) return (EINVAL); diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index 9a4d79f42b0..a54257c0623 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsec.c,v 1.160 2014/08/15 15:37:51 mikeb Exp $ */ +/* $OpenBSD: ubsec.c,v 1.161 2015/12/10 21:00:51 naddy Exp $ */ /* * Copyright (c) 2000 Jason L. Wright (jason@thought.net) @@ -267,7 +267,6 @@ ubsec_attach(struct device *parent, struct device *self, void *aux) bzero(algs, sizeof(algs)); algs[CRYPTO_3DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; - algs[CRYPTO_DES_CBC] = CRYPTO_ALG_FLAG_SUPPORTED; algs[CRYPTO_MD5_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; algs[CRYPTO_SHA1_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED; if (sc->sc_flags & UBS_FLAGS_AES) @@ -627,8 +626,7 @@ ubsec_newsession(u_int32_t *sidp, struct cryptoini *cri) if (macini) return (EINVAL); macini = c; - } else if (c->cri_alg == CRYPTO_DES_CBC || - c->cri_alg == CRYPTO_3DES_CBC || + } else if (c->cri_alg == CRYPTO_3DES_CBC || c->cri_alg == CRYPTO_AES_CBC) { if (encini) return (EINVAL); @@ -689,10 +687,6 @@ ubsec_newsession(u_int32_t *sidp, struct cryptoini *cri) if (encini->cri_alg == CRYPTO_AES_CBC) { bcopy(encini->cri_key, ses->ses_key, encini->cri_klen / 8); - } else if (encini->cri_alg == CRYPTO_DES_CBC) { - bcopy(encini->cri_key, &ses->ses_key[0], 8); - bcopy(encini->cri_key, &ses->ses_key[2], 8); - bcopy(encini->cri_key, &ses->ses_key[4], 8); } else bcopy(encini->cri_key, ses->ses_key, 24); @@ -853,8 +847,7 @@ ubsec_process(struct cryptop *crp) crd1->crd_alg == CRYPTO_SHA1_HMAC) { maccrd = crd1; enccrd = NULL; - } else if (crd1->crd_alg == CRYPTO_DES_CBC || - crd1->crd_alg == CRYPTO_3DES_CBC || + } else if (crd1->crd_alg == CRYPTO_3DES_CBC || crd1->crd_alg == CRYPTO_AES_CBC) { maccrd = NULL; enccrd = crd1; @@ -865,14 +858,12 @@ ubsec_process(struct cryptop *crp) } else { if ((crd1->crd_alg == CRYPTO_MD5_HMAC || crd1->crd_alg == CRYPTO_SHA1_HMAC) && - (crd2->crd_alg == CRYPTO_DES_CBC || - crd2->crd_alg == CRYPTO_3DES_CBC || + (crd2->crd_alg == CRYPTO_3DES_CBC || crd2->crd_alg == CRYPTO_AES_CBC) && ((crd2->crd_flags & CRD_F_ENCRYPT) == 0)) { maccrd = crd1; enccrd = crd2; - } else if ((crd1->crd_alg == CRYPTO_DES_CBC || - crd1->crd_alg == CRYPTO_3DES_CBC || + } else if ((crd1->crd_alg == CRYPTO_3DES_CBC || crd1->crd_alg == CRYPTO_AES_CBC) && (crd2->crd_alg == CRYPTO_MD5_HMAC || crd2->crd_alg == CRYPTO_SHA1_HMAC) && |