Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3572404ioo; Wed, 25 May 2022 03:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKl1z0htavTFsL/TgPksWvZjz/u3AzgKjKDabGaVdpmomX4qTUvmJuJaqbnNneJcQol2h/ X-Received: by 2002:a17:902:cf42:b0:161:f01e:76f8 with SMTP id e2-20020a170902cf4200b00161f01e76f8mr25972811plg.159.1653475609610; Wed, 25 May 2022 03:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653475609; cv=none; d=google.com; s=arc-20160816; b=Y/fSXmKkTSuWKvriU+34oTcFFAkfvgHxRIa5Rpbj4brgL7QkDAQriTGXeoFqAqHK/X seUZUru5H3s37IWDxkNuDPkE4gLANUzW0GUjrdBbfZpb4kN52WYcuFeawvmxlua9+UoR VuDUF/mYudUuTx0g1f6/nJcuGg+r0SD88q4K9HyvPorJWCwhmVl7HBA3c1MzAjVsP4Qh BOEQK794OzBN8kriLEkbw0pxdg3xED7KN0LoucV5H1Up/dxr6Q8Ww0UnblCLPtS91Ox2 7lDVZiMuM+yBRZREl8WMtfQngp8ebzJrz3pboemPQjr6sPihKgLhebaEoAOK9PtPkKzn LFyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uCoch/x6X6GaFx847RkiWvXsBs1288biCvAs5otO4gM=; b=uoDmg7eHkWeytYVi0n74GtY20T7fPPlwOWPET7WimoHGH18PpJHWTa9s55A9+b01GD r+5FbzjtkSmODFxnVQ+eikDu1/KYxoCNw5z7Akzw4CE42sbbBMLW9esKXY1TAvaLYPt3 adAwvvy8o6k+0/rSV9nrrThwgkHIB5PNwF9iQXOf5ftHPOuR7kOHwPCAGtPQkM7+9ONj VjnBNhjlBwpasaPCt4jdeFfPVOtO+G3I0rdCVhSiZSRCGfnuGslqwJYqhbsLCxkHt38x Pji9aDbjyzr/o8V3rc4Ikr57yDOIX5CllPppb0OvV6bRVrHR4U98F6w7Xv51ycRKLHJE Etcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=aobJVulB; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lp1-20020a17090b4a8100b001e0bba26332si740344pjb.168.2022.05.25.03.46.21; Wed, 25 May 2022 03:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=aobJVulB; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241165AbiEYJDg (ORCPT + 99 others); Wed, 25 May 2022 05:03:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241136AbiEYJD2 (ORCPT ); Wed, 25 May 2022 05:03:28 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 690C89159C for ; Wed, 25 May 2022 02:02:25 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-f2a4c51c45so4256809fac.9 for ; Wed, 25 May 2022 02:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uCoch/x6X6GaFx847RkiWvXsBs1288biCvAs5otO4gM=; b=aobJVulBOZzcbpVKDzF2ZVCsT4tWetifPDFEjXyUcOdrdlqY6JaT3Kw5A4SNzdypem aH/r9nAlH9P1+2l48EUJ7RDvT0eCvPHRfl3qHFrJsk81/OSXQk8QMXpMTm6NEvsh5hiQ xTZI+k+LWFjzliO6m91SJyORyMA1RW7sBnENCuoILlnes+GZ9h//ZcThuN17Su31M1// kazkc8RHdpsWsZmQ6Q++tBXjziTNtxWAeviOq7sdb6kPBrTaGwbVqAOE32u646fLyhmW RHXo5JAqAmPBHcvxaae7q96PtVrnQ08hIMdytg7ka9eyHjfLuotje8Y73QeIUZPZSvUu ybyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uCoch/x6X6GaFx847RkiWvXsBs1288biCvAs5otO4gM=; b=tzag3J5alFuOgoWnvIsdBSsDSwzthki0N6ehwKkMGLrb8mb/Vh0zI+48Uq6XZO2E2q BA0FppWoGEM7MEtLqNlqBxbarb2yEwAiuQaUn/gVxbGQyWl2Q/UFVVSQsOmKsD+diPTM 0TqTTnMbUx8HKNv6qRrWz0neKOqlEkCSQh7QdEbZWMTXPQPFxsjB7W4AqJEVcDHXl4ee nMPDtIdT/fL+73xwfALS9rnuMxuaW19lPeu+jqrxOM+w70UXeLiBMfCyz8AqQ3OnFrBm XZx0xMP8tgi/HVqIEXZz5BUkw3xbbg7c9OH3vfxUhsBDjh2gVRo5/d99va0EJR7u+kGZ 5BUg== X-Gm-Message-State: AOAM532xn/5TIF0McTaMpa1LKCl9vpaGfpZkuufZnpxvYwyc2wIx2ZrX YYnzYBCEhVNYljHYv4+c7QsMZqAyc0rNxw== X-Received: by 2002:a17:90b:4b4b:b0:1dc:8724:3f75 with SMTP id mi11-20020a17090b4b4b00b001dc87243f75mr9161069pjb.178.1653469327588; Wed, 25 May 2022 02:02:07 -0700 (PDT) Received: from FVFDK26JP3YV.usts.net ([139.177.225.226]) by smtp.gmail.com with ESMTPSA id b10-20020a17090a6aca00b001deb92de665sm1015424pjm.46.2022.05.25.02.02.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 May 2022 02:02:07 -0700 (PDT) From: Lei He To: mst@redhat.com, arei.gonglei@huawei.com, berrange@redhat.com Cc: qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, linux-crypto@vger.kernel.org, jasowang@redhat.com, cohuck@redhat.com, pizhenwei@bytedance.com, helei.sig11@bytedance.com Subject: [PATCH 2/9] qapi: crypto-akcipher: Introduce akcipher types to qapi Date: Wed, 25 May 2022 17:01:11 +0800 Message-Id: <20220525090118.43403-3-helei.sig11@bytedance.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220525090118.43403-1-helei.sig11@bytedance.com> References: <20220525090118.43403-1-helei.sig11@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Introduce akcipher types, also include RSA related types. Reviewed-by: Daniel P. Berrangé Signed-off-by: Lei He Signed-off-by: zhenwei pi --- qapi/crypto.json | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/qapi/crypto.json b/qapi/crypto.json index 1ec54c15ca..f7bb9a42d0 100644 --- a/qapi/crypto.json +++ b/qapi/crypto.json @@ -540,3 +540,67 @@ 'data': { '*loaded': { 'type': 'bool', 'features': ['deprecated'] }, '*sanity-check': 'bool', '*passwordid': 'str' } } +## +# @QCryptoAkCipherAlgorithm: +# +# The supported algorithms for asymmetric encryption ciphers +# +# @rsa: RSA algorithm +# +# Since: 7.1 +## +{ 'enum': 'QCryptoAkCipherAlgorithm', + 'prefix': 'QCRYPTO_AKCIPHER_ALG', + 'data': ['rsa']} + +## +# @QCryptoAkCipherKeyType: +# +# The type of asymmetric keys. +# +# Since: 7.1 +## +{ 'enum': 'QCryptoAkCipherKeyType', + 'prefix': 'QCRYPTO_AKCIPHER_KEY_TYPE', + 'data': ['public', 'private']} + +## +# @QCryptoRSAPaddingAlgorithm: +# +# The padding algorithm for RSA. +# +# @raw: no padding used +# @pkcs1: pkcs1#v1.5 +# +# Since: 7.1 +## +{ 'enum': 'QCryptoRSAPaddingAlgorithm', + 'prefix': 'QCRYPTO_RSA_PADDING_ALG', + 'data': ['raw', 'pkcs1']} + +## +# @QCryptoAkCipherOptionsRSA: +# +# Specific parameters for RSA algorithm. +# +# @hash-alg: QCryptoHashAlgorithm +# @padding-alg: QCryptoRSAPaddingAlgorithm +# +# Since: 7.1 +## +{ 'struct': 'QCryptoAkCipherOptionsRSA', + 'data': { 'hash-alg':'QCryptoHashAlgorithm', + 'padding-alg': 'QCryptoRSAPaddingAlgorithm'}} + +## +# @QCryptoAkCipherOptions: +# +# The options that are available for all asymmetric key algorithms +# when creating a new QCryptoAkCipher. +# +# Since: 7.1 +## +{ 'union': 'QCryptoAkCipherOptions', + 'base': { 'alg': 'QCryptoAkCipherAlgorithm' }, + 'discriminator': 'alg', + 'data': { 'rsa': 'QCryptoAkCipherOptionsRSA' }} -- 2.11.0