summaryrefslogtreecommitdiff
path: root/crypto/cipher-builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cipher-builtin.c')
-rw-r--r--crypto/cipher-builtin.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
index 88963f65c8..9d258428b0 100644
--- a/crypto/cipher-builtin.c
+++ b/crypto/cipher-builtin.c
@@ -244,7 +244,8 @@ static int qcrypto_cipher_init_aes(QCryptoCipher *cipher,
if (cipher->mode != QCRYPTO_CIPHER_MODE_CBC &&
cipher->mode != QCRYPTO_CIPHER_MODE_ECB &&
cipher->mode != QCRYPTO_CIPHER_MODE_XTS) {
- error_setg(errp, "Unsupported cipher mode %d", cipher->mode);
+ error_setg(errp, "Unsupported cipher mode %s",
+ QCryptoCipherMode_lookup[cipher->mode]);
return -1;
}
@@ -376,7 +377,8 @@ static int qcrypto_cipher_init_des_rfb(QCryptoCipher *cipher,
QCryptoCipherBuiltin *ctxt;
if (cipher->mode != QCRYPTO_CIPHER_MODE_ECB) {
- error_setg(errp, "Unsupported cipher mode %d", cipher->mode);
+ error_setg(errp, "Unsupported cipher mode %s",
+ QCryptoCipherMode_lookup[cipher->mode]);
return -1;
}
@@ -442,7 +444,8 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
break;
default:
error_setg(errp,
- "Unsupported cipher algorithm %d", cipher->alg);
+ "Unsupported cipher algorithm %s",
+ QCryptoCipherAlgorithm_lookup[cipher->alg]);
goto error;
}