diff options
Diffstat (limited to 'src/lib/libcrypto/evp/e_rc4.c')
-rw-r--r-- | src/lib/libcrypto/evp/e_rc4.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c index 7e9790a94c..c7e58a75cc 100644 --- a/src/lib/libcrypto/evp/e_rc4.c +++ b/src/lib/libcrypto/evp/e_rc4.c | |||
@@ -60,19 +60,13 @@ | |||
60 | 60 | ||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include "cryptlib.h" | 62 | #include "cryptlib.h" |
63 | #include "evp.h" | 63 | #include <openssl/evp.h> |
64 | #include "objects.h" | 64 | #include <openssl/objects.h> |
65 | 65 | ||
66 | #ifndef NOPROTO | ||
67 | static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, | 66 | static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
68 | unsigned char *iv,int enc); | 67 | unsigned char *iv,int enc); |
69 | static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
70 | unsigned char *in, unsigned int inl); | 69 | unsigned char *in, unsigned int inl); |
71 | #else | ||
72 | static void rc4_init_key(); | ||
73 | static void rc4_cipher(); | ||
74 | #endif | ||
75 | |||
76 | static EVP_CIPHER r4_cipher= | 70 | static EVP_CIPHER r4_cipher= |
77 | { | 71 | { |
78 | NID_rc4, | 72 | NID_rc4, |
@@ -94,21 +88,18 @@ static EVP_CIPHER r4_40_cipher= | |||
94 | rc4_cipher, | 88 | rc4_cipher, |
95 | }; | 89 | }; |
96 | 90 | ||
97 | EVP_CIPHER *EVP_rc4() | 91 | EVP_CIPHER *EVP_rc4(void) |
98 | { | 92 | { |
99 | return(&r4_cipher); | 93 | return(&r4_cipher); |
100 | } | 94 | } |
101 | 95 | ||
102 | EVP_CIPHER *EVP_rc4_40() | 96 | EVP_CIPHER *EVP_rc4_40(void) |
103 | { | 97 | { |
104 | return(&r4_40_cipher); | 98 | return(&r4_40_cipher); |
105 | } | 99 | } |
106 | 100 | ||
107 | static void rc4_init_key(ctx,key,iv,enc) | 101 | static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, |
108 | EVP_CIPHER_CTX *ctx; | 102 | unsigned char *iv, int enc) |
109 | unsigned char *key; | ||
110 | unsigned char *iv; | ||
111 | int enc; | ||
112 | { | 103 | { |
113 | if (key != NULL) | 104 | if (key != NULL) |
114 | memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); | 105 | memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); |
@@ -116,11 +107,8 @@ int enc; | |||
116 | ctx->c.rc4.key); | 107 | ctx->c.rc4.key); |
117 | } | 108 | } |
118 | 109 | ||
119 | static void rc4_cipher(ctx,out,in,inl) | 110 | static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
120 | EVP_CIPHER_CTX *ctx; | 111 | unsigned char *in, unsigned int inl) |
121 | unsigned char *out; | ||
122 | unsigned char *in; | ||
123 | unsigned int inl; | ||
124 | { | 112 | { |
125 | RC4(&(ctx->c.rc4.ks),inl,in,out); | 113 | RC4(&(ctx->c.rc4.ks),inl,in,out); |
126 | } | 114 | } |