X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=demos%2Fb64.c;h=efdd44457da6b7ce6abc4423cea572202990d310;hb=adbc603d24e00ae20baac89e1f99552070374b87;hp=5e3d20e3214be1ef56f185010af2c8057efd11fa;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86;p=openssl.git diff --git a/demos/b64.c b/demos/b64.c index 5e3d20e321..efdd44457d 100644 --- a/demos/b64.c +++ b/demos/b64.c @@ -1,5 +1,5 @@ /* demos/b64.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -59,13 +59,13 @@ #include #include #include -#include "apps.h" -#include "buffer.h" -#include "err.h" -#include "evp.h" -#include "objects.h" -#include "x509.h" -#include "pem.h" +#include "../apps/apps.h" +#include +#include +#include +#include +#include +#include #undef SIZE #undef BSIZE @@ -83,7 +83,6 @@ char **argv; unsigned char *buff=NULL,*bufsize=NULL; int bsize=BSIZE,verbose=0; int ret=1,inl; - unsigned char key[24],iv[MD5_DIGEST_LENGTH]; char *str=NULL; char *hkey=NULL,*hiv=NULL; int enc=1,printkey=0,i,base64=0; @@ -91,8 +90,7 @@ char **argv; EVP_CIPHER *cipher=NULL,*c; char *inf=NULL,*outf=NULL; BIO *in=NULL,*out=NULL,*b64=NULL,*benc=NULL,*rbio=NULL,*wbio=NULL; -#define PROG_NAME_SIZE 16 - char pname[PROG_NAME_SIZE]; +#define PROG_NAME_SIZE 39 apps_startup(); @@ -177,11 +175,11 @@ bad: if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize); } - strbuf=Malloc(SIZE); - buff=(unsigned char *)Malloc(EVP_ENCODE_LENGTH(bsize)); + strbuf=OPENSSL_malloc(SIZE); + buff=(unsigned char *)OPENSSL_malloc(EVP_ENCODE_LENGTH(bsize)); if ((buff == NULL) || (strbuf == NULL)) { - BIO_printf(bio_err,"Malloc failure\n"); + BIO_printf(bio_err,"OPENSSL_malloc failure\n"); goto end; } @@ -259,8 +257,8 @@ bad: BIO_printf(bio_err,"bytes written:%8ld\n",BIO_number_written(out)); } end: - if (strbuf != NULL) Free(strbuf); - if (buff != NULL) Free(buff); + if (strbuf != NULL) OPENSSL_free(strbuf); + if (buff != NULL) OPENSSL_free(buff); if (in != NULL) BIO_free(in); if (out != NULL) BIO_free(out); if (benc != NULL) BIO_free(benc);