diff options
author | Alexey Krasikov | 2020-05-25 13:16:53 +0200 |
---|---|---|
committer | Daniel P. Berrangé | 2020-06-15 12:33:51 +0200 |
commit | 4862bd3cd2052f1b48e4d08b1820e70a255c4859 (patch) | |
tree | ad696bc5410d64bd168618bd685fdbdd7a9de774 /include/crypto/secret.h | |
parent | crypto: add "none" random provider (diff) | |
download | qemu-4862bd3cd2052f1b48e4d08b1820e70a255c4859.tar.gz qemu-4862bd3cd2052f1b48e4d08b1820e70a255c4859.tar.xz qemu-4862bd3cd2052f1b48e4d08b1820e70a255c4859.zip |
crypto/secret: move main logic from 'secret' to 'secret_common'.
Create base class 'common secret'. Move common data and logic from
'secret' to 'common_secret' class. This allowed adding abstraction layer
for easier adding new 'secret' objects in future.
Convert 'secret' class to child from basic 'secret_common' with 'data'
and 'file' properties.
Signed-off-by: Alexey Krasikov <alex-krasikov@yandex-team.ru>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'include/crypto/secret.h')
-rw-r--r-- | include/crypto/secret.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/include/crypto/secret.h b/include/crypto/secret.h index 5e07e29bae..2deb461d2f 100644 --- a/include/crypto/secret.h +++ b/include/crypto/secret.h @@ -23,6 +23,7 @@ #include "qapi/qapi-types-crypto.h" #include "qom/object.h" +#include "crypto/secret_common.h" #define TYPE_QCRYPTO_SECRET "secret" #define QCRYPTO_SECRET(obj) \ @@ -119,29 +120,14 @@ typedef struct QCryptoSecretClass QCryptoSecretClass; */ struct QCryptoSecret { - Object parent_obj; - uint8_t *rawdata; - size_t rawlen; - QCryptoSecretFormat format; + QCryptoSecretCommon parent_obj; char *data; char *file; - char *keyid; - char *iv; }; struct QCryptoSecretClass { - ObjectClass parent_class; + QCryptoSecretCommonClass parent_class; }; - -extern int qcrypto_secret_lookup(const char *secretid, - uint8_t **data, - size_t *datalen, - Error **errp); -extern char *qcrypto_secret_lookup_as_utf8(const char *secretid, - Error **errp); -extern char *qcrypto_secret_lookup_as_base64(const char *secretid, - Error **errp); - #endif /* QCRYPTO_SECRET_H */ |