forked from openenclave/openenclave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement oe_random_internal for OP-TEE.
Signed-off-by: Hernan Gatta <[email protected]> Fix based on comments Signed-off-by: Ming-Wei Shih <[email protected]> Fix Signed-off-by: Ming-Wei Shih <[email protected]> Update change log Signed-off-by: Ming-Wei Shih <[email protected]>
- Loading branch information
1 parent
237c7c8
commit 3a7c793
Showing
5 changed files
with
29 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
// Copyright (c) Open Enclave SDK contributors. | ||
// Licensed under the MIT License. | ||
|
||
#define OE_NEED_STDC_NAMES | ||
#include <openenclave/enclave.h> | ||
|
||
#include <tee_internal_api.h> | ||
|
||
oe_result_t oe_random_internal(void* data, size_t size) | ||
{ | ||
OE_UNUSED(data); | ||
OE_UNUSED(size); | ||
return OE_UNSUPPORTED; | ||
} | ||
if (size > OE_UINT32_MAX) | ||
return OE_OUT_OF_BOUNDS; | ||
|
||
TEE_GenerateRandom(data, (uint32_t)size); | ||
|
||
return OE_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters