Sebastian Akerman <[EMAIL PROTECTED]>:

> crypt/evp/bio_enc.c: **** static int enc_read(b,out,outl)

>    /* Should be continue next time we are called? */
>    if (!BIO_should_retry(b->next_bio))
>     {
>     ctx->cont=i;
>     i=EVP_CipherFinal(&(ctx->cipher),
>      (unsigned char *)ctx->buf,
>      &(ctx->buf_len));
>     ctx->ok=i;
>     ctx->buf_off=0;

> +    /* Last block copy needed. sak */
> +    i=outl<ctx->buf_len ? outl:ctx->buf_len;
> +    memcpy(out,ctx->buf,i);
> +    outl-=i;
> +    out+=i;
> +    ret+=i;
>     }
> Comments: I frequently loose data at the end when decrypting. May be
> a padding problem but this hack fixes it for now. [...]

Do you use one large buffer and read only once?  Even if you believe
that all data should fit into one buffer, you have to call the reading
function again and again until it notifies you of EOF.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to