diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-03-23 23:47:30 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-03-23 23:47:30 +0000 |
commit | 67c1115edd98f388ca89dd38322ea3fadf034523 (patch) | |
tree | 4ed786f6631ff6bbcdd1afd17becc443287008ad /crypto | |
parent | 266469947161aa10b1d36843580d369d5aa38589 (diff) | |
parent | 40c503079ffcb5394be2b407e817de6104db9cfc (diff) | |
download | qemu-67c1115edd98f388ca89dd38322ea3fadf034523.zip qemu-67c1115edd98f388ca89dd38322ea3fadf034523.tar.gz qemu-67c1115edd98f388ca89dd38322ea3fadf034523.tar.bz2 |
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210323-pull-request' into staging
fixes for 6.0
# gpg: Signature made Tue 23 Mar 2021 15:36:06 GMT
# gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138
* remotes/kraxel/tags/ui-20210323-pull-request:
edid: prefer standard timings
include/ui/console.h: Delete is_surface_bgr()
qmp: add new qmp display-reload
vnc: support reload x509 certificates for vnc
crypto: add reload for QCryptoTLSCredsClass
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/tlscredsx509.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c index dbadad4..bc503ba 100644 --- a/crypto/tlscredsx509.c +++ b/crypto/tlscredsx509.c @@ -770,6 +770,51 @@ qcrypto_tls_creds_x509_prop_get_sanity(Object *obj, } +#ifdef CONFIG_GNUTLS + + +static bool +qcrypto_tls_creds_x509_reload(QCryptoTLSCreds *creds, Error **errp) +{ + QCryptoTLSCredsX509 *x509_creds = QCRYPTO_TLS_CREDS_X509(creds); + Error *local_err = NULL; + gnutls_certificate_credentials_t creds_data = x509_creds->data; + gnutls_dh_params_t creds_dh_params = x509_creds->parent_obj.dh_params; + + x509_creds->data = NULL; + x509_creds->parent_obj.dh_params = NULL; + qcrypto_tls_creds_x509_load(x509_creds, &local_err); + if (local_err) { + qcrypto_tls_creds_x509_unload(x509_creds); + x509_creds->data = creds_data; + x509_creds->parent_obj.dh_params = creds_dh_params; + error_propagate(errp, local_err); + return false; + } + + if (creds_data) { + gnutls_certificate_free_credentials(creds_data); + } + if (creds_dh_params) { + gnutls_dh_params_deinit(creds_dh_params); + } + return true; +} + + +#else /* ! CONFIG_GNUTLS */ + + +static bool +qcrypto_tls_creds_x509_reload(QCryptoTLSCreds *creds, Error **errp) +{ + return false; +} + + +#endif /* ! CONFIG_GNUTLS */ + + static void qcrypto_tls_creds_x509_complete(UserCreatable *uc, Error **errp) { @@ -800,6 +845,9 @@ static void qcrypto_tls_creds_x509_class_init(ObjectClass *oc, void *data) { UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); + QCryptoTLSCredsClass *ctcc = QCRYPTO_TLS_CREDS_CLASS(oc); + + ctcc->reload = qcrypto_tls_creds_x509_reload; ucc->complete = qcrypto_tls_creds_x509_complete; |