summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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. */
+}