Modify EVP cipher behaviour in a similar way
[openssl.git] / crypto / evp / bio_enc.c
index d9278fb507c76dc52babd7410bc455a846aa6aed..05f42494583b22aba99ae0d14a25b57047613ba1 100644 (file)
@@ -184,7 +184,7 @@ static int enc_read(BIO *b, char *out, int outl)
                        if (!BIO_should_retry(b->next_bio))
                                {
                                ctx->cont=i;
-                               i=EVP_CipherFinal(&(ctx->cipher),
+                               i=EVP_CipherFinal_ex(&(ctx->cipher),
                                        (unsigned char *)ctx->buf,
                                        &(ctx->buf_len));
                                ctx->ok=i;
@@ -298,7 +298,7 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr)
        case BIO_CTRL_RESET:
                ctx->ok=1;
                ctx->finished=0;
-               EVP_CipherInit(&(ctx->cipher),NULL,NULL,NULL,
+               EVP_CipherInit_ex(&(ctx->cipher),NULL,NULL,NULL,NULL,
                        ctx->cipher.encrypt);
                ret=BIO_ctrl(b->next_bio,cmd,num,ptr);
                break;
@@ -335,7 +335,7 @@ again:
                        {
                        ctx->finished=1;
                        ctx->buf_off=0;
-                       ret=EVP_CipherFinal(&(ctx->cipher),
+                       ret=EVP_CipherFinal_ex(&(ctx->cipher),
                                (unsigned char *)ctx->buf,
                                &(ctx->buf_len));
                        ctx->ok=(int)ret;
@@ -421,7 +421,7 @@ void BIO_set_cipher(BIO *b, const EVP_CIPHER *c, unsigned char *k,
 
        b->init=1;
        ctx=(BIO_ENC_CTX *)b->ptr;
-       EVP_CipherInit(&(ctx->cipher),c,k,i,e);
+       EVP_CipherInit_ex(&(ctx->cipher),c,NULL, k,i,e);
        
        if (b->callback != NULL)
                b->callback(b,BIO_CB_CTRL,(const char *)c,BIO_CTRL_SET,e,1L);