dirk laurijssen wrote:
>
> Hi,
> Altough mentioned in the faq http://www.openssl.org/support/faq.html#PROG3 , I can't
>seem to get the DER-certificate loaded appropriately into the X509-struct.
>
[stuff deleted]
>
> int
> validate_ssl (int ok, char *ip, char *protocol, char *subject,
> char *issuer, unsigned char *cert, int length, int depth,
> char **message)
> {
> ....
>
> X509 *new_cert = d2i_X509(NULL, &cert, sizeof(cert));
> version = X509_get_version(new_cert);
>
> }
sizeof(cert) since "cert" is of type (char *) will just give you the
size of a pointer (typically 4) what you want is the size of the buffer
pointed to by "cert" which might be 'length' from the prototype...
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]