aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/evp/e_ofb_r2.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-05-27 12:38:43 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-05-27 12:38:43 +0000
commitbe06a9348d83187071270a29aabfe10cc3904f85 (patch)
treebd19112dbfbaa0b19bd83b1a94e85ad6a794fcdb /crypto/evp/e_ofb_r2.c
parent7f0606016cbbec917b1fe094b84b062e87abe7da (diff)
downloadopenssl-be06a9348d83187071270a29aabfe10cc3904f85.tar.gz
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_ofb_r2.c')
-rw-r--r--crypto/evp/e_ofb_r2.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/crypto/evp/e_ofb_r2.c b/crypto/evp/e_ofb_r2.c
index 696d58b0c4..bfbd602616 100644
--- a/crypto/evp/e_ofb_r2.c
+++ b/crypto/evp/e_ofb_r2.c
@@ -63,9 +63,9 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
-static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
+static int rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv,int enc);
-static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+static int rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl);
static EVP_CIPHER r2_ofb_cipher=
{
@@ -87,7 +87,7 @@ EVP_CIPHER *EVP_rc2_ofb(void)
return(&r2_ofb_cipher);
}
-static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
+static int rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
unsigned char *iv, int enc)
{
ctx->num=0;
@@ -98,9 +98,10 @@ static void rc2_ofb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key,
if (key != NULL)
RC2_set_key(&(ctx->c.rc2_ks),EVP_CIPHER_CTX_key_length(ctx),
key,EVP_CIPHER_key_length(ctx->cipher)*8);
+ return 1;
}
-static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+static int rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
unsigned char *in, unsigned int inl)
{
RC2_ofb64_encrypt(
@@ -108,6 +109,7 @@ static void rc2_ofb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
(long)inl, &(ctx->c.rc2_ks),
&(ctx->iv[0]),
&ctx->num);
+ return 1;
}
#endif