mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qapi/crypto: Drop unwanted 'prefix'
QAPI's 'prefix' feature can make the connection between enumeration type and its constants less than obvious. It's best used with restraint. QCryptoAkCipherKeyType has a 'prefix' that overrides the generated enumeration constants' prefix to QCRYPTO_AKCIPHER_KEY_TYPE. Drop it. The prefix becomes QCRYPTO_AK_CIPHER_KEY_TYPE. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20240904111836.3273842-11-armbru@redhat.com>
This commit is contained in:
parent
32cfefb904
commit
5f4059ef33
9 changed files with 32 additions and 33 deletions
|
@ -85,7 +85,7 @@ static int qcrypto_gcrypt_parse_rsa_private_key(
|
|||
const uint8_t *key, size_t keylen, Error **errp)
|
||||
{
|
||||
g_autoptr(QCryptoAkCipherRSAKey) rsa_key = qcrypto_akcipher_rsakey_parse(
|
||||
QCRYPTO_AKCIPHER_KEY_TYPE_PRIVATE, key, keylen, errp);
|
||||
QCRYPTO_AK_CIPHER_KEY_TYPE_PRIVATE, key, keylen, errp);
|
||||
gcry_mpi_t n = NULL, e = NULL, d = NULL, p = NULL, q = NULL, u = NULL;
|
||||
bool compute_mul_inv = false;
|
||||
int ret = -1;
|
||||
|
@ -178,7 +178,7 @@ static int qcrypto_gcrypt_parse_rsa_public_key(QCryptoGcryptRSA *rsa,
|
|||
{
|
||||
|
||||
g_autoptr(QCryptoAkCipherRSAKey) rsa_key = qcrypto_akcipher_rsakey_parse(
|
||||
QCRYPTO_AKCIPHER_KEY_TYPE_PUBLIC, key, keylen, errp);
|
||||
QCRYPTO_AK_CIPHER_KEY_TYPE_PUBLIC, key, keylen, errp);
|
||||
gcry_mpi_t n = NULL, e = NULL;
|
||||
int ret = -1;
|
||||
gcry_error_t err;
|
||||
|
@ -540,13 +540,13 @@ static QCryptoGcryptRSA *qcrypto_gcrypt_rsa_new(
|
|||
rsa->akcipher.driver = &gcrypt_rsa;
|
||||
|
||||
switch (type) {
|
||||
case QCRYPTO_AKCIPHER_KEY_TYPE_PRIVATE:
|
||||
case QCRYPTO_AK_CIPHER_KEY_TYPE_PRIVATE:
|
||||
if (qcrypto_gcrypt_parse_rsa_private_key(rsa, key, keylen, errp) != 0) {
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
|
||||
case QCRYPTO_AKCIPHER_KEY_TYPE_PUBLIC:
|
||||
case QCRYPTO_AK_CIPHER_KEY_TYPE_PUBLIC:
|
||||
if (qcrypto_gcrypt_parse_rsa_public_key(rsa, key, keylen, errp) != 0) {
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue