[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 7/8] tests/crypto: Add test suite for crypto akcipher
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v4 7/8] tests/crypto: Add test suite for crypto akcipher |
Date: |
Tue, 26 Apr 2022 12:57:05 +0100 |
User-agent: |
Mutt/2.1.5 (2021-12-30) |
On Mon, Apr 11, 2022 at 06:43:26PM +0800, zhenwei pi wrote:
> From: lei he <helei.sig11@bytedance.com>
>
> Add unit test and benchmark test for crypto akcipher.
>
> Signed-off-by: lei he <helei.sig11@bytedance.com>
> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
> ---
> tests/bench/benchmark-crypto-akcipher.c | 161 ++++++
> tests/bench/meson.build | 4 +
> tests/bench/test_akcipher_keys.inc | 537 ++++++++++++++++++
> tests/unit/meson.build | 1 +
> tests/unit/test-crypto-akcipher.c | 708 ++++++++++++++++++++++++
> 5 files changed, 1411 insertions(+)
> create mode 100644 tests/bench/benchmark-crypto-akcipher.c
> create mode 100644 tests/bench/test_akcipher_keys.inc
> create mode 100644 tests/unit/test-crypto-akcipher.c
>
> diff --git a/tests/bench/test_akcipher_keys.inc
> b/tests/bench/test_akcipher_keys.inc
> new file mode 100644
> index 0000000000..7adf218135
> --- /dev/null
> +++ b/tests/bench/test_akcipher_keys.inc
> @@ -0,0 +1,537 @@
> +/*
> + * Copyright (c) 2022 Bytedance, and/or its affiliates
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + *
> + * Author: lei he <helei.sig11@bytedance.com>
> + */
> +
> +/* RSA test keys, generated by OpenSSL */
> +static const uint8_t rsa1024_priv_key[] = {
> + 0x30, 0x82, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x02,
> + 0x81, 0x81, 0x00, 0xe6, 0x4d, 0x76, 0x4f, 0xb2,
snip
For the patch as is:
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
It could be nice to add another test with some intentionally corrupt
RSA keys with bad DER encoding, as a way to prove that we're handling
errors in DER decoding correctly when faced with malicous data from a
bad guest.
With 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 :|
- Re: [PATCH v4 2/8] crypto-akcipher: Introduce akcipher types to qapi, (continued)
- [PATCH v4 3/8] crypto: Introduce akcipher crypto class, zhenwei pi, 2022/04/11
- [PATCH v4 4/8] crypto: add ASN.1 decoder, zhenwei pi, 2022/04/11
- [PATCH v4 5/8] crypto: Implement RSA algorithm by hogweed, zhenwei pi, 2022/04/11
- [PATCH v4 6/8] crypto: Implement RSA algorithm by gcrypt, zhenwei pi, 2022/04/11
- [PATCH v4 7/8] tests/crypto: Add test suite for crypto akcipher, zhenwei pi, 2022/04/11
- Re: [PATCH v4 7/8] tests/crypto: Add test suite for crypto akcipher,
Daniel P . Berrangé <=
- [PATCH v4 8/8] crypto: Introduce RSA algorithm, zhenwei pi, 2022/04/11
- Re: [PATCH v4 0/8] Introduce akcipher service for virtio-crypto, Paolo Bonzini, 2022/04/12
- PING: [PATCH v4 0/8] Introduce akcipher service for virtio-crypto, zhenwei pi, 2022/04/20