On Thu, 16 Apr 1998, Maria Cecilia Pilar wrote:
> My name is Maria Cecilia Pilar, I am from Argentina and I am
> working with ssleay libraries. First I used them under Unix and I had
> no problem. Now I compile the libraries for WIN NT 16 bits, and I am
> programming with Visual C++ 1.52. The first problem I get was that in
> Unix I used a function called: PEM_ASN1_read (...) and in 16 bits
> libraries this function didn't exists. So I read deep and deep the
> documentation and I found a function called: PEM_ASN1_read_bio (...),
> with the same parameters (the only difference is that the first one
> received a FILE * and the second on a BIO *). I try to use the BIO
> structure but I have some problems. For example:
> - when I called the BIO_new(BIO_s_file) function I get a PROTECTION
> FAULT error.
You should be calling BIO_new(BIO_s_file())
> - when I called the BIO_new_fd(HFILE,close_flag) everything
> is OK but PEM_ASN1_read_bio (..) return NULL (using the BIO * return by
> the previous function).
> - then when I try to use the ERR_print_errors(BIO *) I get an error
> within the function BIO_write in the call to b->callback(.....). At this
> time I have to reload Visual C++.
The problem with Win16 is that the dll is sort of a seperate program. Unless
the dll calls back into the application, using FILE pointer functions can have
weird problems. So, for win16, all the FILE pointer functions are missing,
and the BIO_s_file() BIO method needs to be comiled in the application, thus
making sure that the FILE * operations occur in the context of the application
instead of the DLL.
For the PEM_ASN1_read_bio() problem, you should be either calling
BIO_new_fp(FILE *,close_flag), not (_fp == File Pointer)
BIO_new_fd(int fd,close_flag) (_fd == File Descriptor or fileno(FILE *))
The simple option is to use
BIO_new_file(filename,"rb"); or some such call to generate the BIO.
The main thing to remember is that you will have to include bss_file.c
in you application. It should be in the SSLeay include directory.
eric
+-------------------------------------------------------------------------+
| Administrative requests should be sent to [EMAIL PROTECTED] |
| List service provided by Open Software Associates, http://www.osa.com/ |
+-------------------------------------------------------------------------+