diff options
author | jsing <> | 2022-09-03 20:12:24 +0000 |
---|---|---|
committer | jsing <> | 2022-09-03 20:12:24 +0000 |
commit | bd0c1e8c9f376fe4beec69a2931ce916e2f1e76a (patch) | |
tree | b1cd86c4edb44cbdeaac4a4fffc22955c6f57863 /src/lib | |
parent | e6ddefe813ee122cf52b085578a0a3649bd9f2cd (diff) | |
download | openbsd-bd0c1e8c9f376fe4beec69a2931ce916e2f1e76a.tar.gz openbsd-bd0c1e8c9f376fe4beec69a2931ce916e2f1e76a.tar.bz2 openbsd-bd0c1e8c9f376fe4beec69a2931ce916e2f1e76a.zip |
Remove now unused IMPLEMENT_BLOCK_CIPHER macro.
Also remove various comments noting that it cannot be used for certain
block ciphers (which kinda defeats the purpose of having a generic
implementation in the first place).
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/evp/e_des.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/e_des3.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/e_idea.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/evp_locl.h | 11 |
4 files changed, 4 insertions, 19 deletions
diff --git a/src/lib/libcrypto/evp/e_des.c b/src/lib/libcrypto/evp/e_des.c index ad91720ff1..118e59695f 100644 --- a/src/lib/libcrypto/evp/e_des.c +++ b/src/lib/libcrypto/evp/e_des.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_des.c,v 1.14 2015/10/12 06:05:52 guenther Exp $ */ | 1 | /* $OpenBSD: e_des.c,v 1.15 2022/09/03 20:12:24 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -72,8 +72,6 @@ static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
72 | const unsigned char *iv, int enc); | 72 | const unsigned char *iv, int enc); |
73 | static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); | 73 | static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); |
74 | 74 | ||
75 | /* Because of various casts and different names can't use IMPLEMENT_BLOCK_CIPHER */ | ||
76 | |||
77 | static int | 75 | static int |
78 | des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 76 | des_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
79 | const unsigned char *in, size_t inl) | 77 | const unsigned char *in, size_t inl) |
diff --git a/src/lib/libcrypto/evp/e_des3.c b/src/lib/libcrypto/evp/e_des3.c index 0138839763..cc01c69b5e 100644 --- a/src/lib/libcrypto/evp/e_des3.c +++ b/src/lib/libcrypto/evp/e_des3.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_des3.c,v 1.20 2019/05/14 15:40:44 beck Exp $ */ | 1 | /* $OpenBSD: e_des3.c,v 1.21 2022/09/03 20:12:24 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -85,8 +85,6 @@ typedef struct { | |||
85 | 85 | ||
86 | #define data(ctx) ((DES_EDE_KEY *)(ctx)->cipher_data) | 86 | #define data(ctx) ((DES_EDE_KEY *)(ctx)->cipher_data) |
87 | 87 | ||
88 | /* Because of various casts and different args can't use IMPLEMENT_BLOCK_CIPHER */ | ||
89 | |||
90 | static int | 88 | static int |
91 | des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 89 | des_ede_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
92 | const unsigned char *in, size_t inl) | 90 | const unsigned char *in, size_t inl) |
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c index 454ad4e672..b2240b3043 100644 --- a/src/lib/libcrypto/evp/e_idea.c +++ b/src/lib/libcrypto/evp/e_idea.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_idea.c,v 1.10 2015/09/10 15:56:25 jsing Exp $ */ | 1 | /* $OpenBSD: e_idea.c,v 1.11 2022/09/03 20:12:24 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -85,8 +85,6 @@ idea_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
85 | return 1; | 85 | return 1; |
86 | } | 86 | } |
87 | 87 | ||
88 | /* Can't use IMPLEMENT_BLOCK_CIPHER because idea_ecb_encrypt is different */ | ||
89 | |||
90 | typedef struct { | 88 | typedef struct { |
91 | IDEA_KEY_SCHEDULE ks; | 89 | IDEA_KEY_SCHEDULE ks; |
92 | } EVP_IDEA_KEY; | 90 | } EVP_IDEA_KEY; |
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h index 43e0ac333d..c5ff49d2b2 100644 --- a/src/lib/libcrypto/evp/evp_locl.h +++ b/src/lib/libcrypto/evp/evp_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_locl.h,v 1.23 2022/05/05 08:42:27 tb Exp $ */ | 1 | /* $OpenBSD: evp_locl.h,v 1.24 2022/09/03 20:12:24 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -371,15 +371,6 @@ static const EVP_CIPHER cname##_ecb = {\ | |||
371 | const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } | 371 | const EVP_CIPHER *EVP_##cname##_ecb(void) { return &cname##_ecb; } |
372 | */ | 372 | */ |
373 | 373 | ||
374 | #define IMPLEMENT_BLOCK_CIPHER(cname, ksched, cprefix, kstruct, nid, \ | ||
375 | block_size, key_len, iv_len, cbits, \ | ||
376 | flags, init_key, \ | ||
377 | cleanup, set_asn1, get_asn1, ctrl) \ | ||
378 | BLOCK_CIPHER_all_funcs(cname, cprefix, cbits, kstruct, ksched) \ | ||
379 | BLOCK_CIPHER_defs(cname, kstruct, nid, block_size, key_len, iv_len, \ | ||
380 | cbits, flags, init_key, cleanup, set_asn1, \ | ||
381 | get_asn1, ctrl) | ||
382 | |||
383 | #define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) | 374 | #define EVP_C_DATA(kstruct, ctx) ((kstruct *)(ctx)->cipher_data) |
384 | 375 | ||
385 | #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len) \ | 376 | #define IMPLEMENT_CFBR(cipher,cprefix,kstruct,ksched,keysize,cbits,iv_len) \ |