-# Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2017 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
SET(KEY_MANAGER_TA_PATH ${KEY_MANAGER_TA_ROOT_PATH}/ta)
SET(KEY_MANAGER_TA_SERIALIZATION_PATH ${KEY_MANAGER_TA_ROOT_PATH}/serialization)
+IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
+ ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
+ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
+
+
INCLUDE_DIRECTORIES(
${KEY_MANAGER_TA_PATH}/include
${KEY_MANAGER_TA_SERIALIZATION_PATH}/include
BuildRequires: cmake
BuildRequires: unified-ta-devkit
-BuildRequires: openssl
%description
Key Manager Trusted Application working in the ARMĀ® TrustZoneĀ® environment.
#define S_VAR_NOT_USED(variable) (void)(variable);
-const uint32_t AES_BLOCK_SIZE;
+extern const uint32_t AES_BLOCK_SIZE;
int KM_CheckAuthAESMode(uint32_t algo, uint32_t tagLen);
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2017 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
log_msg(" MSG ", __FILE__, __LINE__, __func__, __VA_ARGS__); \
} while(0)
-#ifdef DEBUG
+#ifdef BUILD_TYPE_DEBUG
#define LOGD(...) do { \
log_msg("DEBUG", __FILE__, __LINE__, __func__, __VA_ARGS__); \
} while(0)
KM_BinaryData keyBuf, tmpDecKeyBuf;
uint32_t read;
+ tmpDecKeyBuf.data = NULL;
+
// Read encrypted key from persistent storage
ret = TEE_OpenPersistentObject(TEE_STORAGE_PRIVATE, id->data, id->data_size,
TEE_DATA_FLAG_ACCESS_READ, &hndl);
#include <cmd_exec.h>
#include <log.h>
#include <internal.h>
-#include <openssl/evp.h>
TEE_Result TA_CreateEntryPoint(void)
{
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2017 - 2019 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
void log_msg(const char* type, const char* location, int line, const char* func,
const char* format, ...)
{
+#ifdef BUILD_TYPE_DEBUG
va_list args;
const size_t logSize = 512; // increase this limit as needed
char logBuffer[logSize];
printf("[%s] %s @ %i (%s): %s \n\r", type, location, line, func, logBuffer);
fflush(stdout);
+#else
+// TODO actually code below is a mitigation for ARM compilation on OpTEE
+// TODO this entire ifdef should probably be replaced for TEE-OS specific logging
+// TODO but this should be done in separate commit
+ (void) type;
+ (void) location;
+ (void) line;
+ (void) func;
+ (void) format;
+#endif
}