summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagendra modadugu <ngm@google.com>2016-01-28 16:04:02 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-29 22:44:37 -0800
commitcddf3c05dad6bf129b3debf36d5912b3509e47c4 (patch)
tree5ba92d343e221c87ec9d828b02632d2025567e13
parentbca1ba350f58c16c1749631ba4cfc6d0de84243d (diff)
downloadchrome-ec-cddf3c05dad6bf129b3debf36d5912b3509e47c4.tar.gz
CR50: implement _cpri__StirRandom as a no-op.
Stirring the random pool on CR50 is not currently supported, so just implement as a no-op. TEST=none BRANCH=none BUG=chrome-os-partner:43025,chrome-os-partner:47524 Change-Id: I32b0144737139e524d4f71a11cc9d4ad939cd9cb Signed-off-by: nagendra modadugu <ngm@google.com> Reviewed-on: https://chromium-review.googlesource.com/324620 Commit-Ready: Nagendra Modadugu <ngm@google.com> Tested-by: Nagendra Modadugu <ngm@google.com> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--board/cr50/build.mk1
-rw-r--r--board/cr50/tpm2/stubs.c8
-rw-r--r--board/cr50/tpm2/trng.c11
3 files changed, 12 insertions, 8 deletions
diff --git a/board/cr50/build.mk b/board/cr50/build.mk
index c2efe7e907..67a2e94eff 100644
--- a/board/cr50/build.mk
+++ b/board/cr50/build.mk
@@ -36,6 +36,7 @@ board-y += tpm2/hash_data.o
board-y += tpm2/platform.o
board-y += tpm2/rsa.o
board-y += tpm2/stubs.o
+board-y += tpm2/trng.o
# Build and link with an external library
EXTLIB := $(realpath ../../third_party/tpm2)
diff --git a/board/cr50/tpm2/stubs.c b/board/cr50/tpm2/stubs.c
index 3583a466e9..37259d49fd 100644
--- a/board/cr50/tpm2/stubs.c
+++ b/board/cr50/tpm2/stubs.c
@@ -145,14 +145,6 @@ BOOL _cpri__Startup(
return 1;
}
-CRYPT_RESULT _cpri__StirRandom(
- INT32 entropySize,
- BYTE * entropy)
-{
- ecprintf("%s called\n", __func__);
- return CRYPT_FAIL;
-}
-
CRYPT_RESULT _cpri__TestKeyRSA(
TPM2B * d, // OUT: the address to receive the
// private exponent
diff --git a/board/cr50/tpm2/trng.c b/board/cr50/tpm2/trng.c
new file mode 100644
index 0000000000..7cce13ff1c
--- /dev/null
+++ b/board/cr50/tpm2/trng.c
@@ -0,0 +1,11 @@
+/* Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "CryptoEngine.h"
+
+CRYPT_RESULT _cpri__StirRandom(int32_t num, uint8_t *entropy)
+{
+ return CRYPT_SUCCESS; /* NO-OP on CR50. */
+}