[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 5/5] crypto/tls-cipher-suites: Product fw_cfg consumable b
From: |
Laszlo Ersek |
Subject: |
Re: [PATCH v6 5/5] crypto/tls-cipher-suites: Product fw_cfg consumable blob |
Date: |
Wed, 20 May 2020 00:49:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 05/19/20 20:20, Philippe Mathieu-Daudé wrote:
> Since our format is consumable by the fw_cfg device,
> we can implement the FW_CFG_DATA_GENERATOR interface.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> crypto/tls-cipher-suites.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
(1) s/product/produce/ in the subject line.
This patch looks OK to me otherwise (but I don't feel confident enough
to give an R-b):
Acked-by: Laszlo Ersek <address@hidden>
Thanks
Laszlo
>
> diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
> index c6c51359bd..11872783eb 100644
> --- a/crypto/tls-cipher-suites.c
> +++ b/crypto/tls-cipher-suites.c
> @@ -14,6 +14,7 @@
> #include "qemu/error-report.h"
> #include "crypto/tlscreds.h"
> #include "crypto/tls-cipher-suites.h"
> +#include "hw/nvram/fw_cfg.h"
>
> static void parse_cipher_suites(QCryptoTLSCipherSuites *s,
> const char *priority_name, Error **errp)
> @@ -101,11 +102,28 @@ static void qcrypto_tls_cipher_suites_finalize(Object
> *obj)
> g_free(s->cipher_list);
> }
>
> +static const void *qcrypto_tls_cipher_suites_get_data(Object *obj)
> +{
> + QCryptoTLSCipherSuites *s = QCRYPTO_TLS_CIPHER_SUITES(obj);
> +
> + return s->cipher_list;
> +}
> +
> +static size_t qcrypto_tls_cipher_suites_get_length(Object *obj)
> +{
> + QCryptoTLSCipherSuites *s = QCRYPTO_TLS_CIPHER_SUITES(obj);
> +
> + return s->cipher_count * sizeof(IANA_TLS_CIPHER);
> +}
> +
> static void qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
> {
> UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc);
> + FWCfgDataGeneratorClass *fwgc = FW_CFG_DATA_GENERATOR_CLASS(oc);
>
> ucc->complete = qcrypto_tls_cipher_suites_complete;
> + fwgc->get_data = qcrypto_tls_cipher_suites_get_data;
> + fwgc->get_length = qcrypto_tls_cipher_suites_get_length;
>
> object_class_property_add_bool(oc, "verbose",
> qcrypto_tls_cipher_suites_get_verbose,
> @@ -121,6 +139,7 @@ static const TypeInfo qcrypto_tls_cipher_suites_info = {
> .class_init = qcrypto_tls_cipher_suites_class_init,
> .interfaces = (InterfaceInfo[]) {
> { TYPE_USER_CREATABLE },
> + { TYPE_FW_CFG_DATA_GENERATOR_INTERFACE },
> { }
> }
> };
>
- [PATCH v6 0/5] fw_cfg: Add FW_CFG_DATA_GENERATOR; crypto: Add tls-cipher-suites, Philippe Mathieu-Daudé, 2020/05/19
- [PATCH v6 2/5] softmmu/vl: Let -fw_cfg option take a 'blob_id' argument, Philippe Mathieu-Daudé, 2020/05/19
- [PATCH v6 1/5] hw/nvram/fw_cfg: Add the FW_CFG_DATA_GENERATOR interface, Philippe Mathieu-Daudé, 2020/05/19
- [RFC PATCH v6 3/5] softmmu/vl: Allow -fw_cfg 'blob_id' option to set any file pathname, Philippe Mathieu-Daudé, 2020/05/19
- [PATCH v6 5/5] crypto/tls-cipher-suites: Product fw_cfg consumable blob, Philippe Mathieu-Daudé, 2020/05/19
- Re: [PATCH v6 5/5] crypto/tls-cipher-suites: Product fw_cfg consumable blob,
Laszlo Ersek <=
- [PATCH v6 4/5] crypto: Add tls-cipher-suites object, Philippe Mathieu-Daudé, 2020/05/19
- Re: [PATCH v6 0/5] fw_cfg: Add FW_CFG_DATA_GENERATOR; crypto: Add tls-cipher-suites, Philippe Mathieu-Daudé, 2020/05/27