return(i);
return (ret == inl) ? i : ret - inl;
static int enc_write(BIO *b, const char *in, int inl)	{	int ret=0,n,i;	BIO_ENC_CTX *ctx;	ctx=(BIO_ENC_CTX *)b->ptr;	ret=inl;	BIO_clear_retry_flags(b);	n=ctx->buf_len-ctx->buf_off;	while (n > 0)		{		i=BIO_write(b->next_bio,&(ctx->buf[ctx->buf_off]),n);		if (i <= 0)			{			BIO_copy_next_retry(b);			return(i);			}		ctx->buf_off+=i;		n-=i;		}	/* at this point all pending data has been written */	if ((in == NULL) || (inl <= 0)) return(0);	ctx->buf_off=0;	while (inl > 0)		{		n=(inl > ENC_BLOCK_SIZE)?ENC_BLOCK_SIZE:inl;		EVP_CipherUpdate(&(ctx->cipher),			(unsigned char *)ctx->buf,&ctx->buf_len,			(unsigned char *)in,n);		inl-=n;		in+=n;		ctx->buf_off=0;		n=ctx->buf_len;		while (n > 0)			{			i=BIO_write(b->next_bio,&(ctx->buf[ctx->buf_off]),n);			if (i <= 0)				{				BIO_copy_next_retry(b);				return(i);				}			n-=i;			ctx->buf_off+=i;			}		ctx->buf_len=0;		ctx->buf_off=0;		}	BIO_copy_next_retry(b);	return(ret);	}