Accepting request 894521 from home:pmonrealgonzalez:branches:security
- swtpm_cert: rename deprecated libtasn1 types. * https://github.com/stefanberger/swtpm/pull/443 * Add swtpm-rename_deprecated_libtasn1_types.patch OBS-URL: https://build.opensuse.org/request/show/894521 OBS-URL: https://build.opensuse.org/package/show/security/swtpm?expand=0&rev=16
This commit is contained in:
parent
b1fc3d57f8
commit
099d31ba0a
114
swtpm-rename_deprecated_libtasn1_types.patch
Normal file
114
swtpm-rename_deprecated_libtasn1_types.patch
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
From 0b0041bda9df8bf704d7aff8c32da0d18cd9eb28 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonas Witschel <diabonas@archlinux.org>
|
||||||
|
Date: Wed, 19 May 2021 10:30:41 +0200
|
||||||
|
Subject: [PATCH] swtpm_cert: rename deprecated libtasn1 types
|
||||||
|
|
||||||
|
These types have been renamed in libtasn1 version 3.0 (released 2012-10-28).
|
||||||
|
The most recent libtasn1 version 4.17.0 (released 2021-05-13) now prints
|
||||||
|
deprecation warnings that are made fatal by -Werror:
|
||||||
|
|
||||||
|
ek-cert.c:76:13: error: 'ASN1_ARRAY_TYPE' macro is deprecated, use 'asn1_static_node' instead. [-Werror]
|
||||||
|
76 | extern const ASN1_ARRAY_TYPE tpm_asn1_tab[];
|
||||||
|
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
[...]
|
||||||
|
|
||||||
|
The new types were introduced almost ten years ago, so they should be pretty
|
||||||
|
universally available by now.
|
||||||
|
|
||||||
|
Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
|
||||||
|
---
|
||||||
|
src/swtpm_cert/ek-cert.c | 24 ++++++++++++------------
|
||||||
|
1 file changed, 12 insertions(+), 12 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/swtpm_cert/ek-cert.c b/src/swtpm_cert/ek-cert.c
|
||||||
|
index c991559c..c8074614 100644
|
||||||
|
--- a/src/swtpm_cert/ek-cert.c
|
||||||
|
+++ b/src/swtpm_cert/ek-cert.c
|
||||||
|
@@ -73,9 +73,9 @@ enum cert_type_t {
|
||||||
|
#define ALLOW_SIGNING_F 2 /* EK can be used for signing */
|
||||||
|
#define DECRYPTION_F 4 /* EK can be used for decryption; default */
|
||||||
|
|
||||||
|
-extern const ASN1_ARRAY_TYPE tpm_asn1_tab[];
|
||||||
|
+extern const asn1_static_node tpm_asn1_tab[];
|
||||||
|
|
||||||
|
-ASN1_TYPE _tpm_asn;
|
||||||
|
+asn1_node _tpm_asn;
|
||||||
|
|
||||||
|
typedef struct tdTCG_PCCLIENT_STORED_CERT {
|
||||||
|
uint16_t tag;
|
||||||
|
@@ -333,7 +333,7 @@ asn_free(void)
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-encode_asn1(gnutls_datum_t *asn1, ASN1_TYPE at)
|
||||||
|
+encode_asn1(gnutls_datum_t *asn1, asn1_node at)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
|
@@ -361,7 +361,7 @@ encode_asn1(gnutls_datum_t *asn1, ASN1_TYPE at)
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-build_tpm_manufacturer_info(ASN1_TYPE *at,
|
||||||
|
+build_tpm_manufacturer_info(asn1_node *at,
|
||||||
|
const char *manufacturer,
|
||||||
|
const char *tpm_model,
|
||||||
|
const char *tpm_version)
|
||||||
|
@@ -443,7 +443,7 @@ create_tpm_manufacturer_info(const char *manufacturer,
|
||||||
|
const char *tpm_version,
|
||||||
|
gnutls_datum_t *asn1)
|
||||||
|
{
|
||||||
|
- ASN1_TYPE at = ASN1_TYPE_EMPTY;
|
||||||
|
+ asn1_node at = NULL;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = asn_init();
|
||||||
|
@@ -475,7 +475,7 @@ create_tpm_manufacturer_info(const char *manufacturer,
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
-build_platf_manufacturer_info(ASN1_TYPE *at,
|
||||||
|
+build_platf_manufacturer_info(asn1_node *at,
|
||||||
|
const char *manufacturer,
|
||||||
|
const char *platf_model,
|
||||||
|
const char *platf_version,
|
||||||
|
@@ -569,7 +569,7 @@ create_platf_manufacturer_info(const char *manufacturer,
|
||||||
|
gnutls_datum_t *asn1,
|
||||||
|
bool forTPM2)
|
||||||
|
{
|
||||||
|
- ASN1_TYPE at = ASN1_TYPE_EMPTY;
|
||||||
|
+ asn1_node at = NULL;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = asn_init();
|
||||||
|
@@ -612,9 +612,9 @@ create_tpm_and_platform_manuf_info(
|
||||||
|
gnutls_datum_t *asn1,
|
||||||
|
bool forTPM2)
|
||||||
|
{
|
||||||
|
- ASN1_TYPE at = ASN1_TYPE_EMPTY;
|
||||||
|
- ASN1_TYPE tpm_at = ASN1_TYPE_EMPTY;
|
||||||
|
- ASN1_TYPE platf_at = ASN1_TYPE_EMPTY;
|
||||||
|
+ asn1_node at = NULL;
|
||||||
|
+ asn1_node tpm_at = NULL;
|
||||||
|
+ asn1_node platf_at = NULL;
|
||||||
|
int err;
|
||||||
|
gnutls_datum_t datum = {
|
||||||
|
.data = NULL,
|
||||||
|
@@ -725,7 +725,7 @@ create_tpm_specification_info(const char *spec_family,
|
||||||
|
unsigned int spec_revision,
|
||||||
|
gnutls_datum_t *asn1)
|
||||||
|
{
|
||||||
|
- ASN1_TYPE at = ASN1_TYPE_EMPTY;
|
||||||
|
+ asn1_node at = NULL;
|
||||||
|
int err;
|
||||||
|
unsigned int bigendian;
|
||||||
|
unsigned char twoscomp[1 + sizeof(bigendian)] = { 0, };
|
||||||
|
@@ -797,7 +797,7 @@ create_tpm_specification_info(const char *spec_family,
|
||||||
|
static int
|
||||||
|
create_cert_extended_key_usage(const char *oid, gnutls_datum_t *asn1)
|
||||||
|
{
|
||||||
|
- ASN1_TYPE at = ASN1_TYPE_EMPTY;
|
||||||
|
+ asn1_node at = NULL;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = asn_init();
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 20 06:56:39 UTC 2021 - Pedro Monreal <pmonreal@suse.com>
|
||||||
|
|
||||||
|
- swtpm_cert: rename deprecated libtasn1 types.
|
||||||
|
* https://github.com/stefanberger/swtpm/pull/443
|
||||||
|
* Add swtpm-rename_deprecated_libtasn1_types.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Dec 27 11:42:50 UTC 2020 - Marcus Meissner <meissner@suse.com>
|
Sun Dec 27 11:42:50 UTC 2020 - Marcus Meissner <meissner@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package swtpm
|
# spec file for package swtpm
|
||||||
#
|
#
|
||||||
# Copyright (c) 2020 SUSE LLC
|
# Copyright (c) 2021 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -27,6 +27,7 @@ License: BSD-3-Clause
|
|||||||
Group: System/Base
|
Group: System/Base
|
||||||
URL: https://github.com/stefanberger/swtpm
|
URL: https://github.com/stefanberger/swtpm
|
||||||
Source: https://github.com/stefanberger/swtpm/archive/v%{version}.tar.gz
|
Source: https://github.com/stefanberger/swtpm/archive/v%{version}.tar.gz
|
||||||
|
Patch0: swtpm-rename_deprecated_libtasn1_types.patch
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
BuildRequires: expect
|
BuildRequires: expect
|
||||||
@ -68,6 +69,7 @@ The development files for SWTPM
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%setup -q -n %{name}-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user