Bug 228970 - security/krb5: building with libressl 2.7 results in invalid implicit declarations in C99
Summary: security/krb5: building with libressl 2.7 results in invalid implicit declara...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks: 226843
  Show dependency treegraph
 
Reported: 2018-06-12 22:20 UTC by Charlie Li
Modified: 2018-06-13 05:48 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (cy)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Li freebsd_committer freebsd_triage 2018-06-12 22:20:11 UTC
After bug 228900 was fixed in ports r472227, the following errors are emitted when building with ssl=libressl or ssl=libressl-devel set in make.conf:

cc -fpic -DSHARED -DHAVE_CONFIG_H  -I../../../include -I../../../include  -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE -I/usr/local/include -I/usr/local/include -isystem /usr/local/include -O2 -pipe -march=broadwell  -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -std=gnu99 -Werror=unknown-warning-option -Wall -Wcast-align -Wshadow -Wmissing-prototypes -pedantic -Wno-format-zero-length -Woverflow -Wstrict-overflow -Wmissing-format-attribute -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wunused-variable -Wunused-value -Wunknown-pragmas -Wsign-compare -Wnewline-eof -Werror=uninitialized -Werror=pointer-arith -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=implicit-int -Werror=declaration-after-statement -Werror-implicit-function-declaration -pthread  -c pkinit_crypto_openssl.c -o pkinit_crypto_openssl.so.o && mv -f pkinit_crypto_openssl.so.o pkinit_crypto_openssl.so
rm -f ../pkinit.so
(cd .. && ln -s `basename plugins/preauth/pkinit`/pkinit.so .)
pkinit_crypto_openssl.c:3119:5: error: implicit declaration of function 'M_ASN1_D2I_vars' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_vars(a, DH *, DH_new);
    ^
pkinit_crypto_openssl.c:3119:24: error: unexpected type name 'DH': expected expression
    M_ASN1_D2I_vars(a, DH *, DH_new);
                       ^
pkinit_crypto_openssl.c:3119:28: error: expected expression
    M_ASN1_D2I_vars(a, DH *, DH_new);
                           ^
pkinit_crypto_openssl.c:3121:5: error: implicit declaration of function 'M_ASN1_D2I_Init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_Init();
    ^
pkinit_crypto_openssl.c:3121:5: note: did you mean 'M_ASN1_D2I_vars'?
pkinit_crypto_openssl.c:3119:5: note: 'M_ASN1_D2I_vars' declared here
    M_ASN1_D2I_vars(a, DH *, DH_new);
    ^
pkinit_crypto_openssl.c:3122:5: error: implicit declaration of function 'M_ASN1_D2I_start_sequence' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_start_sequence();
    ^
pkinit_crypto_openssl.c:3126:5: error: implicit declaration of function 'M_ASN1_D2I_get_x' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_get_x(ASN1_INTEGER, aip, d2i_ASN1_INTEGER);
    ^
pkinit_crypto_openssl.c:3126:22: error: unexpected type name 'ASN1_INTEGER': expected expression
    M_ASN1_D2I_get_x(ASN1_INTEGER, aip, d2i_ASN1_INTEGER);
                     ^
pkinit_crypto_openssl.c:3130:9: error: use of undeclared identifier 'ret'
        ret->p = ASN1_INTEGER_to_BN(aip, NULL);
        ^
pkinit_crypto_openssl.c:3131:13: error: use of undeclared identifier 'ret'
        if (ret->p == NULL)
            ^
pkinit_crypto_openssl.c:3139:22: error: unexpected type name 'ASN1_INTEGER': expected expression
    M_ASN1_D2I_get_x(ASN1_INTEGER, aip, d2i_ASN1_INTEGER);
                     ^
pkinit_crypto_openssl.c:3143:9: error: use of undeclared identifier 'ret'
        ret->g = ASN1_INTEGER_to_BN(aip, NULL);
        ^
pkinit_crypto_openssl.c:3144:13: error: use of undeclared identifier 'ret'
        if (ret->g == NULL)
            ^
pkinit_crypto_openssl.c:3153:5: error: implicit declaration of function 'M_ASN1_D2I_get_opt' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_get_opt(aip, d2i_ASN1_INTEGER, V_ASN1_INTEGER);
    ^
pkinit_crypto_openssl.c:3153:5: note: did you mean 'M_ASN1_D2I_get_x'?
pkinit_crypto_openssl.c:3126:5: note: 'M_ASN1_D2I_get_x' declared here
    M_ASN1_D2I_get_x(ASN1_INTEGER, aip, d2i_ASN1_INTEGER);
    ^
pkinit_crypto_openssl.c:3155:9: error: use of undeclared identifier 'ret'
        ret->q = NULL;
        ^
pkinit_crypto_openssl.c:3157:9: error: use of undeclared identifier 'ret'
        ret->q = ASN1_INTEGER_to_BN(aip, NULL);
        ^
pkinit_crypto_openssl.c:3158:13: error: use of undeclared identifier 'ret'
        if (ret->q == NULL)
            ^
pkinit_crypto_openssl.c:3167:5: error: implicit declaration of function 'M_ASN1_D2I_end_sequence' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_end_sequence();
    ^
pkinit_crypto_openssl.c:3167:5: note: did you mean 'M_ASN1_D2I_start_sequence'?
pkinit_crypto_openssl.c:3122:5: note: 'M_ASN1_D2I_start_sequence' declared here
    M_ASN1_D2I_start_sequence();
    ^
pkinit_crypto_openssl.c:3168:5: error: implicit declaration of function 'M_ASN1_D2I_Finish' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    M_ASN1_D2I_Finish(a, DH_free, 0);
    ^
pkinit_crypto_openssl.c:3168:5: note: did you mean 'M_ASN1_D2I_Init'?
pkinit_crypto_openssl.c:3121:5: note: 'M_ASN1_D2I_Init' declared here
    M_ASN1_D2I_Init();
    ^
18 errors generated.
gmake[2]: *** [Makefile:823: pkinit_crypto_openssl.so] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/security/krb5/work/krb5-1.16.1/src/plugins/preauth/pkinit'
gmake[1]: *** [Makefile:1524: all-recurse] Error 1
gmake[1]: Leaving directory '/wrkdirs/usr/ports/security/krb5/work/krb5-1.16.1/src'

I've produced this error on 12-CURRENT and 11.1-RELEASE, both amd64. Building with any of the OpenSSL values works as intended.
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-06-12 23:46:01 UTC
Workaround:
CONFIGURE_ARGS+=--disable-pkinit
Comment 2 mark.j.lysek 2018-06-13 03:32:14 UTC
(In reply to Charlie Li from comment #0)

I see the same bug on 11.1-RELEASE i386.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-06-13 05:45:57 UTC
A commit references this bug:

Author: cy
Date: Wed Jun 13 05:44:59 UTC 2018
New revision: 472286
URL: https://svnweb.freebsd.org/changeset/ports/472286

Log:
  Fix build with libressl and bearssl.

  PR:		228970

Changes:
  head/security/krb5-115/Makefile
  head/security/krb5-115/files/patch-plugins_preauth_pkinit_pkinit__crypto__openssl.c
  head/security/krb5-115/files/patch-plugins_preauth_pkinit_pkinit__crypto__openssl.h
  head/security/krb5-116/Makefile
  head/security/krb5-116/files/patch-plugins_preauth_pkinit_pkinit__crypto__openssl.c
  head/security/krb5-116/files/patch-plugins_preauth_pkinit_pkinit__crypto__openssl.h
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2018-06-13 05:48:57 UTC
Fixed.