* [PATCH 0/1] deprecated ASN1 macros from libtasn1.h
@ 2020-12-18 8:55 Petr Ovtchenkov
2020-12-18 8:55 ` [PATCH 1/1] replace ASN1 deprecated macros Petr Ovtchenkov
0 siblings, 1 reply; 2+ messages in thread
From: Petr Ovtchenkov @ 2020-12-18 8:55 UTC (permalink / raw)
To: qemu-trivial; +Cc: Petr Ovtchenkov
Some macros in libtasn1.h are deprecated and produce warning that brake
compilation (with -Werror).
See fae39782 in libtasn1:
Author: Tim Rühsen <tim.ruehsen@gmx.de>
Date: Thu Mar 12 15:16:40 2020 +0100
Print deprecation warning for deprecated macros
Use _Pragma to print warning for using deprecated macros.
This is enabled for gcc >= 3.1.
Signed-off-by: Tim Rühsen <tim.ruehsen@gmx.de>
Petr Ovtchenkov (1):
replace ASN1 deprecated macros
tests/crypto-tls-x509-helpers.c | 10 +++++-----
tests/crypto-tls-x509-helpers.h | 2 +-
tests/pkix_asn1_tab.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
--
2.29.2.1.g08c1adf7b9
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] replace ASN1 deprecated macros
2020-12-18 8:55 [PATCH 0/1] deprecated ASN1 macros from libtasn1.h Petr Ovtchenkov
@ 2020-12-18 8:55 ` Petr Ovtchenkov
0 siblings, 0 replies; 2+ messages in thread
From: Petr Ovtchenkov @ 2020-12-18 8:55 UTC (permalink / raw)
To: qemu-trivial; +Cc: Petr Ovtchenkov
Follow recommendation from libtasn1.h for deprecated macros.
Signed-off-by: Petr Ovtchenkov <ptr@void-ptr.info>
---
tests/crypto-tls-x509-helpers.c | 10 +++++-----
tests/crypto-tls-x509-helpers.h | 2 +-
tests/pkix_asn1_tab.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tests/crypto-tls-x509-helpers.c b/tests/crypto-tls-x509-helpers.c
index 01b3daf358..97658592a2 100644
--- a/tests/crypto-tls-x509-helpers.c
+++ b/tests/crypto-tls-x509-helpers.c
@@ -30,7 +30,7 @@
* This stores some static data that is needed when
* encoding extensions in the x509 certs
*/
-ASN1_TYPE pkix_asn1;
+asn1_node pkix_asn1;
/*
* To avoid consuming random entropy to generate keys,
@@ -139,7 +139,7 @@ void test_tls_cleanup(const char *keyfile)
/*
* Turns an ASN1 object into a DER encoded byte array
*/
-static void test_tls_der_encode(ASN1_TYPE src,
+static void test_tls_der_encode(asn1_node src,
const char *src_name,
gnutls_datum_t *res)
{
@@ -317,7 +317,7 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req,
* the 'critical' field which we want control over
*/
if (req->basicConstraintsEnable) {
- ASN1_TYPE ext = ASN1_TYPE_EMPTY;
+ asn1_node ext = NULL;
asn1_create_element(pkix_asn1, "PKIX1.BasicConstraints", &ext);
asn1_write_value(ext, "cA",
@@ -344,7 +344,7 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req,
* to be 'critical'
*/
if (req->keyUsageEnable) {
- ASN1_TYPE ext = ASN1_TYPE_EMPTY;
+ asn1_node ext = NULL;
char str[2];
str[0] = req->keyUsageValue & 0xff;
@@ -374,7 +374,7 @@ test_tls_generate_cert(QCryptoTLSTestCertReq *req,
* set this the hard way building up ASN1 data ourselves
*/
if (req->keyPurposeEnable) {
- ASN1_TYPE ext = ASN1_TYPE_EMPTY;
+ asn1_node ext = NULL;
asn1_create_element(pkix_asn1, "PKIX1.ExtKeyUsageSyntax", &ext);
if (req->keyPurposeOID1) {
diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helpers.h
index 08efba4e19..8fcd7785ab 100644
--- a/tests/crypto-tls-x509-helpers.h
+++ b/tests/crypto-tls-x509-helpers.h
@@ -125,7 +125,7 @@ void test_tls_cleanup(const char *keyfile);
}; \
test_tls_generate_cert(&varname, NULL)
-extern const ASN1_ARRAY_TYPE pkix_asn1_tab[];
+extern const asn1_static_node pkix_asn1_tab[];
#endif /* QCRYPTO_HAVE_TLS_TEST_SUPPORT */
diff --git a/tests/pkix_asn1_tab.c b/tests/pkix_asn1_tab.c
index f15fc515cb..4aaf736d3f 100644
--- a/tests/pkix_asn1_tab.c
+++ b/tests/pkix_asn1_tab.c
@@ -8,7 +8,7 @@
#ifdef QCRYPTO_HAVE_TLS_TEST_SUPPORT
-const ASN1_ARRAY_TYPE pkix_asn1_tab[] = {
+const asn1_static_node pkix_asn1_tab[] = {
{"PKIX1", 536875024, 0},
{0, 1073741836, 0},
{"id-ce", 1879048204, 0},
--
2.29.2.1.g08c1adf7b9
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-18 14:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-18 8:55 [PATCH 0/1] deprecated ASN1 macros from libtasn1.h Petr Ovtchenkov
2020-12-18 8:55 ` [PATCH 1/1] replace ASN1 deprecated macros Petr Ovtchenkov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.