OpenSSL v3 alpha 1: include file problem

Norm Green norm.green at gemtalksystems.com
Mon Apr 27 21:14:12 UTC 2020


I don't know if this change was intentional or not.
With 3.0 alpha, compiling this simple program on Linux fails but 
succeeds on 1.1:

-----------------
#include <openssl/ssl.h>
----------------

gcc -c -I \
/home/normg/local/gs360_opensslv3/slow50/openssl/install50/include test.c


In file included from 
/home/normg/local/gs360_opensslv3/slow50/openssl/install50/include/openssl/types.h:20:0,
                  from 
/home/normg/local/gs360_opensslv3/slow50/openssl/install50/include/openssl/err.h:26,
                  from test.c:1:
/home/normg/local/gs360_opensslv3/slow50/openssl/install50/include/openssl/ssl.h:235:28: 
error: 'SRTP_PROTECTION_PROFILE' does not name a type
  DEFINE_OR_DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
                             ^
/home/normg/local/gs360_opensslv3/slow50/openssl/install50/include/openssl/safestack.h:30:45: 
note: in definition of macro 'SKM_DEFINE_STACK_OF'
      typedef int (*sk_##t1##_compfunc)(const t3 * const *a, const t3 
*const *b); \
...<pages and pages of warnings/errors>



To fix it, all we need is to include err.h first, as follows:

-----------------
#include <openssl/err.h>
#include <openssl/ssl.h>
----------------

I scanned the wiki and readme and did not see a requirement to include 
err.h before ssl.h.  Is this intentional or a bug?

It's easy enough for me to fix this in my source code, but other 
packages that rely upon openssl break with "ssl.h is unusable" errors 
due of this change (OpenLDAP is one such example).

Norm Green



More information about the openssl-users mailing list