Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [6.2.5]

### Fixed
- Windows: TeeGetKind is not supported with handle
- samples: fix spelling
- tests: metepp: add connect retry
- CMake: install meteepp.h

### Changed
- tests: bump CMake requred version to 3.15

## [6.2.4]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.4
6.2.5
4 changes: 2 additions & 2 deletions samples/metee_connect.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2014-2024 Intel Corporation
* Copyright (C) 2014-2026 Intel Corporation
*/
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -44,7 +44,7 @@ static int work(struct params *p)
rsz = TeeGetMaxMsgLen(&cl);
if (rsz == 0)
{
fprintf(stderr, "client reproted zero MTU.\n");
fprintf(stderr, "client reported zero MTU.\n");
goto out;
}
buf = (unsigned char *)malloc(rsz);
Expand Down
2 changes: 1 addition & 1 deletion samples/metee_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ static uint32_t mk_host_if_call(struct mk_host_if *acmd,
if (in_buf_sz == 0)
{
if (acmd->verbose)
metee_gsc_err("mkhif: client reproted zero MTU.\n");
metee_gsc_err("mkhif: client reported zero MTU.\n");
return GSC_FWU_STATUS_FAILURE;
}
*read_buf = (uint8_t *)metee_gsc_malloc(in_buf_sz);
Expand Down
4 changes: 2 additions & 2 deletions samples/metee_mkhi.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2012-2024 Intel Corporation
* Copyright (C) 2012-2026 Intel Corporation
*/
#include <stdarg.h>
#include <stdio.h>
Expand Down Expand Up @@ -239,7 +239,7 @@ static uint32_t mk_host_if_call(struct mk_host_if *acmd,
if (in_buf_sz == 0)
{
if (acmd->verbose)
fprintf(stderr, "mkhif: client reproted zero MTU.\n");
fprintf(stderr, "mkhif: client reported zero MTU.\n");
return MKHI_STATUS_INTERNAL_ERROR;
}
*read_buf = (uint8_t *)malloc(in_buf_sz);
Expand Down
6 changes: 6 additions & 0 deletions src/Windows/metee_winhelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,12 @@ TEESTATUS GetDeviceKind(IN PTEEHANDLE handle, IN OUT OPTIONAL char *kind, IN OUT

FUNC_ENTRY(handle);

if (NULL == impl_handle->device_path) {
status = TEE_NOTSUPPORTED;
ERRPRINT(handle, "Device path is empty.\n");
goto Cleanup;
}

size_t device_path_len = strlen(impl_handle->device_path) + 1;
size_t device_path_size = device_path_len * sizeof(WCHAR);
device_path_w = (WCHAR*)malloc(device_path_size);
Expand Down
4 changes: 2 additions & 2 deletions tests/gtest.cmake.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2014-2022 Intel Corporation
cmake_minimum_required(VERSION 3.1)
# Copyright (C) 2014-2026 Intel Corporation
cmake_minimum_required(VERSION 3.15)

project(googletest-download NONE)

Expand Down
38 changes: 32 additions & 6 deletions tests/meteepp_test.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*
* Copyright (C) 2021-2025 Intel Corporation
* Copyright (C) 2021-2026 Intel Corporation
*/
#include <chrono>
#include <thread>
#include "metee_test.h"

DEFINE_GUID(GUID_NON_EXISTS_CLIENT,
0x85eb8fa6, 0xbdd, 0x4d01, 0xbe, 0xc4, 0xa5, 0x97, 0x43, 0x4e, 0xd7, 0x62);

static constexpr int CONNECT_RETRIES = 3;

namespace {
void meteepp_connect_retry(intel::security::metee& metee)
{
int retry = CONNECT_RETRIES;

while (true) {
try {
metee.connect();
return;
}
catch(const intel::security::metee_exception& ex) {
const auto code = ex.code().value();
if ((--retry <= 0) ||
(code != TEE_BUSY &&
code != TEE_UNABLE_TO_COMPLETE_OPERATION))
throw;
std::this_thread::sleep_for(std::chrono::seconds(2));
}
}
}
}

TEST_P(MeTeePPTEST, PROD_MKHI_SimpleGetVersion)
{
struct MeTeeTESTParams intf = GetParam();
Expand All @@ -18,7 +44,7 @@ TEST_P(MeTeePPTEST, PROD_MKHI_SimpleGetVersion)
intel::security::metee metee(*intf.client);

ASSERT_NE(TEE_INVALID_DEVICE_HANDLE, metee.device_handle());
metee.connect();
meteepp_connect_retry(metee);

ASSERT_EQ(MkhiRequest.size(), metee.write(MkhiRequest, 0));

Expand Down Expand Up @@ -69,7 +95,7 @@ TEST_P(MeTeePPTEST, PROD_MKHI_InitFull)
intel::security::metee metee(*intf.client, device, TEE_LOG_LEVEL_VERBOSE);

ASSERT_NE(TEE_INVALID_DEVICE_HANDLE, metee.device_handle());
metee.connect();
meteepp_connect_retry(metee);
}
catch (const intel::security::metee_exception& ex) {
if (ex.code().value() == TEE_DEVICE_NOT_FOUND)
Expand All @@ -85,7 +111,7 @@ TEST_P(MeTeePPTEST, PROD_N_TestConnectToNonExistsUuid)
try {
intel::security::metee metee(GUID_NON_EXISTS_CLIENT);
ASSERT_NE(TEE_INVALID_DEVICE_HANDLE, metee.device_handle());
metee.connect();
meteepp_connect_retry(metee);
}
catch (const intel::security::metee_exception& ex) {
if (ex.code().value() == TEE_DEVICE_NOT_FOUND)
Expand All @@ -108,7 +134,7 @@ TEST_P(MeTeePPTEST, PROD_MKHI_MoveSemantics)
try {
intel::security::metee metee(*intf.client);
ASSERT_NE(TEE_INVALID_DEVICE_HANDLE, metee.device_handle());
metee.connect();
meteepp_connect_retry(metee);

metee2 = std::move(metee);
}
Expand Down Expand Up @@ -136,4 +162,4 @@ INSTANTIATE_TEST_SUITE_P(MeTeePPTESTInstance, MeTeePPTEST,
testing::ValuesIn(interfaces),
[](const testing::TestParamInfo<MeTeePPTEST::ParamType>& info) {
return info.param.name;
});
});
Loading