Skip to contentSkip to conversation

encrypted-keys: remove trusted-keys dependency

PATCH In review Mimi Zohar 2 participants 4 messages Aug 29, 2011

Subsystems (5)
lore
Share & tools
lore

Mimi Zohar

author
#0 lore raw

PATCH 1/2 encrypted-keys: remove trusted-keys dependency

Encrypted keys are decrypted/encrypted using either a trusted-key or, for those systems without a TPM, a user-defined key. This patch removes the trusted-keys and TCG_TPM dependencies.

Changelog v1:
- Fixed encrypted-keys move from security/keys to security/keys/encrypted-keys
- Removed trailing blank line

---
 security/Kconfig                                 |    4 +-
 security/keys/Makefile                           |    2 +-
 security/keys/ecryptfs_format.c                  |   81 --
 security/keys/ecryptfs_format.h                  |   30 -
 security/keys/encrypted-keys/Makefile            |    6 +
 security/keys/encrypted-keys/ecryptfs_format.c   |   81 ++
 security/keys/encrypted-keys/ecryptfs_format.h   |   30 +
 security/keys/encrypted-keys/encrypted.c         | 1030 +++++++++++++++++++++
 security/keys/encrypted-keys/encrypted.h         |   65 ++
 security/keys/encrypted-keys/masterkey_trusted.c |   44 +
 security/keys/encrypted.c                        | 1049 ----------------------
 security/keys/encrypted.h                        |   54 --
 12 files changed, 1260 insertions(+), 1216 deletions(-)
 delete mode 100644 security/keys/ecryptfs_format.c
 delete mode 100644 security/keys/ecryptfs_format.h
 create mode 100644 security/keys/encrypted-keys/Makefile
 create mode 100644 security/keys/encrypted-keys/ecryptfs_format.c
 create mode 100644 security/keys/encrypted-keys/ecryptfs_format.h
 create mode 100644 security/keys/encrypted-keys/encrypted.c
 create mode 100644 security/keys/encrypted-keys/encrypted.h
 create mode 100644 security/keys/encrypted-keys/masterkey_trusted.c
 delete mode 100644 security/keys/encrypted.c
 delete mode 100644 security/keys/encrypted.h
security/Kconfig +3 -1
index 22847a8..51bd5a0 100644
@@ -38,7 +38,9 @@ config TRUSTED_KEYS
 
 config ENCRYPTED_KEYS
 	tristate "ENCRYPTED KEYS"
-	depends on KEYS && TRUSTED_KEYS
+	depends on KEYS
+	select CRYPTO
+	select CRYPTO_HMAC
 	select CRYPTO_AES
 	select CRYPTO_CBC
 	select CRYPTO_SHA256
security/keys/Makefile +1 -1
index b34cc6e..a56f1ff 100644
@@ -14,7 +14,7 @@ obj-y := \
 	user_defined.o
 
 obj-$(CONFIG_TRUSTED_KEYS) += trusted.o
-obj-$(CONFIG_ENCRYPTED_KEYS) += ecryptfs_format.o encrypted.o
+obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted-keys/
 obj-$(CONFIG_KEYS_COMPAT) += compat.o
 obj-$(CONFIG_PROC_FS) += proc.o
 obj-$(CONFIG_SYSCTL) += sysctl.o
security/keys/ecryptfs_format.c deleted +0 -81

81 lines not on this page · raw message

security/keys/ecryptfs_format.h deleted +0 -30
deleted file mode 100644
index 40294de..0000000
@@ -1,30 +0,0 @@
-/*
- * ecryptfs_format.h: helper functions for the encrypted key type
- *
- * Copyright (C) 2006 International Business Machines Corp.
- * Copyright (C) 2010 Politecnico di Torino, Italy
- *                    TORSEC group -- http://security.polito.it
- *
- * Authors:
- * Michael A. Halcrow <[email protected]>
- * Tyler Hicks <[email protected]>
- * Roberto Sassu <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 2 of the License.
- */
-
-#ifndef __KEYS_ECRYPTFS_H
-#define __KEYS_ECRYPTFS_H
-
-#include <linux/ecryptfs.h>
-
-#define PGP_DIGEST_ALGO_SHA512   10
-
-u8 *ecryptfs_get_auth_tok_key(struct ecryptfs_auth_tok *auth_tok);
-void ecryptfs_get_versions(int *major, int *minor, int *file_version);
-int ecryptfs_fill_auth_tok(struct ecryptfs_auth_tok *auth_tok,
-			   const char *key_desc);
-
-#endif /* __KEYS_ECRYPTFS_H */
security/keys/encrypted-keys/Makefile new file +6 -0
new file mode 100644
index 0000000..6bc7a86
@@ -0,0 +1,6 @@
+#
+# Makefile for encrypted keys
+#
+
+obj-$(CONFIG_ENCRYPTED_KEYS) += encrypted.o ecryptfs_format.o
+obj-$(CONFIG_TRUSTED_KEYS) += masterkey_trusted.o
security/keys/encrypted-keys/ecryptfs_format.c new file +81 -0

81 lines not on this page · raw message

security/keys/encrypted-keys/ecryptfs_format.h new file +30 -0
new file mode 100644
index 0000000..40294de
@@ -0,0 +1,30 @@
+/*
+ * ecryptfs_format.h: helper functions for the encrypted key type
+ *
+ * Copyright (C) 2006 International Business Machines Corp.
+ * Copyright (C) 2010 Politecnico di Torino, Italy
+ *                    TORSEC group -- http://security.polito.it
+ *
+ * Authors:
+ * Michael A. Halcrow <[email protected]>
+ * Tyler Hicks <[email protected]>
+ * Roberto Sassu <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2 of the License.
+ */
+
+#ifndef __KEYS_ECRYPTFS_H
+#define __KEYS_ECRYPTFS_H
+
+#include <linux/ecryptfs.h>
+
+#define PGP_DIGEST_ALGO_SHA512   10
+
+u8 *ecryptfs_get_auth_tok_key(struct ecryptfs_auth_tok *auth_tok);
+void ecryptfs_get_versions(int *major, int *minor, int *file_version);
+int ecryptfs_fill_auth_tok(struct ecryptfs_auth_tok *auth_tok,
+			   const char *key_desc);
+
+#endif /* __KEYS_ECRYPTFS_H */
security/keys/encrypted-keys/encrypted.c new file +1030 -0

1,030 lines not on this page · raw message

security/keys/encrypted-keys/encrypted.h new file +65 -0

65 lines not on this page · raw message

security/keys/encrypted-keys/masterkey_trusted.c new file +44 -0

44 lines not on this page · raw message

security/keys/encrypted.c deleted +0 -1049

1,049 lines not on this page · raw message

security/keys/encrypted.h deleted +0 -54

54 lines not on this page · raw message

Signature · 1 line
1.7.3.4
author
#1 lore raw

PATCH 2/2 evm: remove TCG_TPM dependency

All tristates selected by EVM(boolean) are forced to be builtin, except in the TCG_TPM(tristate) dependency case. Arnaud Lacombe summarizes the Kconfig bug as, "So it would seem direct dependency state influence the state of reverse dependencies.." For a detailed explanation, refer to Arnaud Lacombe's posting http://lkml.org/lkml/2011/8/23/498.

With the "encrypted-keys: remove trusted-keys dependency" patch, EVM can now be built without a dependency on TCG_TPM. The trusted-keys dependency requires trusted-keys to either be builtin or not selected. This dependency will prevent the boolean/tristate mismatch from occuring.

Randy Dunlap <rdunlap@xenotimenet>

---
 security/integrity/evm/Kconfig |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
security/integrity/evm/Kconfig +1 -2
index 884617d..afbb59d 100644
@@ -1,11 +1,10 @@
 config EVM
 	boolean "EVM support"
-	depends on SECURITY && KEYS && TCG_TPM
+	depends on SECURITY && KEYS && (TRUSTED_KEYS=y || TRUSTED_KEYS=n)
 	select CRYPTO_HMAC
 	select CRYPTO_MD5
 	select CRYPTO_SHA1
 	select ENCRYPTED_KEYS
-	select TRUSTED_KEYS
 	default n
 	help
 	  EVM protects a file's security extended attributes against
Signature · 1 line
1.7.3.4
#2 lore raw
In reply to Mimi Zohar
Quoted 10 lines · Mimi Zohar

Encrypted keys are decrypted/encrypted using either a trusted-key or, for those systems without a TPM, a user-defined key. This patch removes the trusted-keys and TCG_TPM dependencies.

Changelog v1:
- Fixed encrypted-keys move from security/keys to security/keys/encrypted-keys
- Removed trailing blank line

---

Please look into using 'git mv' and the '--find-renames' option of git format-patch.

You just want to mark the files as moved, without ruining the entire history of the old files.

Signature · 1 line
Sasha.
author
#3 lore raw
Quoted 9 lines · Sasha Levin
Quoted 8 lines · Mimi Zohar

Encrypted keys are decrypted/encrypted using either a trusted-key or, for those systems without a TPM, a user-defined key. This patch removes the trusted-keys and TCG_TPM dependencies.

Changelog v1:
- Fixed encrypted-keys move from security/keys to security/keys/encrypted-keys
- Removed trailing blank line

Quoted 9 lines
Quoted 2 lines

---

Please look into using 'git mv' and the '--find-renames' option of git format-patch.

You just want to mark the files as moved, without ruining the entire history of the old files.

Thanks for the tip. 'git blame' shows multiple commits, but perhaps if encrypted-keys had a longer history some of it would have been lost. I'll keep your suggestion in mind in the future.

thanks,

Mimi