[PATCH v4 2/3] crypto/linux_keyring: add 'secret_keyring' secret object.

2020-05-25 Thread Alexey Krasikov
to instantiate the key and make sure the QEMU process has access permissions to read it. Signed-off-by: Alexey Krasikov Reviewed-by: Daniel P. Berrangé --- configure | 38 crypto/Makefile.objs| 1 + crypto/secret_keyring.c | 148

[PATCH v4 3/3] test-crypto-secret: add 'secret_keyring' object tests.

2020-05-25 Thread Alexey Krasikov
will be skipped in this case. Signed-off-by: Alexey Krasikov --- configure | 24 ++ tests/Makefile.include | 4 + tests/test-crypto-secret.c | 158 + 3 files changed, 186 insertions(+) diff --git a/configure b/configure index 3c83504c95

[PATCH v4 1/3] crypto/secret: move main logic from 'secret' to 'secret_common'.

2020-05-25 Thread Alexey Krasikov
-by: Alexey Krasikov --- crypto/Makefile.objs | 1 + crypto/secret.c| 347 +--- crypto/secret_common.c | 403 + include/crypto/secret.h| 20 +- include/crypto/secret_common.h | 68 ++ 5 files

[PATCH v4 0/3] Add secret_keyring object

2020-05-25 Thread Alexey Krasikov
- removed the 'linux/keyctl.h' include from configure keyutils test; - temporary added 'g_test_skip()' at start of the metod 'test_secret_keyring_bad_key_access_right()'. Alexey Krasikov (3): crypto/secret: move main logic from 'secret' to 'secret_common'. crypto/linux_keyring: add 'secret_keyri

[PATCH v3 1/3] crypto/secret: move main logic from 'secret' to 'secret_common'.

2020-05-18 Thread Alexey Krasikov
-by: Alexey Krasikov --- crypto/Makefile.objs | 1 + crypto/secret.c| 351 +--- crypto/secret_common.c | 407 + include/crypto/secret.h| 20 +- include/crypto/secret_common.h | 68 ++ 5 files

[PATCH v3 3/3] test-crypto-secret: add 'secret_keyring' object tests.

2020-05-18 Thread Alexey Krasikov
will be skipped in this case. Signed-off-by: Alexey Krasikov --- configure | 25 ++ tests/Makefile.include | 4 + tests/test-crypto-secret.c | 154 + 3 files changed, 183 insertions(+) diff --git a/configure b/configure index 1bae5ec0a1

[PATCH v3 2/3] crypto/linux_keyring: add 'secret_keyring' secret object.

2020-05-18 Thread Alexey Krasikov
to instantiate the key and make sure the QEMU process has access permissions to read it. Signed-off-by: Alexey Krasikov --- configure | 38 crypto/Makefile.objs| 1 + crypto/secret_keyring.c | 148 include/crypto

[PATCH v3 0/3] Add secret_keyring object

2020-05-18 Thread Alexey Krasikov
to provide this feature. Example: $QEMU -object secret_keyring,id=sec0,serial=0x15968230 Alexey Krasikov (3): crypto/secret: move main logic from 'secret' to 'secret_common'. crypto/linux_keyring: add 'secret_keyring' secret object. test-crypto-secret: add 'secret_keyring' object tests

[RFC PATCH v2 2/5] crypto/secret_interface: conversion to common basic class.

2020-04-15 Thread Alexey Krasikov
* Remove individual option fields. Common field have been left. Signed-off-by: Alexey Krasikov --- crypto/Makefile.objs | 1 + crypto/secret_interface.c | 156 ++ include/crypto/secret_interface.h | 119 --- 3 files changed

[RFC PATCH v2 3/5] crypto/secret: add secret class files.

2020-04-15 Thread Alexey Krasikov
* Add child 'secret' class from basic 'secret_common' with 'data' and 'file' properties. Signed-off-by: Alexey Krasikov --- crypto/secret.c | 167 include/crypto/secret.h | 133 2 files changed, 300 insertions

[RFC PATCH v2 4/5] crypto/linux_keyring: add 'syskey' secret object.

2020-04-15 Thread Alexey Krasikov
need to instantiate the key and make sure the QEMU process has access rights to read it. Signed-off-by: Alexey Krasikov --- crypto/Makefile.objs | 1 + crypto/linux_keyring.c | 140 + include/crypto/linux_keyring.h | 38 + 3 files

[RFC PATCH v2 1/5] crypto/secret: rename to secret_interface.

2020-04-15 Thread Alexey Krasikov
* Rename for future division into subclasses. Most part of the interface will remain in basic common class. Signed-off-by: Alexey Krasikov --- crypto/{secret.c => secret_interface.c} | 0 include/crypto/{secret.h => secret_interface.h} | 0 2 files changed, 0 insertions

[RFC PATCH v2 5/5] test-crypto-secret: add 'syskey' object tests.

2020-04-15 Thread Alexey Krasikov
* test_secret_seckey_bad_key_access_right() is not working yet. We don't know yet if this due a bag in the Linux kernel or whether it's normal syscall behavior. We've requested information from kernel maintainer. Signed-off-by: Alexey Krasikov --- tests/test-crypto-secret.c | 138

[PATCH 1/2] crypto/secret: fix inconsequential errors.

2020-04-15 Thread Alexey Krasikov
* change condition from QCRYPTO_SECRET_FORMAT_RAW to QCRYPTO_SECRET_FORMAT_BASE64 in if-operator, because this is potencial error if you add another format value. Signed-off-by: Alexey Krasikov --- crypto/secret.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto

[PATCH 2/2] crypto/secret: fix return logic of crypto_secret_prop_get_loaded()

2020-04-15 Thread Alexey Krasikov
* Get function returned value of properties 'data' insteed of returning value of raw data internal field. This error did not affect anyone, because no one called the get function. Signed-off-by: Alexey Krasikov --- crypto/secret.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[RFC PATCH] crypto/secret: support fetching secrets from Linux keyring

2020-03-28 Thread Alexey Krasikov
to instantiate the key and make sure the QEMU process has access rights to read it. Signed-off-by: Alexey Krasikov --- crypto/secret.c | 88 +++-- include/crypto/secret.h | 3 ++ 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/crypto/secret.c