NetBSD Problem Report #51793

From www@NetBSD.org  Sat Jan  7 16:48:49 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 2FF9C7A0F8
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  7 Jan 2017 16:48:49 +0000 (UTC)
Message-Id: <20170107164848.05BC07A279@mollari.NetBSD.org>
Date: Sat,  7 Jan 2017 16:48:48 +0000 (UTC)
From: davshao@gmail.com
Reply-To: davshao@gmail.com
To: gnats-bugs@NetBSD.org
Subject: security/gnutls FreeBSD 11 error: typedef redefinition ('union max_align_t' vs 'long double')
X-Send-Pr-Version: www-1.0

>Number:         51793
>Category:       pkg
>Synopsis:       security/gnutls FreeBSD 11 error: typedef redefinition ('union max_align_t' vs 'long double')
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 07 16:50:00 +0000 2017
>Closed-Date:    Sat Jan 07 18:50:01 +0000 2017
>Last-Modified:  Thu Jan 19 20:00:00 +0000 2017
>Originator:     David Shao
>Release:        current pkgsrc
>Organization:
>Environment:
FreeBSD xxxxxx.xxx 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct 24 06:55:27 UTC 2016     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
Building security/gnutls fails on FreeBSD 11.0 RELEASE amd64 with:

  CXX      ex-cxx.o
In file included from ex-cxx.cpp:2:
In file included from /usr/include/c++/v1/iostream:38:
In file included from /usr/include/c++/v1/ios:215:
In file included from /usr/include/c++/v1/iosfwd:90:
In file included from ../../src/gl/wchar.h:73:
../../src/gl/stddef.h:104:3: error: typedef redefinition with different types ('union max_align_t' vs 'long double')
} max_align_t;
  ^
/usr/include/c++/v1/stddef.h:57:21: note: previous definition is here
typedef long double max_align_t;

>How-To-Repeat:

>Fix:
The following fix is adapted from FreeBSD ports:

diff -Nur security/gnutls/Makefile security/gnutls.new/Makefile
--- security/gnutls/Makefile	2016-09-20 01:40:15.000000000 -0700
+++ security/gnutls.new/Makefile	2016-12-06 06:57:18.000000000 -0800
@@ -57,6 +57,9 @@
 # Assembler support is broken for SunOS in 3.2.9.
 CONFIGURE_ARGS.SunOS+=	--disable-hardware-acceleration

+# From FreeBSD ports
+CONFIGURE_ARGS.FreeBSD+=	ac_cv_type_max_align_t=yes
+
 INSTALLATION_DIRS=	${DOCDIR} ${EGDIR} include/gnutls

 post-install:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->freebsd-pkg-people
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Sat, 07 Jan 2017 16:56:39 +0000
Responsible-Changed-Why:
FreeBSD problem


State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 07 Jan 2017 18:50:01 +0000
State-Changed-Why:
Applied, thanks!


From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51793 CVS commit: pkgsrc/security/gnutls
Date: Sat, 7 Jan 2017 18:49:16 +0000

 Module Name:	pkgsrc
 Committed By:	maya
 Date:		Sat Jan  7 18:49:16 UTC 2017

 Modified Files:
 	pkgsrc/security/gnutls: Makefile

 Log Message:
 gnutls: don't redefine max_align_t on FreeBSD. It incorrectly fails the
 configure test because the type in stddef.h is guarded by a c11 macro
 (most likely).

 Force the configure test to pass.

 From David Shao in PR pkg/51793 (originally from FreeBSD ports).


 To generate a diff of this commit:
 cvs rdiff -u -r1.167 -r1.168 pkgsrc/security/gnutls/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@NetBSD.org
Cc: freebsd-pkg-people@NetBSD.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org, davshao@gmail.com
Subject: Re: PR/51793 CVS commit: pkgsrc/security/gnutls
Date: Sun, 8 Jan 2017 00:53:15 +0100

 On Sat, Jan 07, 2017 at 07:00:01PM +0000, Maya Rashish wrote:
 > The following reply was made to PR pkg/51793; it has been noted by GNATS.
 > 
 > From: "Maya Rashish" <maya@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc: 
 > Subject: PR/51793 CVS commit: pkgsrc/security/gnutls
 > Date: Sat, 7 Jan 2017 18:49:16 +0000
 > 
 >  Module Name:	pkgsrc
 >  Committed By:	maya
 >  Date:		Sat Jan  7 18:49:16 UTC 2017
 >  
 >  Modified Files:
 >  	pkgsrc/security/gnutls: Makefile
 >  
 >  Log Message:
 >  gnutls: don't redefine max_align_t on FreeBSD. It incorrectly fails the
 >  configure test because the type in stddef.h is guarded by a c11 macro
 >  (most likely).

 clang in FreeBSD 11 should be defaulting to C11 though, so why is the
 configure test failing?

 Joerg

From: coypu@SDF.ORG
To: gnats-bugs@netbsd.org
Cc: joerg@bec.de
Subject: Re: pkg/51793: security/gnutls FreeBSD 11 error: typedef
 redefinition ('union max_align_t' vs 'long double')
Date: Sun, 8 Jan 2017 13:25:39 +0000

 Perhaps it's using c++ instead, in which case the default fails.

 There is this in configure which suggests it may be the case:
   CC=${CXX-"c++"}
   CFLAGS=$CXXFLAGS
   compiler=$CC
   compiler_CXX=$CC
   func_cc_basename $compiler

From: "Benny Siegert" <bsiegert@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51793 CVS commit: [pkgsrc-2016Q4] pkgsrc/security/gnutls
Date: Thu, 19 Jan 2017 19:55:17 +0000

 Module Name:	pkgsrc
 Committed By:	bsiegert
 Date:		Thu Jan 19 19:55:17 UTC 2017

 Modified Files:
 	pkgsrc/security/gnutls [pkgsrc-2016Q4]: Makefile PLIST distinfo
 Removed Files:
 	pkgsrc/security/gnutls/patches [pkgsrc-2016Q4]:
 	    patch-tests_mini-server-name.c

 Log Message:
 Pullup ticket #5185 - requested by wiz
 security/gnutls: security fix

 Revisions pulled up:
 - security/gnutls/Makefile                                      1.168-1.169
 - security/gnutls/PLIST                                         1.54
 - security/gnutls/distinfo                                      1.122
 - security/gnutls/patches/patch-tests_mini-server-name.c        deleted

 ---
    Module Name:	pkgsrc
    Committed By:	maya
    Date:		Sat Jan  7 18:49:16 UTC 2017

    Modified Files:
    	pkgsrc/security/gnutls: Makefile

    Log Message:
    gnutls: don't redefine max_align_t on FreeBSD. It incorrectly fails the
    configure test because the type in stddef.h is guarded by a c11 macro
    (most likely).

    Force the configure test to pass.

    From David Shao in PR pkg/51793 (originally from FreeBSD ports).

 ---
    Module Name:	pkgsrc
    Committed By:	wiz
    Date:		Tue Jan 10 16:23:50 UTC 2017

    Modified Files:
    	pkgsrc/security/gnutls: Makefile PLIST distinfo
    Removed Files:
    	pkgsrc/security/gnutls/patches: patch-tests_mini-server-name.c

    Log Message:
    Updated gnutls to 3.5.8.

    * Version 3.5.8 (released 2016-01-09)

    ** libgnutls: Ensure that multiple calls to the gnutls_set_priority_*
      functions will not leave the verification profiles field to an
      undefined state. The last call will take precedence.

    ** libgnutls: Ensure that GNUTLS_E_DECRYPTION_FAIL will be returned
      by PKCS#8 decryption functions when an invalid key is provided. This
      addresses regression on decrypting certain PKCS#8 keys.

    ** libgnutls: Introduced option to override the default priority string
      used by the library. The intention is to allow support of system-wide
      priority strings (as set with --with-system-priority-file). The
      configure option is --with-default-priority-string.

    ** libgnutls: Require a valid IV size on all ciphers for PKCS#8 decryption.
      This prevents crashes when decrypting malformed PKCS#8 keys.

    ** libgnutls: Fix crash on the loading of malformed private keys with certain
      parameters set to zero.

    ** libgnutls: Fix double free in certificate information printing. If the PKIX
      extension proxy was set with a policy language set but no policy specified,
      that could lead to a double free.

    ** libgnutls: Addressed memory leaks in client and server side error paths
      (issues found using oss-fuzz project)

    ** libgnutls: Addressed memory leaks in X.509 certificate printing error paths
      (issues found using oss-fuzz project)

    ** libgnutls: Addressed memory leaks and an infinite loop in OpenPGP certificate
      parsing. Fixes by Alex Gaynor. (issues found using oss-fuzz project)

    ** libgnutls: Addressed invalid memory accesses in OpenPGP certificate parsing.
      (issues found using oss-fuzz project)

    ** API and ABI modifications:
    No changes since last version.

    * Version 3.5.7 (released 2016-12-8)

    ** libgnutls: Include CHACHA20-POLY1305 ciphersuites in the SECURE128
      and SECURE256 priority strings.

    ** libgnutls: Require libtasn1 4.9; this ensures gnutls will correctly
      operate with OIDs which have elements that exceed 2^32.

    ** libgnutls: The DN decoding functions output the traditional DN format
      rather than the strict RFC4514 compliant textual DN. This reverts the
      3.5.6 introduced change, and allows applications which depended on the
      previous format to continue to function. Introduced new functions which
      output the strict format by default, and can revert to the old one using
      a flag.

    ** libgnutls: Improved TPM key handling. Check authorization requirements
      prior to using a key and fix issue on loop for PIN input. Patches by
      James Bottomley.

    ** libgnutls: In all functions accepting UTF-8 passwords, ensure that
      passwords are normalized according to RFC7613. When invalid UTF-8
      passwords are detected, they are only tolerated for decryption.
      This introduces a libunistring dependency on GnuTLS. A version of
      libunistring is included in the library for the platforms that do
      not ship it; it can be used with the '--with-included-unistring'
      option to configure script.

    ** libgnutls: When setting a subject alternative name in a certificate
      which is in UTF-8 format, it will transparently be converted to IDNA form
      prior to storing.

    ** libgnutls: GNUTLS_CRT_PRINT_ONELINE flag on gnutls_x509_crt_print()
      will print the SHA256 key-ID instead of a certificate fingerprint.

    ** libgnutls: enhance the PKCS#7 verification capabilities. In the case
      signers that are not discoverable using the trust list or input, use
      the stored list as pool to generate a trusted chain to the signer.

    ** libgnutls: Improved MTU calculation precision for the CBC ciphersuites
      under DTLS.

    ** libgnutls: [added missing news entry since 3.5.0]
      No longer tolerate certificate key usage violations for
      TLS signature verification, and decryption. That is GnuTLS will fail
      to connect to servers which incorrectly use a restricted to signing certificate
      for decryption, or vice-versa. This reverts the lax behavior introduced
      in 3.1.0, due to several such broken servers being available. The %COMPAT
      priority keyword can be used to work-around connecting on these servers.

    ** certtool: When exporting a CRQ in DER format ensure no text data are
      intermixed. Patch by Dmitry Eremin-Solenikov.

    ** certtool: Include the SHA-256 variant of key ID in --certificate-info
      options.

    ** p11tool: Introduced the --initialize-pin and --initialize-so-pin
      options.

    ** API and ABI modifications:
    gnutls_utf8_password_normalize: Added
    gnutls_ocsp_resp_get_responder2: Added
    gnutls_x509_crt_get_issuer_dn3: Added
    gnutls_x509_crt_get_dn3: Added
    gnutls_x509_rdn_get2: Added
    gnutls_x509_dn_get_str2: Added
    gnutls_x509_crl_get_issuer_dn3: Added
    gnutls_x509_crq_get_dn3: Added

    * Version 3.5.6 (released 2016-11-04)

    ** libgnutls: Enhanced the PKCS#7 parser to allow decoding old
      (pre-rfc5652) structures with arbitrary encapsulated content.

    ** libgnutls: Introduced a function group to set known DH parameters
      using groups from RFC7919.

    ** libgnutls: Added more strict RFC4514 textual DN encoding and decoding.
      Now the generated textual DN is in reverse order according to RFC4514,
      and functions which generate a DN from strings such gnutls_x509_crt_set_*dn()
      set the expected DN (reverse of the provided string).

    ** libgnutls: Introduced time and constraints checks in the end certificate
      in the gnutls_x509_crt_verify_data2() and gnutls_pkcs7_verify_direct()
      functions.

    ** libgnutls: Set limits on the maximum number of alerts handled. That is,
      applications using gnutls could be tricked into an busy loop if the
      peer sends continuously alert messages. Applications which set a maximum
      handshake time (via gnutls_handshake_set_timeout) will eventually recover
      but others may remain in a busy loops indefinitely. This is related but
      not identical to CVE-2016-8610, due to the difference in alert handling
      of the libraries (gnutls delegates that handling to applications).

    ** libgnutls: Reverted the change which made the gnutls_certificate_set_*key*
      functions return an index (introduced in 3.5.5), to avoid affecting programs
      which explicitly check success of the function as equality to zero. In order
      for these functions to return an index an explicit call to gnutls_certificate_set_flags
      with the GNUTLS_CERTIFICATE_API_V2 flag is now required.

    ** libgnutls: Reverted the behavior of sending a status request extension even
      without a response (introduced in 3.5.5). That is, we no longer reply to a
      client's hello with a status request, with a status request extension. Although
      that behavior is legal, it creates incompatibility issues with releases in
      the gnutls 3.3.x branch.

    ** libgnutls: Delayed the initialization of the random generator at
      the first call of gnutls_rnd(). This allows applications to load
      on systems which getrandom() would block, without blocking until
      real random data are needed.

    ** certtool: --get-dh-params will output parameters from the RFC7919
      groups.

    ** p11tool: improvements in --initialize option.

    ** API and ABI modifications:
    GNUTLS_CERTIFICATE_API_V2: Added
    GNUTLS_NO_TICKETS: Added
    gnutls_pkcs7_get_embedded_data_oid: Added
    gnutls_anon_set_server_known_dh_params: Added
    gnutls_certificate_set_known_dh_params: Added
    gnutls_psk_set_server_known_dh_params: Added
    gnutls_x509_crt_check_key_purpose: Added

    * Version 3.5.5 (released 2016-10-09)

    ** libgnutls: enhanced gnutls_certificate_set_ocsp_status_request_file()
      to allow importing multiple OCSP request files, one for each chain
      provided.

    ** libgnutls: The gnutls_certificate_set_key* functions return an
      index of the added chain. That index can be used either with
      gnutls_certificate_set_ocsp_status_request_file(), or with
      gnutls_certificate_get_crt_raw() and friends.

    ** libgnutls: Added SHA*, AES-GCM, AES-CCM and AES-CBC optimized implementations
      for the aarch64 architecture. Uses Andy Polyakov's assembly code.

    ** libgnutls: Ensure proper cleanups on gnutls_certificate_set_*key()
      failures due to key mismatch. This prevents leaks or double freeing
      on such failures.

    ** libgnutls: Increased the maximum size of the handshake message hash.
      This will allow the library to cope better with larger packets, as
      the ones offered by current TLS 1.3 drafts.

    ** libgnutls: Allow to use client certificates despite them containing
      disallowed algorithms for a session. That allows for example a client
      to use DSA-SHA1 due to his old DSA certificate, without requiring him
      to enable DSA-SHA1 (and thus make it acceptable for the server's certificate).

    ** libgnutls: Reverted AESNI code on x86 to earlier version as the
      latest version was creating position depending code. Added checks
      in the CI to detect position depending code early.

    ** guile: Update code to the I/O port API of Guile >= 2.1.4
      This makes sure the GnuTLS bindings will work with the forthcoming 2.2
      stable series of Guile, of which 2.1 is a preview.

    ** API and ABI modifications:
    gnutls_certificate_set_ocsp_status_request_function2: Added
    gnutls_session_ext_register: Added
    gnutls_session_supplemental_register: Added
    GNUTLS_E_PK_INVALID_PUBKEY: Added
    GNUTLS_E_PK_INVALID_PRIVKEY: Added


 To generate a diff of this commit:
 cvs rdiff -u -r1.167 -r1.167.4.1 pkgsrc/security/gnutls/Makefile
 cvs rdiff -u -r1.53 -r1.53.4.1 pkgsrc/security/gnutls/PLIST
 cvs rdiff -u -r1.121 -r1.121.4.1 pkgsrc/security/gnutls/distinfo
 cvs rdiff -u -r1.1 -r0 \
     pkgsrc/security/gnutls/patches/patch-tests_mini-server-name.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.