len=BIO_gets(bp,(char *)buf,BUFSIZE);
if(sigin) { EVP_MD_CTX *ctx; BIO_get_md_ctx(bp, &ctx); i = EVP_VerifyFinal(ctx, sigin, siglen, key); if(i > 0) BIO_printf(out, "Verified OK\n"); else if(i == 0) BIO_printf(out, "Verification Failure\n"); else { BIO_printf(bio_err, "Error Verifying Data\n"); ERR_print_errors(bio_err); } return; } if(key) { EVP_MD_CTX *ctx; BIO_get_md_ctx(bp, &ctx); if(!EVP_SignFinal(ctx, buf, (unsigned int *)&len, key)) { BIO_printf(bio_err, "Error Signing Data\n"); ERR_print_errors(bio_err); return; } } else len=BIO_gets(bp,(char *)buf,BUFSIZE);
void do_fp(unsigned char *buf, BIO *bp, int sep)	{	int len;	int i;	for (;;)		{		i=BIO_read(bp,(char *)buf,BUFSIZE);		if (i <= 0) break;		}	len=BIO_gets(bp,(char *)buf,BUFSIZE);	for (i=0; i<len; i++)		{		if (sep && (i != 0))			putc(':',stdout);		printf("%02x",buf[i]);		}	printf("\n");	}