diff options
Diffstat (limited to 'src/lib/libcrypto/evp/e_bf.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_bf.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/e_bf.c b/src/lib/libcrypto/evp/e_bf.c index 53559b0b65..e74337567b 100644 --- a/src/lib/libcrypto/evp/e_bf.c +++ b/src/lib/libcrypto/evp/e_bf.c | |||
@@ -56,24 +56,32 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_BF | 59 | #ifndef OPENSSL_NO_BF |
60 | #include <stdio.h> | 60 | #include <stdio.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
63 | #include "evp_locl.h" | 63 | #include "evp_locl.h" |
64 | #include <openssl/objects.h> | 64 | #include <openssl/objects.h> |
65 | #include <openssl/blowfish.h> | ||
65 | 66 | ||
66 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 67 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
67 | const unsigned char *iv, int enc); | 68 | const unsigned char *iv, int enc); |
68 | 69 | ||
69 | IMPLEMENT_BLOCK_CIPHER(bf, bf_ks, BF, bf_ks, NID_bf, 8, 16, 8, | 70 | typedef struct |
71 | { | ||
72 | BF_KEY ks; | ||
73 | } EVP_BF_KEY; | ||
74 | |||
75 | #define data(ctx) EVP_C_DATA(EVP_BF_KEY,ctx) | ||
76 | |||
77 | IMPLEMENT_BLOCK_CIPHER(bf, ks, BF, EVP_BF_KEY, NID_bf, 8, 16, 8, 64, | ||
70 | EVP_CIPH_VARIABLE_LENGTH, bf_init_key, NULL, | 78 | EVP_CIPH_VARIABLE_LENGTH, bf_init_key, NULL, |
71 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) | 79 | EVP_CIPHER_set_asn1_iv, EVP_CIPHER_get_asn1_iv, NULL) |
72 | 80 | ||
73 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 81 | static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
74 | const unsigned char *iv, int enc) | 82 | const unsigned char *iv, int enc) |
75 | { | 83 | { |
76 | BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key); | 84 | BF_set_key(&data(ctx)->ks,EVP_CIPHER_CTX_key_length(ctx),key); |
77 | return 1; | 85 | return 1; |
78 | } | 86 | } |
79 | 87 | ||