Skip to contentSkip to conversation

crypto: fix client side anonymous TLS credentials

PATCH In review Daniel P. Berrangé 3 participants 3 messages Apr 23 – May 25 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: fix client side anonymous TLS credentials

The previous refactoring of credential creation failed to allocate storage fo the anonymous TLS credentials on the client endpoint.

Fixes 70f9fd8dbf7233bee497055a9b7825e3729ce853
---
 crypto/tlscredsanon.c               |   2 +
 tests/unit/test-crypto-tlssession.c | 120 +++++++++++++++++++++++++++-
 2 files changed, 121 insertions(+), 1 deletion(-)
crypto/tlscredsanon.c +2 -0
index 1551382e1f..190c9833a7 100644
@@ -73,6 +73,8 @@ qcrypto_tls_creds_anon_load(QCryptoTLSCredsAnon *creds,
                                              box->dh_params);
         }
     } else {
+        box = qcrypto_tls_creds_box_new_client(GNUTLS_CRD_ANON);
+
         ret = gnutls_anon_allocate_client_credentials(&box->data.anonclient);
         if (ret < 0) {
             error_setg(errp, "Cannot allocate credentials: %s",
tests/unit/test-crypto-tlssession.c +119 -1

140 lines not on this page · raw message

Signature · 1 line
2.53.0
Tested-by on v1 1/1
#1 lore raw

crypto/tlscredsanon.c

Quoted 13 lines · Daniel P. Berrangé

The previous refactoring of credential creation failed to allocate storage fo the anonymous TLS credentials on the client endpoint.

Fixes 70f9fd8dbf7233bee497055a9b7825e3729ce853
---
  crypto/tlscredsanon.c               |   2 +
  tests/unit/test-crypto-tlssession.c | 120 +++++++++++++++++++++++++++-
  2 files changed, 121 insertions(+), 1 deletion(-)
crypto/tlscredsanon.c +0 -0
index 1551382e1f..190c9833a7 100644

Thanks,
Maciej

#2 lore raw
In reply to Daniel P. Berrangé
Quoted 16 lines · Daniel P. Berrangé

The previous refactoring of credential creation failed to allocate storage fo the anonymous TLS credentials on the client endpoint.

Fixes 70f9fd8dbf7233bee497055a9b7825e3729ce853
---
  crypto/tlscredsanon.c               |   2 +
  tests/unit/test-crypto-tlssession.c | 120 +++++++++++++++++++++++++++-
  2 files changed, 121 insertions(+), 1 deletion(-)
crypto/tlscredsanon.c +0 -0
index 1551382e1f..190c9833a7 100644

crypto/tlscredsanon.c qcrypto_tls_creds_anon_load(QCryptoTLSCredsAnon *creds, · line 78

Quoted 6 lines
crypto/tlscredsanon.c +2 -0
@@ -73,6 +73,8 @@ qcrypto_tls_creds_anon_load(QCryptoTLSCredsAnon *creds,
                                               box->dh_params);
          }
      } else {
+        box = qcrypto_tls_creds_box_new_client(GNUTLS_CRD_ANON);
+
          ret = gnutls_anon_allocate_client_credentials(&box->data.anonclient);

This one feels like a qemu-stable material (11.0.x). I'm picking it up, please let me know if I shouldn't.

Thanks,

/mjt