qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] tests: Replace deprecated ASN1 code
Date: Fri, 29 Jan 2021 10:06:24 +0000	[thread overview]
Message-ID: <20210129100624.GE4001740@redhat.com> (raw)
In-Reply-To: <20210128171523.45921-1-sw@weilnetz.de>

On Thu, Jan 28, 2021 at 06:15:23PM +0100, Stefan Weil wrote:
> This fixes several compiler warnings on MacOS with Homebrew.

Could you give an example of the warnings seen as I'm wondering
why we won't have seen them already on other platforms ? 

> 
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  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.24.3 (Apple Git-128)
> 
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2021-01-29 10:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 17:15 [PATCH] tests: Replace deprecated ASN1 code Stefan Weil
2021-01-29 10:06 ` Daniel P. Berrangé [this message]
2021-01-29 11:35   ` Stefan Weil
2021-01-29 11:47     ` Daniel P. Berrangé
2021-01-29 12:18       ` Stefan Weil
2021-01-29 12:22         ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210129100624.GE4001740@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).