* [PATCH v1 0/4] TPM2: select hash algorithm for a trusted key
@ 2015-10-29 15:59 Jarkko Sakkinen
2015-10-29 15:59 ` [PATCH v1 1/4] crypto: add entry for sm3-256 Jarkko Sakkinen
0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Sakkinen @ 2015-10-29 15:59 UTC (permalink / raw)
To: Peter Huewe, Marcel Selhorst, Mimi Zohar, David Howells
Cc: tpmdd-devel, linux-kernel, linux-security-module, keyrings,
chris.j.arges, seth.forshee, colin.king, josh, Jarkko Sakkinen,
Jason Gunthorpe, open list:ABI/API, open list:CRYPTO API,
open list:DOCUMENTATION
Jarkko Sakkinen (4):
crypto: add entry for sm3-256
tpm: choose hash algorithm for sealing when using TPM 2.0
keys, trusted: select the hash algorithm
keys, trusted: update documentation for 'hash=' option
Documentation/security/keys-trusted-encrypted.txt | 3 ++
crypto/hash_info.c | 2 ++
drivers/char/tpm/tpm.h | 10 ++++--
drivers/char/tpm/tpm2-cmd.c | 42 +++++++++++++++++++++--
include/crypto/hash_info.h | 3 ++
include/keys/trusted-type.h | 1 +
include/uapi/linux/hash_info.h | 1 +
security/keys/trusted.c | 20 ++++++++++-
8 files changed, 75 insertions(+), 7 deletions(-)
--
2.5.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v1 1/4] crypto: add entry for sm3-256
2015-10-29 15:59 [PATCH v1 0/4] TPM2: select hash algorithm for a trusted key Jarkko Sakkinen
@ 2015-10-29 15:59 ` Jarkko Sakkinen
0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Sakkinen @ 2015-10-29 15:59 UTC (permalink / raw)
To: Peter Huewe, Marcel Selhorst, Mimi Zohar, David Howells
Cc: tpmdd-devel, linux-kernel, linux-security-module, keyrings,
chris.j.arges, seth.forshee, colin.king, josh, Jarkko Sakkinen,
Herbert Xu, David S. Miller, open list:CRYPTO API,
open list:ABI/API
Added entry for sm3-256 to the following tables:
* hash_algo_name
* hash_digest_size
Needed for TPM 2.0 trusted key sealing.
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
crypto/hash_info.c | 2 ++
include/crypto/hash_info.h | 3 +++
include/uapi/linux/hash_info.h | 1 +
3 files changed, 6 insertions(+)
diff --git a/crypto/hash_info.c b/crypto/hash_info.c
index 3e7ff46..6f3a113 100644
--- a/crypto/hash_info.c
+++ b/crypto/hash_info.c
@@ -31,6 +31,7 @@ const char *const hash_algo_name[HASH_ALGO__LAST] = {
[HASH_ALGO_TGR_128] = "tgr128",
[HASH_ALGO_TGR_160] = "tgr160",
[HASH_ALGO_TGR_192] = "tgr192",
+ [HASH_ALGO_SM3_256] = "sm3-256",
};
EXPORT_SYMBOL_GPL(hash_algo_name);
@@ -52,5 +53,6 @@ const int hash_digest_size[HASH_ALGO__LAST] = {
[HASH_ALGO_TGR_128] = TGR128_DIGEST_SIZE,
[HASH_ALGO_TGR_160] = TGR160_DIGEST_SIZE,
[HASH_ALGO_TGR_192] = TGR192_DIGEST_SIZE,
+ [HASH_ALGO_SM3_256] = SM3_256_DIGEST_SIZE,
};
EXPORT_SYMBOL_GPL(hash_digest_size);
diff --git a/include/crypto/hash_info.h b/include/crypto/hash_info.h
index e1e5a3e..d86e050 100644
--- a/include/crypto/hash_info.h
+++ b/include/crypto/hash_info.h
@@ -34,6 +34,9 @@
#define TGR160_DIGEST_SIZE 20
#define TGR192_DIGEST_SIZE 24
+/* not defined in include/crypto/ */
+#define SM3_256_DIGEST_SIZE 32
+
extern const char *const hash_algo_name[HASH_ALGO__LAST];
extern const int hash_digest_size[HASH_ALGO__LAST];
diff --git a/include/uapi/linux/hash_info.h b/include/uapi/linux/hash_info.h
index ca18c45..ebf8fd8 100644
--- a/include/uapi/linux/hash_info.h
+++ b/include/uapi/linux/hash_info.h
@@ -31,6 +31,7 @@ enum hash_algo {
HASH_ALGO_TGR_128,
HASH_ALGO_TGR_160,
HASH_ALGO_TGR_192,
+ HASH_ALGO_SM3_256,
HASH_ALGO__LAST
};
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-29 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29 15:59 [PATCH v1 0/4] TPM2: select hash algorithm for a trusted key Jarkko Sakkinen
2015-10-29 15:59 ` [PATCH v1 1/4] crypto: add entry for sm3-256 Jarkko Sakkinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).