summaryrefslogtreecommitdiff
path: root/sys/crypto
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2015-11-13 12:21:17 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2015-11-13 12:21:17 +0000
commit08a8615cc802753a1344c4505f3264099242cc84 (patch)
tree495853d5a6dcb0d3aac1e9ccd2cdbfccc0591e01 /sys/crypto
parent2b007c251fa9ed6d8277bf4c4b702704f65746ac (diff)
Remove unused non HMAC versions of MD5 and SHA1; ok mpi, deraadt, naddy
Diffstat (limited to 'sys/crypto')
-rw-r--r--sys/crypto/cryptodev.h38
-rw-r--r--sys/crypto/cryptosoft.c31
-rw-r--r--sys/crypto/xform.c18
-rw-r--r--sys/crypto/xform.h4
4 files changed, 21 insertions, 70 deletions
diff --git a/sys/crypto/cryptodev.h b/sys/crypto/cryptodev.h
index 239181fded4..ce2e09817a2 100644
--- a/sys/crypto/cryptodev.h
+++ b/sys/crypto/cryptodev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptodev.h,v 1.64 2015/11/12 16:57:00 mikeb Exp $ */
+/* $OpenBSD: cryptodev.h,v 1.65 2015/11/13 12:21:16 mikeb Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -93,25 +93,23 @@
#define CRYPTO_RIJNDAEL128_CBC 11 /* 128 bit blocksize */
#define CRYPTO_AES_CBC 11 /* 128 bit blocksize -- the same as above */
#define CRYPTO_ARC4 12
-#define CRYPTO_MD5 13
-#define CRYPTO_SHA1 14
-#define CRYPTO_DEFLATE_COMP 15 /* Deflate compression algorithm */
-#define CRYPTO_NULL 16
-#define CRYPTO_LZS_COMP 17 /* LZS compression algorithm */
-#define CRYPTO_SHA2_256_HMAC 18
-#define CRYPTO_SHA2_384_HMAC 19
-#define CRYPTO_SHA2_512_HMAC 20
-#define CRYPTO_AES_CTR 21
-#define CRYPTO_AES_XTS 22
-#define CRYPTO_AES_GCM_16 23
-#define CRYPTO_AES_128_GMAC 24
-#define CRYPTO_AES_192_GMAC 25
-#define CRYPTO_AES_256_GMAC 26
-#define CRYPTO_AES_GMAC 27
-#define CRYPTO_CHACHA20_POLY1305 28
-#define CRYPTO_CHACHA20_POLY1305_MAC 29
-#define CRYPTO_ESN 30 /* Support for Extended Sequence Numbers */
-#define CRYPTO_ALGORITHM_MAX 30 /* Keep updated */
+#define CRYPTO_DEFLATE_COMP 13 /* Deflate compression algorithm */
+#define CRYPTO_NULL 14
+#define CRYPTO_LZS_COMP 15 /* LZS compression algorithm */
+#define CRYPTO_SHA2_256_HMAC 16
+#define CRYPTO_SHA2_384_HMAC 17
+#define CRYPTO_SHA2_512_HMAC 18
+#define CRYPTO_AES_CTR 19
+#define CRYPTO_AES_XTS 20
+#define CRYPTO_AES_GCM_16 21
+#define CRYPTO_AES_128_GMAC 22
+#define CRYPTO_AES_192_GMAC 23
+#define CRYPTO_AES_256_GMAC 24
+#define CRYPTO_AES_GMAC 25
+#define CRYPTO_CHACHA20_POLY1305 26
+#define CRYPTO_CHACHA20_POLY1305_MAC 27
+#define CRYPTO_ESN 28 /* Support for Extended Sequence Numbers */
+#define CRYPTO_ALGORITHM_MAX 28 /* Keep updated */
/* Algorithm flags */
#define CRYPTO_ALG_FLAG_SUPPORTED 0x01 /* Algorithm is supported */
diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c
index 899f5dd0fb2..c5aa57f7992 100644
--- a/sys/crypto/cryptosoft.c
+++ b/sys/crypto/cryptosoft.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptosoft.c,v 1.77 2015/11/12 16:57:00 mikeb Exp $ */
+/* $OpenBSD: cryptosoft.c,v 1.78 2015/11/13 12:21:16 mikeb Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -463,11 +463,6 @@ swcr_authcompute(struct cryptop *crp, struct cryptodesc *crd,
axf->Update(&ctx, aalg, axf->hashsize);
axf->Final(aalg, &ctx);
break;
-
- case CRYPTO_MD5:
- case CRYPTO_SHA1:
- axf->Final(aalg, &ctx);
- break;
}
/* Inject the authentication data */
@@ -900,24 +895,6 @@ swcr_newsession(u_int32_t *sid, struct cryptoini *cri)
(*swd)->sw_axf = axf;
break;
- case CRYPTO_MD5:
- axf = &auth_hash_md5;
- goto auth3common;
-
- case CRYPTO_SHA1:
- axf = &auth_hash_sha1;
- auth3common:
- (*swd)->sw_ictx = malloc(axf->ctxsize, M_CRYPTO_DATA,
- M_NOWAIT);
- if ((*swd)->sw_ictx == NULL) {
- swcr_freesession(i);
- return ENOBUFS;
- }
-
- axf->Init((*swd)->sw_ictx);
- (*swd)->sw_axf = axf;
- break;
-
case CRYPTO_AES_128_GMAC:
axf = &auth_hash_gmac_aes_128;
goto auth4common;
@@ -1028,8 +1005,6 @@ swcr_freesession(u_int64_t tid)
case CRYPTO_AES_192_GMAC:
case CRYPTO_AES_256_GMAC:
case CRYPTO_CHACHA20_POLY1305_MAC:
- case CRYPTO_MD5:
- case CRYPTO_SHA1:
axf = swd->sw_axf;
if (swd->sw_ictx) {
@@ -1118,8 +1093,6 @@ swcr_process(struct cryptop *crp)
case CRYPTO_SHA2_256_HMAC:
case CRYPTO_SHA2_384_HMAC:
case CRYPTO_SHA2_512_HMAC:
- case CRYPTO_MD5:
- case CRYPTO_SHA1:
if ((crp->crp_etype = swcr_authcompute(crp, crd, sw,
crp->crp_buf, type)) != 0)
goto done;
@@ -1179,8 +1152,6 @@ swcr_init(void)
algs[CRYPTO_MD5_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED;
algs[CRYPTO_SHA1_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED;
algs[CRYPTO_RIPEMD160_HMAC] = CRYPTO_ALG_FLAG_SUPPORTED;
- algs[CRYPTO_MD5] = CRYPTO_ALG_FLAG_SUPPORTED;
- algs[CRYPTO_SHA1] = CRYPTO_ALG_FLAG_SUPPORTED;
algs[CRYPTO_RIJNDAEL128_CBC] = CRYPTO_ALG_FLAG_SUPPORTED;
algs[CRYPTO_AES_CTR] = CRYPTO_ALG_FLAG_SUPPORTED;
algs[CRYPTO_AES_XTS] = CRYPTO_ALG_FLAG_SUPPORTED;
diff --git a/sys/crypto/xform.c b/sys/crypto/xform.c
index e9650d2acf6..14aa68bbef9 100644
--- a/sys/crypto/xform.c
+++ b/sys/crypto/xform.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.c,v 1.51 2015/11/07 17:46:49 mikeb Exp $ */
+/* $OpenBSD: xform.c,v 1.52 2015/11/13 12:21:16 mikeb Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr),
@@ -329,22 +329,6 @@ struct auth_hash auth_hash_chacha20_poly1305 = {
Chacha20_Poly1305_Final
};
-struct auth_hash auth_hash_md5 = {
- CRYPTO_MD5, "MD5",
- 0, 16, 16, sizeof(MD5_CTX), 0,
- (void (*) (void *)) MD5Init, NULL, NULL,
- MD5Update_int,
- (void (*) (u_int8_t *, void *)) MD5Final
-};
-
-struct auth_hash auth_hash_sha1 = {
- CRYPTO_SHA1, "SHA1",
- 0, 20, 20, sizeof(SHA1_CTX), 0,
- (void (*)(void *)) SHA1Init, NULL, NULL,
- SHA1Update_int,
- (void (*)(u_int8_t *, void *)) SHA1Final
-};
-
/* Compression instance */
struct comp_algo comp_algo_deflate = {
CRYPTO_DEFLATE_COMP, "Deflate",
diff --git a/sys/crypto/xform.h b/sys/crypto/xform.h
index baa18a07b51..d04839b0ec8 100644
--- a/sys/crypto/xform.h
+++ b/sys/crypto/xform.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xform.h,v 1.25 2015/11/03 01:31:36 mikeb Exp $ */
+/* $OpenBSD: xform.h,v 1.26 2015/11/13 12:21:16 mikeb Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -89,8 +89,6 @@ extern struct enc_xform enc_xform_chacha20_poly1305;
extern struct enc_xform enc_xform_arc4;
extern struct enc_xform enc_xform_null;
-extern struct auth_hash auth_hash_md5;
-extern struct auth_hash auth_hash_sha1;
extern struct auth_hash auth_hash_hmac_md5_96;
extern struct auth_hash auth_hash_hmac_sha1_96;
extern struct auth_hash auth_hash_hmac_ripemd_160_96;