Hi,
Thanks
for your reply. I have tried, still the memory leak problem happens
:)
and
the whole application crashes
my
code is like this:
BIO *bio, *b64;
BIO *bio_out;
char inbuf[128];
int inlen;
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_file("content.key", "rb");
bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
while ((inlen = BIO_read(bio, inbuf, 128)) > 0) {
BIO_write(bio_out, inbuf, inlen);
}
BIO *bio_out;
char inbuf[128];
int inlen;
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_file("content.key", "rb");
bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
while ((inlen = BIO_read(bio, inbuf, 128)) > 0) {
BIO_write(bio_out, inbuf, inlen);
}
BIO_free_all(bio);
what I
wish to do is, read the data from the file content.key
and
then decode the data
and
then convert the decoded data in to a char * (or perhaps to another new
file)
but
here what i do is just print out the decoded data :)
i am
sorry to bother you that much.
pls
forgive
and
pls help if you have the time :D
thousand thanks. Wish you all the
best.
Best
regards,
--------------------------------------------
Jordan Cheun Ngen,
Chong
INF-4067 Universiteit Twente
Postbus 217
7500 AE Enschede
The
Netherlands
Distributed and Embedded Systems
(DIES)
--------------------------------------------
Office Phone: +31 53
4894655
Web site: http://www.cs.utwente.nl/~chong
Email Add.:
[EMAIL PROTECTED]
============================================
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of ??
Sent: Monday, September 10, 2001 1:24 PM
To: '[EMAIL PROTECTED]'
Subject: ??: Please Help: Crypto library with Visual C++oh nothing.... do not be nervousi think if you want to read data from a filefirst you must construct aBIO * mbio = BIO_new_file(filename , "rb") objectthen build another BIO* b64 = BIO_new(BIO_f_base64());then mbio = BIO_push(b64, mbio);all ok ...read data fromwhile((inlen = BIO_read(mbio, inbuf, strlen(message))) > 0){....do as you wish}
// remember free all bio resourceBIO_free_all(bio); can this solve your problem?
