summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-10-12 06:05:53 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-10-12 06:05:53 +0000
commit1dc9b848a848f1da56a5a5c6d3a3fe2f08a23a0d (patch)
treee7c3639d85399527f6c4d54f77e9d6916228b166
parentab54d0e29d3b6031f0474cf25e6bf22ca4090509 (diff)
unifdef EVP_CHECK_DES_KEY: Ben Kaduk noticed it has a syntax error; that
error was present in the original 2004 commit, so it hasn't been used in over 11 years, thus exceeding our deprecation requirements by over a decade. OpenSSL has chosen to *fix it*; we'll gladly watch it burn ok jsing@
-rw-r--r--lib/libcrypto/evp/e_des.c7
-rw-r--r--lib/libcrypto/evp/e_des3.c15
2 files changed, 2 insertions, 20 deletions
diff --git a/lib/libcrypto/evp/e_des.c b/lib/libcrypto/evp/e_des.c
index aac6ddf318f..ad91720ff1c 100644
--- a/lib/libcrypto/evp/e_des.c
+++ b/lib/libcrypto/evp/e_des.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_des.c,v 1.13 2014/10/18 17:20:40 jsing Exp $ */
+/* $OpenBSD: e_des.c,v 1.14 2015/10/12 06:05:52 guenther Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -205,12 +205,7 @@ des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
{
DES_cblock *deskey = (DES_cblock *)key;
-#ifdef EVP_CHECK_DES_KEY
- if (DES_set_key_checked(deskey, ctx->cipher_data) != 0)
- return 0;
-#else
DES_set_key_unchecked(deskey, ctx->cipher_data);
-#endif
return 1;
}
diff --git a/lib/libcrypto/evp/e_des3.c b/lib/libcrypto/evp/e_des3.c
index d0793b64368..3cb95a8e22b 100644
--- a/lib/libcrypto/evp/e_des3.c
+++ b/lib/libcrypto/evp/e_des3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: e_des3.c,v 1.18 2014/10/18 17:20:40 jsing Exp $ */
+/* $OpenBSD: e_des3.c,v 1.19 2015/10/12 06:05:52 guenther Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -230,14 +230,8 @@ des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
{
DES_cblock *deskey = (DES_cblock *)key;
-#ifdef EVP_CHECK_DES_KEY
- if (DES_set_key_checked(&deskey[0], &data(ctx)->ks1)
- !! DES_set_key_checked(&deskey[1], &data(ctx)->ks2))
- return 0;
-#else
DES_set_key_unchecked(&deskey[0], &data(ctx)->ks1);
DES_set_key_unchecked(&deskey[1], &data(ctx)->ks2);
-#endif
memcpy(&data(ctx)->ks3, &data(ctx)->ks1,
sizeof(data(ctx)->ks1));
return 1;
@@ -250,16 +244,9 @@ des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
DES_cblock *deskey = (DES_cblock *)key;
-#ifdef EVP_CHECK_DES_KEY
- if (DES_set_key_checked(&deskey[0], &data(ctx)->ks1) ||
- DES_set_key_checked(&deskey[1], &data(ctx)->ks2) ||
- DES_set_key_checked(&deskey[2], &data(ctx)->ks3))
- return 0;
-#else
DES_set_key_unchecked(&deskey[0], &data(ctx)->ks1);
DES_set_key_unchecked(&deskey[1], &data(ctx)->ks2);
DES_set_key_unchecked(&deskey[2], &data(ctx)->ks3);
-#endif
return 1;
}