diff options
Diffstat (limited to 'src/lib/libcrypto/evp/e_cast.c')
| -rw-r--r-- | src/lib/libcrypto/evp/e_cast.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/lib/libcrypto/evp/e_cast.c b/src/lib/libcrypto/evp/e_cast.c index b23dfeef1c..32f86d86af 100644 --- a/src/lib/libcrypto/evp/e_cast.c +++ b/src/lib/libcrypto/evp/e_cast.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: e_cast.c,v 1.8 2022/09/03 19:51:53 jsing Exp $ */ | 1 | /* $OpenBSD: e_cast.c,v 1.9 2022/09/04 13:17:18 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 | * |
| @@ -68,9 +68,6 @@ | |||
| 68 | 68 | ||
| 69 | #include "evp_locl.h" | 69 | #include "evp_locl.h" |
| 70 | 70 | ||
| 71 | static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
| 72 | const unsigned char *iv, int enc); | ||
| 73 | |||
| 74 | typedef struct { | 71 | typedef struct { |
| 75 | CAST_KEY ks; | 72 | CAST_KEY ks; |
| 76 | } EVP_CAST_KEY; | 73 | } EVP_CAST_KEY; |
| @@ -78,6 +75,14 @@ typedef struct { | |||
| 78 | #define data(ctx) ((EVP_CAST_KEY *)(ctx)->cipher_data) | 75 | #define data(ctx) ((EVP_CAST_KEY *)(ctx)->cipher_data) |
| 79 | 76 | ||
| 80 | static int | 77 | static int |
| 78 | cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
| 79 | const unsigned char *iv, int enc) | ||
| 80 | { | ||
| 81 | CAST_set_key(&data(ctx)->ks, EVP_CIPHER_CTX_key_length(ctx), key); | ||
| 82 | return 1; | ||
| 83 | } | ||
| 84 | |||
| 85 | static int | ||
| 81 | cast5_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) | 86 | cast5_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) |
| 82 | { | 87 | { |
| 83 | while (inl >= EVP_MAXCHUNK) { | 88 | while (inl >= EVP_MAXCHUNK) { |
| @@ -237,12 +242,4 @@ EVP_cast5_ecb(void) | |||
| 237 | { | 242 | { |
| 238 | return &cast5_ecb; | 243 | return &cast5_ecb; |
| 239 | } | 244 | } |
| 240 | |||
| 241 | static int | ||
| 242 | cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
| 243 | const unsigned char *iv, int enc) | ||
| 244 | { | ||
| 245 | CAST_set_key(&data(ctx)->ks, EVP_CIPHER_CTX_key_length(ctx), key); | ||
| 246 | return 1; | ||
| 247 | } | ||
| 248 | #endif | 245 | #endif |
