diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-08-24 10:46:08 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-09-04 13:09:13 +0200 |
commit | 977c736f80c232de7c6476d793ed575359c049d8 (patch) | |
tree | 986bf327e75929660aa367008574343e59818ee4 /crypto/block-luks.c | |
parent | 5b5f825d44306b18509cd10ba9ac6983e90d6e0f (diff) |
qapi: Mechanically convert FOO_lookup[...] to FOO_str(...)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-14-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'crypto/block-luks.c')
-rw-r--r-- | crypto/block-luks.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/block-luks.c b/crypto/block-luks.c index 84d189a426..4e828951d4 100644 --- a/crypto/block-luks.c +++ b/crypto/block-luks.c @@ -257,7 +257,7 @@ qcrypto_block_luks_cipher_alg_lookup(QCryptoCipherAlgorithm alg, } error_setg(errp, "Algorithm '%s' not supported", - QCryptoCipherAlgorithm_lookup[alg]); + QCryptoCipherAlgorithm_str(alg)); return NULL; } @@ -392,7 +392,7 @@ qcrypto_block_luks_essiv_cipher(QCryptoCipherAlgorithm cipher, break; default: error_setg(errp, "Cipher %s not supported with essiv", - QCryptoCipherAlgorithm_lookup[cipher]); + QCryptoCipherAlgorithm_str(cipher)); return 0; } } @@ -962,16 +962,16 @@ qcrypto_block_luks_create(QCryptoBlock *block, goto error; } - cipher_mode = QCryptoCipherMode_lookup[luks_opts.cipher_mode]; - ivgen_alg = QCryptoIVGenAlgorithm_lookup[luks_opts.ivgen_alg]; + cipher_mode = QCryptoCipherMode_str(luks_opts.cipher_mode); + ivgen_alg = QCryptoIVGenAlgorithm_str(luks_opts.ivgen_alg); if (luks_opts.has_ivgen_hash_alg) { - ivgen_hash_alg = QCryptoHashAlgorithm_lookup[luks_opts.ivgen_hash_alg]; + ivgen_hash_alg = QCryptoHashAlgorithm_str(luks_opts.ivgen_hash_alg); cipher_mode_spec = g_strdup_printf("%s-%s:%s", cipher_mode, ivgen_alg, ivgen_hash_alg); } else { cipher_mode_spec = g_strdup_printf("%s-%s", cipher_mode, ivgen_alg); } - hash_alg = QCryptoHashAlgorithm_lookup[luks_opts.hash_alg]; + hash_alg = QCryptoHashAlgorithm_str(luks_opts.hash_alg); if (strlen(cipher_alg) >= QCRYPTO_BLOCK_LUKS_CIPHER_NAME_LEN) { |