#1138361 tpm2-tools: FTBFS with openssl 4.0

Package:
tpm2-tools
Source:
tpm2-tools
Description:
TPM 2.0 utilities
Submitter:
Sebastian Andrzej Siewior
Date:
2026-06-15 17:37:01 UTC
Severity:
normal
Tags:
#1138361#5
Date:
2026-05-30 16:00:36 UTC
From:
To:
OpenSSL 4.0 is in experimental. This package fails to build against it:

| gcc -DHAVE_CONFIG_H -I. -I./lib   -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./tools -I./lib -Wall -Wextra -Wformat -Wformat-security -Wstack-protector -fstack-protector-all -Wstrict-overflow=5 -O2 -fPIC -fPIE -D_GNU_SOURCE -std=gnu99 -Wstringop-overflow=4 -Wstringop-truncation -Wduplicated-branches -Wduplicated-cond -Wbool-compare -fdata-sections -ffunction-sections -I/usr/include/tss2 -I/usr/include/tss2   -I/usr/include/tss2 -I/usr/include/tss2 -I/usr/include/tss2 -I/usr/include/x86_64-linux-gnu -isystem /usr/include/mit-krb5 -isystem /usr/include/mit-krb5 -I/usr/include/p11-kit-1 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tpm2-tools-5.7=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -c -o lib/libcommon_a-object.o `test -f 'lib/object.c' || echo './'`lib/object.c
| lib/object.c: In function ‘tpm2_util_object_fetch_priv_pub_from_tpk’:
| lib/object.c:254:30: error: invalid use of incomplete typedef ‘ASN1_OCTET_STRING’ {aka ‘struct asn1_string_st’}
|   254 |     int pub_len = tpk->pubkey->length;
|       |                              ^~
| lib/object.c:255:32: error: invalid use of incomplete typedef ‘ASN1_OCTET_STRING’ {aka ‘struct asn1_string_st’}
|   255 |     int priv_len = tpk->privkey->length;
|       |                                ^~
| lib/object.c:261:52: error: invalid use of incomplete typedef ‘ASN1_OCTET_STRING’ {aka ‘struct asn1_string_st’}
|   261 |     rc = Tss2_MU_TPM2B_PUBLIC_Unmarshal(tpk->pubkey->data, pub_len,
|       |                                                    ^~
| lib/object.c:268:54: error: invalid use of incomplete typedef ‘ASN1_OCTET_STRING’ {aka ‘struct asn1_string_st’}
|   268 |     rc = Tss2_MU_TPM2B_PRIVATE_Unmarshal(tpk->privkey->data, priv_len,
|       |                                                      ^~
| make[1]: *** [Makefile:2748: lib/libcommon_a-object.o] Error 1

Full buildlog
https://breakpoint.cc/openssl-rebuild/logs-4/attempted/tpm2-tools_5.7-1_amd64-2026-04-19T11:05:54Z

Sebastian

#1138361#12
Date:
2026-06-15 17:34:50 UTC
From:
To:
The attached patch fixes the build issue with OpenSSL 4.0.