[ZBX-15552] Compilation failed on OpenBSD 6.3 with OpenSSL library Created: 2019 Jan 30  Updated: 2024 Apr 10  Resolved: 2019 Apr 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 3.0.25, 4.0.3
Fix Version/s: 3.0.26rc1, 4.0.6rc1, 4.2.0rc1, 4.2 (plan)

Type: Problem report Priority: Major
Reporter: Alexander Vladishev Assignee: Andris Mednis
Resolution: Fixed Votes: 0
Labels: openbsd
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBX-11803 Make Zabbix work without PSK Closed
duplicates ZBX-12210 Can not compile Zabbix components wit... Closed
Team: Team A
Sprint: Sprint 48, Jan 2019, Sprint 49 (Feb 2019), Sprint 50 (Mar 2019), Sprint 51 (Apr 2019)
Story Points: 12

 Description   
Configuration:

  Detected OS:           openbsd6.3
  Install path:          /usr/local
  Compilation arch:      openbsd

  Compiler:              gcc
  Compiler flags:         -g -O2

  Library-specific flags:
    TLS:                   -I/usr/include
    iconv:                 -I/usr/local/include

  Enable server:         no

  Enable proxy:          no

  Enable agent:          yes
  Agent details:
    TLS:                   OpenSSL
    Linker flags:           -L/usr/lib    -L/usr/local/lib
    Libraries:              -lssl -lcrypto   -lkvm -lm   -liconv

  Enable Java gateway:   no

  LDAP support:          no
  IPv6 support:          no

make install fails with error message

v3.0.25:

tls.c:226: error: 'PSK_MAX_IDENTITY_LEN' undeclared here (not in a function)
*** Error 1 in src/libs/zbxcrypto (Makefile:457 'libzbxcrypto_a-tls.o': gcc -DHAVE_CONFIG_H -I. -I../../../include    -I/usr/include -g -O2 ...)
*** Error 1 in src/libs (Makefile:494 'all-recursive')
*** Error 1 in src (Makefile:470 'all-recursive')
*** Error 1 in /home/zabbix/zabbix-3.0.25 (Makefile:483 'all-recursive')

v4.0.3:

tls.c:232:59: error: use of undeclared identifier 'PSK_MAX_IDENTITY_LEN'
ZBX_THREAD_LOCAL static char                    incoming_connection_psk_id[PSK_MAX_IDENTITY_LEN + 1];
                                                                           ^
tls.c:2645:3: warning: implicit declaration of function 'OPENSSL_cleanup' is invalid in C99 [-Wimplicit-function-declaration]
                OPENSSL_cleanup();
                ^
tls.c:3431:4: warning: implicit declaration of function 'SSL_CTX_set_psk_client_callback' is invalid in C99 [-Wimplicit-function-declaration]
                        SSL_CTX_set_psk_client_callback(ctx_psk, zbx_psk_client_cb);
                        ^
tls.c:3435:4: warning: implicit declaration of function 'SSL_CTX_set_psk_server_callback' is invalid in C99 [-Wimplicit-function-declaration]
                        SSL_CTX_set_psk_server_callback(ctx_psk, zbx_psk_server_cb);
                        ^
tls.c:3448:12: warning: implicit declaration of function 'SSL_CTX_set_ciphersuites' is invalid in C99 [-Wimplicit-function-declaration]
                if (1 != SSL_CTX_set_ciphersuites(ctx_psk, ZBX_CIPHERS_PSK_TLS13))
                         ^


 Comments   
Comment by Alexander Vladishev [ 2019 Jan 30 ]

Environment:

$ uname -a
OpenBSD openbsd6-i386 6.3 GENERIC.MP#491 i386
$ pkg_info openssl
Information for https://cdn.openbsd.org/pub/OpenBSD/6.3/packages/i386/openssl-1.0.2n.tgz

Comment:
TLS/SSL library and tools

Description:
OpenSSL is an open-source toolkit implementing the Secure Sockets
Layer (SSL) and Transport Layer Security (TLS) protocols as well as a
full-strength general purpose cryptography library.

This package is not intended for general-purpose use in OpenBSD -
it is present to provide support for applications which cannot be made
compatible with LibReSSL (mostly due to use of removed APIs), and for
test/comparison purposes.

Maintainer: Stuart Henderson <[email protected]>

WWW: http://www.openssl.org/
Comment by Glebs Ivanovskis [ 2019 Jan 30 ]

Duplicate of ZBX-11803?

Comment by Andris Mednis [ 2019 Jan 30 ]

I investigated it on the latest -OpenBSD 6.4.
PSK_MAX_IDENTITY_LEN is not defined because PSK support is disabled in OpenSSL library:
In /usr/include/openssl/opensslfeatures.h:

# define OPENSSL_NO_PSK

Currently Zabbix is not prepared to handle this case - that PSK support is not compiled into OpenSSL and only certificates are supported.

Probably we need to rework tls.c file to handle this case with "PSK support is not compiled in".

Tnanks, cyclone, for pointing to ZBX-11803 - there are even patches proposed

Comment by Andris Mednis [ 2019 Feb 19 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-15552-30

Comment by Andris Mednis [ 2019 Mar 18 ]

Fixed in versions:

  • pre-3.0.26rc1 r91106
  • pre-4.0.6rc1 r91133
  • pre-4.2.0rc1 (trunk) r91137
Generated at Sat Apr 27 06:54:31 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.