From be06a9348d83187071270a29aabfe10cc3904f85 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 27 May 2000 12:38:43 +0000 Subject: 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. --- crypto/evp/e_cbc_bf.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crypto/evp/e_cbc_bf.c') diff --git a/crypto/evp/e_cbc_bf.c b/crypto/evp/e_cbc_bf.c index 489e63041d..feda9e7e02 100644 --- a/crypto/evp/e_cbc_bf.c +++ b/crypto/evp/e_cbc_bf.c @@ -62,9 +62,9 @@ #include #include -static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); -static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); static EVP_CIPHER bfish_cbc_cipher= { @@ -86,7 +86,7 @@ EVP_CIPHER *EVP_bf_cbc(void) return(&bfish_cbc_cipher); } -static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv, int enc) { if (iv != NULL) @@ -94,15 +94,17 @@ static void bf_cbc_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, memcpy(&(ctx->iv[0]),&(ctx->oiv[0]),8); if (key != NULL) BF_set_key(&(ctx->c.bf_ks),EVP_CIPHER_CTX_key_length(ctx),key); + return 1; } -static void bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int bf_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl) { BF_cbc_encrypt( in,out,(long)inl, &(ctx->c.bf_ks),&(ctx->iv[0]), ctx->encrypt); + return 1; } #endif -- cgit v1.2.3