diff mbox

[for-2.9,v2,1/7] qapi: crypto: add defination about HMAC algorithms

Message ID 1481530092-20240-2-git-send-email-longpeng2@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Longpeng(Mike) Dec. 12, 2016, 8:08 a.m. UTC
This patch introduce HMAC algorithms relevant defination, they will
be used by the following patch.

Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
---
 qapi/crypto.json | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Daniel P. Berrangé Dec. 12, 2016, 10:13 a.m. UTC | #1
On Mon, Dec 12, 2016 at 04:08:06PM +0800, Longpeng(Mike) wrote:
> This patch introduce HMAC algorithms relevant defination, they will
> be used by the following patch.
> 
> Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
> ---
>  qapi/crypto.json | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/qapi/crypto.json b/qapi/crypto.json
> index f4fd93b..e63862a 100644
> --- a/qapi/crypto.json
> +++ b/qapi/crypto.json
> @@ -55,6 +55,23 @@
>  
>  
>  ##
> +# @QCryptoHmacAlgorithm:
> +#
> +# The supported algorithms for hash-based message authentication code
> +#
> +# @md5: HMAC-MD5
> +# @sha1: HMAC-SHA1
> +# @sha256: HMAC-SHA256
> +# @sha512: HMAC-SHA512
> +#
> +# Since 2.9
> +##
> +{ 'enum': 'QCryptoHmacAlgorithm',
> +  'prefix': 'QCRYPTO_HMAC_ALG',
> +  'data': ['md5', 'sha1', 'sha256', 'sha512']}

There's not actually any concept of hmac algorithms - you have standard
hash algorithms used in the hmac calculation. IOW, you don't need to
add this enum. The hmac APIs should just use QCryptoHashAlgorithm as
their input.

Regards,
Daniel
diff mbox

Patch

diff --git a/qapi/crypto.json b/qapi/crypto.json
index f4fd93b..e63862a 100644
--- a/qapi/crypto.json
+++ b/qapi/crypto.json
@@ -55,6 +55,23 @@ 
 
 
 ##
+# @QCryptoHmacAlgorithm:
+#
+# The supported algorithms for hash-based message authentication code
+#
+# @md5: HMAC-MD5
+# @sha1: HMAC-SHA1
+# @sha256: HMAC-SHA256
+# @sha512: HMAC-SHA512
+#
+# Since 2.9
+##
+{ 'enum': 'QCryptoHmacAlgorithm',
+  'prefix': 'QCRYPTO_HMAC_ALG',
+  'data': ['md5', 'sha1', 'sha256', 'sha512']}
+
+
+##
 # @QCryptoCipherAlgorithm:
 #
 # The supported algorithms for content encryption ciphers