diff options
Diffstat (limited to 'src/lib/libcrypto/evp/e_cbc_bf.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_cbc_bf.c | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/lib/libcrypto/evp/e_cbc_bf.c b/src/lib/libcrypto/evp/e_cbc_bf.c index be605f4a13..9bcba3c516 100644 --- a/src/lib/libcrypto/evp/e_cbc_bf.c +++ b/src/lib/libcrypto/evp/e_cbc_bf.c | |||
@@ -56,23 +56,16 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_BLOWFISH | 59 | #ifndef NO_BF |
60 | |||
61 | #include <stdio.h> | 60 | #include <stdio.h> |
62 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
63 | #include "evp.h" | 62 | #include <openssl/evp.h> |
64 | #include "objects.h" | 63 | #include <openssl/objects.h> |
65 | 64 | ||
66 | #ifndef NOPROTO | ||
67 | static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 65 | static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 66 | unsigned char *iv,int enc); |
69 | static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 67 | static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 68 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void bf_cbc_init_key(); | ||
73 | static void bf_cbc_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER bfish_cbc_cipher= | 69 | static EVP_CIPHER bfish_cbc_cipher= |
77 | { | 70 | { |
78 | NID_bf_cbc, | 71 | NID_bf_cbc, |
@@ -82,20 +75,17 @@ static EVP_CIPHER bfish_cbc_cipher= | |||
82 | NULL, | 75 | NULL, |
83 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ | 76 | sizeof(EVP_CIPHER_CTX)-sizeof((((EVP_CIPHER_CTX *)NULL)->c))+ |
84 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), | 77 | sizeof((((EVP_CIPHER_CTX *)NULL)->c.bf_ks)), |
85 | EVP_CIPHER_get_asn1_iv, | ||
86 | EVP_CIPHER_set_asn1_iv, | 78 | EVP_CIPHER_set_asn1_iv, |
79 | EVP_CIPHER_get_asn1_iv, | ||
87 | }; | 80 | }; |
88 | 81 | ||
89 | EVP_CIPHER *EVP_bf_cbc() | 82 | EVP_CIPHER *EVP_bf_cbc(void) |
90 | { | 83 | { |
91 | return(&bfish_cbc_cipher); | 84 | return(&bfish_cbc_cipher); |
92 | } | 85 | } |
93 | 86 | ||
94 | static void bf_cbc_init_key(ctx,key,iv,enc) | 87 | static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
95 | EVP_CIPHER_CTX *ctx; | 88 | unsigned char *iv, int enc) |
96 | unsigned char *key; | ||
97 | unsigned char *iv; | ||
98 | int enc; | ||
99 | { | 89 | { |
100 | if (iv != NULL) | 90 | if (iv != NULL) |
101 | memcpy(&(ctx->oiv[0]),iv,8); | 91 | memcpy(&(ctx->oiv[0]),iv,8); |
@@ -104,11 +94,8 @@ int enc; | |||
104 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); | 94 | BF_set_key(&(ctx->c.bf_ks),EVP_BLOWFISH_KEY_SIZE,key); |
105 | } | 95 | } |
106 | 96 | ||
107 | static void bf_cbc_cipher(ctx,out,in,inl) | 97 | static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
108 | EVP_CIPHER_CTX *ctx; | 98 | unsigned char *in, unsigned int inl) |
109 | unsigned char *out; | ||
110 | unsigned char *in; | ||
111 | unsigned int inl; | ||
112 | { | 99 | { |
113 | BF_cbc_encrypt( | 100 | BF_cbc_encrypt( |
114 | in,out,(long)inl, | 101 | in,out,(long)inl, |