aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/tpm
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-11-17 16:40:24 -0500
committerJack Lloyd <[email protected]>2018-11-17 22:50:26 -0500
commit71ecbd15c47b136c4a7c712775d86435fa4fc453 (patch)
tree630e196dac5001b9cb7103740e3239f0fb7cd1ec /src/lib/prov/tpm
parent432d31546eb335bb96c6b2a8c58f0168266387ec (diff)
Add typecast_copy
Wraps memcpy in the cases where we really are doing a type conversion using memcpy
Diffstat (limited to 'src/lib/prov/tpm')
-rw-r--r--src/lib/prov/tpm/tpm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/prov/tpm/tpm.cpp b/src/lib/prov/tpm/tpm.cpp
index ffbc220d6..5516d41a0 100644
--- a/src/lib/prov/tpm/tpm.cpp
+++ b/src/lib/prov/tpm/tpm.cpp
@@ -113,7 +113,7 @@ TSS_UUID to_tss_uuid(const UUID& uuid)
static_assert(sizeof(TSS_UUID) == 16, "Expected size of packed UUID");
TSS_UUID tss_uuid;
- std::memcpy(&tss_uuid, uuid.binary_value().data(), 16);
+ typecast_copy(tss_uuid, uuid.binary_value().data());
return tss_uuid;
}
@@ -122,7 +122,7 @@ UUID from_tss_uuid(const TSS_UUID& tss_uuid)
static_assert(sizeof(TSS_UUID) == 16, "Expected size of packed UUID");
std::vector<uint8_t> mem(16);
- std::memcpy(mem.data(), &tss_uuid, 16);
+ typecast_copy(mem.data(), tss_uuid);
UUID uuid(std::move(mem));
return uuid;
}