summary refs log tree commit diff stats
path: root/include/crypto/secret.h
diff options
context:
space:
mode:
authorAlexey Krasikov <alex-krasikov@yandex-team.ru>2020-05-25 14:16:53 +0300
committerDaniel P. Berrangé <berrange@redhat.com>2020-06-15 11:33:51 +0100
commit4862bd3cd2052f1b48e4d08b1820e70a255c4859 (patch)
treead696bc5410d64bd168618bd685fdbdd7a9de774 /include/crypto/secret.h
parentb767d2578da4a46ff5e353f14da6364b97df1020 (diff)
downloadfocaccia-qemu-4862bd3cd2052f1b48e4d08b1820e70a255c4859.tar.gz
focaccia-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.h20
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 */