diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-05-27 12:38:43 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-05-27 12:38:43 +0000 |
commit | be06a9348d83187071270a29aabfe10cc3904f85 (patch) | |
tree | bd19112dbfbaa0b19bd83b1a94e85ad6a794fcdb /crypto/evp/e_rc4.c | |
parent | 7f0606016cbbec917b1fe094b84b062e87abe7da (diff) |
Second phase of EVP cipher overhaul.
Change functions like EVP_EncryptUpdate() so they now return a
value. These normally have software only implementations
which cannot fail so this was acceptable. However ciphers
can be implemented in hardware and these could return errors.
Diffstat (limited to 'crypto/evp/e_rc4.c')
-rw-r--r-- | crypto/evp/e_rc4.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/evp/e_rc4.c b/crypto/evp/e_rc4.c index 1ac9f70691..bc108f4356 100644 --- a/crypto/evp/e_rc4.c +++ b/crypto/evp/e_rc4.c @@ -63,9 +63,9 @@ #include <openssl/evp.h> #include <openssl/objects.h> -static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); -static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); static EVP_CIPHER r4_cipher= { @@ -107,18 +107,20 @@ EVP_CIPHER *EVP_rc4_40(void) return(&r4_40_cipher); } -static void rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int rc4_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv, int enc) { if (key != NULL) memcpy(&(ctx->c.rc4.key[0]),key,EVP_CIPHER_CTX_key_length(ctx)); RC4_set_key(&(ctx->c.rc4.ks),EVP_CIPHER_CTX_key_length(ctx), ctx->c.rc4.key); + return 1; } -static void rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int rc4_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl) { RC4(&(ctx->c.rc4.ks),inl,in,out); + return 1; } #endif |