Minor compiler nit moving from OpenSSL 0.9.7e to 0.9.7g

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Minor compiler nit moving from OpenSSL 0.9.7e to 0.9.7g

Victor Duchovni

Despite the man page not changing, the d2i_SSL_SESSION() prototype changed
between OpenSSL 0.9.7e and 0.9.7g:


            SSL_SESSION **a,
            unsigned char **pp,
            long length);


            SSL_SESSION **a,
            const unsigned char * const *pp,
            long length);

This causes gcc 2.96 to generate a spurious warning for the following
code (Postfix 2.2.x tls/tls_session.c line 171):

    tls_session.c: In function `tls_session_activate':
    tls_session.c:171: warning: passing arg 2 of `d2i_SSL_SESSION' from incompatible pointer type

    SSL_SESSION *tls_session_activate(char *session_data, int session_data_len)
        SSL_SESSION *session;
        unsigned char *ptr;

         * Activate the SSL_SESSION object.
        ptr = (unsigned char *) session_data;
        session = d2i_SSL_SESSION((SSL_SESSION **) 0, &ptr, session_data_len);
        if (!session)

        return (session);

I don't see why the compiler objects to passing a pointer to a pointer
to a constant character, to a function that expects a pointer to a constant
pointer to a constant character, anyway just in case anyone asks, this is
not a real problem.

Still, if the interface changes, the documentation should probably
change also.

OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]