I would suggest getting the latest portable branch from Github - that compiles nicely with OpenSSL.

Good luck,
Reio

On 02/09/2019 10:48, Ede Wolf wrote:
Hello,

trying to compile opensmtp it fails with openssl errors, so I've tried to specify --without-libssl at configure time, as at least for testing and learning the basics it is not really that important, but it does not seem to get honored.

Any idea, what I may have to change?

Thanks

Ede



In case anybody has an idea for building with openssl, here are the final words of the compiler:


# gcc --version
gcc (Gentoo 8.3.0-r1 p1.1) 8.3.0

# openssl version
OpenSSL 1.1.1c  28 May 2019



...

gcc -DHAVE_CONFIG_H -I. -I..  -I../smtpd -I../openbsd-compat -I../openbsd-compat/err_h -I/usr/include   -mtune=skylake -march=skylake -fomit-frame-pointer -O2 -pipe  -fPIC -DPIC -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -fPIE -D_BSD_SOURCE -D_DEFAULT_SOURCE  -c -o fmt_scaled.o fmt_scaled.c
fmt_scaled.c: In function 'fmt_scaled':
fmt_scaled.c:243:52: warning: '%1lld' directive output may be truncated writing between 1 and 17 bytes into a region of size between 0 and 5 [-Wformat-truncation=]
   (void)snprintf(result, FMT_SCALED_STRSIZE, "%lld.%1lld%c",
                                                    ^~~~~
fmt_scaled.c:243:46: note: directive argument in the range [-9007199254740991, 9007199254740991]
   (void)snprintf(result, FMT_SCALED_STRSIZE, "%lld.%1lld%c",
                                              ^~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
                 from openbsd-compat.h:189,
                 from includes.h:67,
                 from fmt_scaled.c:41:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 5 and 40 bytes into a destination of size 7
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -DHAVE_CONFIG_H -I. -I..  -I../smtpd -I../openbsd-compat -I../openbsd-compat/err_h -I/usr/include   -mtune=skylake -march=skylake -fomit-frame-pointer -O2 -pipe  -fPIC -DPIC -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -fPIE -D_BSD_SOURCE -D_DEFAULT_SOURCE  -c -o fparseln.o fparseln.c
rm -f libopenbsd-compat.a
/usr/bin/ar cru libopenbsd-compat.a base64.o bsd-getpeereid.o bsd-misc.o bsd-waitpid.o entropy.o event_asr_run.o fgetln.o freezero.o getopt.o imsg.o imsg-buffer.o pidfile.o pw_dup.o reallocarray.o recallocarray.o setproctitle.o setresguid.o strlcat.o strlcpy.o strmode.o strtonum.o strsep.o vis.o xmalloc.o crypt_checkpass.o  bsd-closefrom.o   bsd-err.o errc.o fmt_scaled.o  fparseln.o
ranlib libopenbsd-compat.a
make[2]: Leaving directory '/root/build/opensmtpd-6.4.2p1/openbsd-compat'
Making all in mk
make[2]: Entering directory '/root/build/opensmtpd-6.4.2p1/mk'
Making all in smtpd
make[3]: Entering directory '/root/build/opensmtpd-6.4.2p1/mk/smtpd'
gcc -DHAVE_CONFIG_H -I. -I../..  -I../../smtpd -I../../openbsd-compat -I../../openbsd-compat/err_h -I../../openbsd-compat/paths_h -I. -I/usr/include -DSMTPD_CONFDIR=\"/opt/smptd/etc\" -DPATH_CHROOT=\"/opt/smptd/var/empty\" -DPATH_SMTPCTL=\"/opt/smptd/sbin/smtpctl\" -DPATH_MAILLOCAL=\"/opt/smptd/libexec/opensmtpd/mail.local\" -DPATH_LIBEXEC=\"/opt/smptd/libexec/opensmtpd\" -DHAVE_CONFIG_H -DIO_SSL -DCA_FILE=\"/etc/ssl/cert.pem\" -mtune=skylake -march=skylake -fomit-frame-pointer -O2 -pipe  -fPIC -DPIC -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -fPIE -D_BSD_SOURCE -D_DEFAULT_SOURCE  -D_GNU_SOURCE -DNEED_EVENT_ASR_RUN -c -o ../../smtpd/smtpd-aliases.o `test -f '../../smtpd/aliases.c' || echo './'`../../smtpd/aliases.c
../../smtpd/aliases.c: In function 'aliases_get':
../../smtpd/aliases.c:56:23: warning: variable 'userbase' set but not used [-Wunused-but-set-variable]
  struct table        *userbase = NULL;
                       ^~~~~~~~
../../smtpd/aliases.c: In function 'aliases_virtual_get':
../../smtpd/aliases.c:114:23: warning: variable 'userbase' set but not used [-Wunused-but-set-variable]
  struct table        *userbase = NULL;
                       ^~~~~~~~
gcc -DHAVE_CONFIG_H -I. -I../..  -I../../smtpd -I../../openbsd-compat -I../../openbsd-compat/err_h -I../../openbsd-compat/paths_h -I. -I/usr/include -DSMTPD_CONFDIR=\"/opt/smptd/etc\" -DPATH_CHROOT=\"/opt/smptd/var/empty\" -DPATH_SMTPCTL=\"/opt/smptd/sbin/smtpctl\" -DPATH_MAILLOCAL=\"/opt/smptd/libexec/opensmtpd/mail.local\" -DPATH_LIBEXEC=\"/opt/smptd/libexec/opensmtpd\" -DHAVE_CONFIG_H -DIO_SSL -DCA_FILE=\"/etc/ssl/cert.pem\" -mtune=skylake -march=skylake -fomit-frame-pointer -O2 -pipe  -fPIC -DPIC -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -fPIE -D_BSD_SOURCE -D_DEFAULT_SOURCE  -D_GNU_SOURCE -DNEED_EVENT_ASR_RUN -c -o ../../smtpd/smtpd-bounce.o `test -f '../../smtpd/bounce.c' || echo './'`../../smtpd/bounce.c gcc -DHAVE_CONFIG_H -I. -I../..  -I../../smtpd -I../../openbsd-compat -I../../openbsd-compat/err_h -I../../openbsd-compat/paths_h -I. -I/usr/include -DSMTPD_CONFDIR=\"/opt/smptd/etc\" -DPATH_CHROOT=\"/opt/smptd/var/empty\" -DPATH_SMTPCTL=\"/opt/smptd/sbin/smtpctl\" -DPATH_MAILLOCAL=\"/opt/smptd/libexec/opensmtpd/mail.local\" -DPATH_LIBEXEC=\"/opt/smptd/libexec/opensmtpd\" -DHAVE_CONFIG_H -DIO_SSL -DCA_FILE=\"/etc/ssl/cert.pem\" -mtune=skylake -march=skylake -fomit-frame-pointer -O2 -pipe  -fPIC -DPIC -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -fno-builtin-memset -fPIE -D_BSD_SOURCE -D_DEFAULT_SOURCE  -D_GNU_SOURCE -DNEED_EVENT_ASR_RUN -c -o ../../smtpd/smtpd-ca.o `test -f '../../smtpd/ca.c' || echo './'`../../smtpd/ca.c
../../smtpd/ca.c: In function 'ca_X509_verify':
../../smtpd/ca.c:204:47: error: dereferencing pointer to incomplete type 'X509_STORE_CTX' {aka 'struct x509_store_ctx_st'}
    *errstr = X509_verify_cert_error_string(xsc->error);
                                               ^~
../../smtpd/ca.c: At top level:
../../smtpd/ca.c:307:1: error: variable 'rsae_method' has initializer but incomplete type
 static RSA_METHOD rsae_method = {
 ^~~~~~
../../smtpd/ca.c:308:2: warning: excess elements in struct initializer
  "RSA privsep engine",
  ^~~~~~~~~~~~~~~~~~~~
../../smtpd/ca.c:308:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:309:2: warning: excess elements in struct initializer
  rsae_pub_enc,
  ^~~~~~~~~~~~
../../smtpd/ca.c:309:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:310:2: warning: excess elements in struct initializer
  rsae_pub_dec,
  ^~~~~~~~~~~~
../../smtpd/ca.c:310:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:311:2: warning: excess elements in struct initializer
  rsae_priv_enc,
  ^~~~~~~~~~~~~
../../smtpd/ca.c:311:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:312:2: warning: excess elements in struct initializer
  rsae_priv_dec,
  ^~~~~~~~~~~~~
../../smtpd/ca.c:312:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:313:2: warning: excess elements in struct initializer
  rsae_mod_exp,
  ^~~~~~~~~~~~
../../smtpd/ca.c:313:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:314:2: warning: excess elements in struct initializer
  rsae_bn_mod_exp,
  ^~~~~~~~~~~~~~~
../../smtpd/ca.c:314:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:315:2: warning: excess elements in struct initializer
  rsae_init,
  ^~~~~~~~~
../../smtpd/ca.c:315:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:316:2: warning: excess elements in struct initializer
  rsae_finish,
  ^~~~~~~~~~~
../../smtpd/ca.c:316:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:317:2: warning: excess elements in struct initializer
  0,
  ^
../../smtpd/ca.c:317:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:318:2: warning: excess elements in struct initializer
  NULL,
  ^~~~
../../smtpd/ca.c:318:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:319:2: warning: excess elements in struct initializer
  NULL,
  ^~~~
../../smtpd/ca.c:319:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:320:2: warning: excess elements in struct initializer
  NULL,
  ^~~~
../../smtpd/ca.c:320:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c:321:2: warning: excess elements in struct initializer
  rsae_keygen
  ^~~~~~~~~~~
../../smtpd/ca.c:321:2: note: (near initialization for 'rsae_method')
../../smtpd/ca.c: In function 'rsae_pub_enc':
../../smtpd/ca.c:407:21: error: dereferencing pointer to incomplete type 'RSA_METHOD' {aka 'const struct rsa_meth_st'}
  return (rsa_default->rsa_pub_enc(flen, from, to, rsa, padding));
                     ^~
../../smtpd/ca.c: In function 'ca_engine_init':
../../smtpd/ca.c:493:38: error: invalid use of incomplete typedef 'RSA_METHOD' {aka 'struct rsa_meth_st'}
   if (!ENGINE_set_name(e, rsae_method.name)) {
                                      ^
../../smtpd/ca.c:511:27: error: 'RSA_FLAG_SIGN_VER' undeclared (first use in this function); did you mean 'RSA_FLAG_EXT_PKEY'?
  if (rsa_default->flags & RSA_FLAG_SIGN_VER)
                           ^~~~~~~~~~~~~~~~~
                           RSA_FLAG_EXT_PKEY
../../smtpd/ca.c:511:27: note: each undeclared identifier is reported only once for each function it appears in ../../smtpd/ca.c:515:14: error: invalid use of incomplete typedef 'RSA_METHOD' {aka 'struct rsa_meth_st'}
   rsae_method.rsa_mod_exp = NULL;
              ^
../../smtpd/ca.c:517:14: error: invalid use of incomplete typedef 'RSA_METHOD' {aka 'struct rsa_meth_st'}
   rsae_method.bn_mod_exp = NULL;
              ^
../../smtpd/ca.c:519:14: error: invalid use of incomplete typedef 'RSA_METHOD' {aka 'struct rsa_meth_st'}
   rsae_method.rsa_keygen = NULL;
              ^
../../smtpd/ca.c:520:13: error: invalid use of incomplete typedef 'RSA_METHOD' {aka 'struct rsa_meth_st'}
  rsae_method.flags = rsa_default->flags |
             ^
../../smtpd/ca.c:522:13: error: invalid use of incomplete typedef 'RSA_METHOD' {aka 'struct rsa_meth_st'}
  rsae_method.app_data = rsa_default->app_data;
             ^
../../smtpd/ca.c: At top level:
../../smtpd/ca.c:307:19: error: storage size of 'rsae_method' isn't known
 static RSA_METHOD rsae_method = {
                   ^~~~~~~~~~~
make[3]: *** [Makefile:742: ../../smtpd/smtpd-ca.o] Error 1
make[3]: Leaving directory '/root/build/opensmtpd-6.4.2p1/mk/smtpd'
make[2]: *** [Makefile:371: all-recursive] Error 1
make[2]: Leaving directory '/root/build/opensmtpd-6.4.2p1/mk'
make[1]: *** [Makefile:418: all-recursive] Error 1
make[1]: Leaving directory '/root/build/opensmtpd-6.4.2p1'
make: *** [Makefile:350: all] Error 2



--
Tervitades
Reio Remma


MR Stuudio 25 aastat

*MR Stuudio OÜ*
Tondi 17b, 11316, Tallinn
Tel +372 650 4808
Mob +372 56 22 00 33
r...@mrstuudio.ee
www.mrstuudio.ee



Reply via email to