From: guenther Date: Mon, 12 Oct 2015 06:05:52 +0000 (+0000) Subject: unifdef EVP_CHECK_DES_KEY: Ben Kaduk noticed it has a syntax error; that X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7c00aea4caddac609e2614f1d963d7c55e83734e;p=openbsd 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@ --- 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; } diff --git a/lib/libssl/src/crypto/evp/e_des.c b/lib/libssl/src/crypto/evp/e_des.c index aac6ddf318f..ad91720ff1c 100644 --- a/lib/libssl/src/crypto/evp/e_des.c +++ b/lib/libssl/src/crypto/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/libssl/src/crypto/evp/e_des3.c b/lib/libssl/src/crypto/evp/e_des3.c index d0793b64368..3cb95a8e22b 100644 --- a/lib/libssl/src/crypto/evp/e_des3.c +++ b/lib/libssl/src/crypto/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; }