Date: Wed, 17 Apr 2024 17:01:02 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 276960] /usr/include/*_asn1.h have unexpected target-dependent differences Message-ID: <bug-276960-227-3PfUgx23PB@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-276960-227@https.bugs.freebsd.org/bugzilla/> References: <bug-276960-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D276960 --- Comment #1 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D1b7487592987c91020063a311a14dc15b= 6e58075 commit 1b7487592987c91020063a311a14dc15b6e58075 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-04-16 18:56:37 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-04-17 16:12:43 +0000 heimdal: Add 64-bit integer support to ASN.1 compiler Import upstream 19d378f44: ASN.1 INTEGERs will now compile to C int64_t or uint64_t, depending on whether the constraint ranges include numbers that cannot be represented in 32-bit ints and whether they include negative numbers. Template backend support included. check-template is now built with --template, so we know we're testing it. Tests included. Also adjusts the generated files: * asn1parse.c, asn1parse.h (not strictly necessary, but nice to have) * der-protos.h, which needs a bunch of new prototypes. I copied these from a der-protos.h generated by the upstream build system, which uses a perl script for this. * adjust printf format strings for int64_t. Upstream uses %lld for this, but that is not portable, and leads to lots of -Werror warnings. This should fix target-dependent differences between headers generated by asn1_compile. For example, when cross compiling world from amd64 to i386, the generated cms_asn1.h header has: CMSRC2CBCParameter ::=3D SEQUENCE { rc2ParameterVersion INTEGER (0..-1), iv OCTET STRING, } while a native build on i386 has: CMSRC2CBCParameter ::=3D SEQUENCE { rc2ParameterVersion INTEGER (0..2147483647), iv OCTET STRING, } These are _both_ wrong, since the source file, cms.asn1, has: CMSRC2CBCParameter ::=3D SEQUENCE { rc2ParameterVersion INTEGER (0..4294967295), iv OCTET STRING -- exactly 8 octets } PR: 276960 Reviewed by: cy, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44814 Differential Revision: https://reviews.freebsd.org/D44815 crypto/heimdal/lib/asn1/Makefile.am | 12 +++- crypto/heimdal/lib/asn1/asn1-template.h | 2 + crypto/heimdal/lib/asn1/asn1parse.c | 6 +- crypto/heimdal/lib/asn1/asn1parse.h | 2 +- crypto/heimdal/lib/asn1/asn1parse.y | 6 +- crypto/heimdal/lib/asn1/check-gen.c | 120 ++++++++++++++++++++++++++++= ++++ crypto/heimdal/lib/asn1/der-protos.h | 50 +++++++++++++ crypto/heimdal/lib/asn1/der_copy.c | 14 ++++ crypto/heimdal/lib/asn1/der_free.c | 12 ++++ crypto/heimdal/lib/asn1/der_get.c | 45 +++++++++++- crypto/heimdal/lib/asn1/der_length.c | 57 +++++++++++++++ crypto/heimdal/lib/asn1/der_put.c | 72 +++++++++++++++++++ crypto/heimdal/lib/asn1/gen.c | 20 +++--- crypto/heimdal/lib/asn1/gen_decode.c | 18 ++--- crypto/heimdal/lib/asn1/gen_encode.c | 12 ++-- crypto/heimdal/lib/asn1/gen_length.c | 12 ++-- crypto/heimdal/lib/asn1/gen_template.c | 22 +++--- crypto/heimdal/lib/asn1/lex.l | 2 +- crypto/heimdal/lib/asn1/symbol.h | 10 ++- crypto/heimdal/lib/asn1/template.c | 2 + crypto/heimdal/lib/asn1/test.asn1 | 2 + 21 files changed, 446 insertions(+), 52 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-276960-227-3PfUgx23PB>