break;
break; }
static int enc_read(BIO *b, char *out, int outl)	{	int ret=0,i;	BIO_ENC_CTX *ctx;	if (out == NULL) return(0);	ctx=(BIO_ENC_CTX *)b->ptr;	if ((ctx == NULL) || (b->next_bio == NULL)) return(0);	/* First check if there are bytes decoded/encoded */	if (ctx->buf_len > 0)		{		i=ctx->buf_len-ctx->buf_off;		if (i > outl) i=outl;		memcpy(out,&(ctx->buf[ctx->buf_off]),i);		ret=i;		out+=i;		outl-=i;		ctx->buf_off+=i;		if (ctx->buf_len == ctx->buf_off)			{			ctx->buf_len=0;			ctx->buf_off=0;			}		}	/* At this point, we have room of outl bytes and an empty	 * buffer, so we should read in some more. */	while (outl > 0)		{		if (ctx->cont <= 0) break;		/* read in at offset 8, read the EVP_Cipher		 * documentation about why */		i=BIO_read(b->next_bio,&(ctx->buf[8]),ENC_BLOCK_SIZE);		if (i <= 0)			{			/* 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;				}			else				ret=(ret == 0)?i:ret;			break;			}		else			{			EVP_CipherUpdate(&(ctx->cipher),				(unsigned char *)ctx->buf,&ctx->buf_len,				(unsigned char *)&(ctx->buf[8]),i);			ctx->cont=1;			}		if (ctx->buf_len <= outl)			i=ctx->buf_len;		else			i=outl;		if (i <= 0) break;		memcpy(out,ctx->buf,i);		ret+=i;		ctx->buf_off=i;		outl-=i;		out+=i;		}	BIO_clear_retry_flags(b);	BIO_copy_next_retry(b);	return((ret == 0)?ctx->cont:ret);	}