Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: src/tspi/tspi_ps.c

Issue 3581012: Upgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/trousers.git
Patch Set: git cl push Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/tspi/tspi_nv.c ('k') | src/tspi/tspi_seal.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/tspi/tspi_ps.c
diff --git a/src/tspi/tspi_ps.c b/src/tspi/tspi_ps.c
index a07e5d444f067ea86a892f87fa61ab4819e680ce..4acf981dfa97e75d34ff803ac7ac359e5dc0ae84 100644
--- a/src/tspi/tspi_ps.c
+++ b/src/tspi/tspi_ps.c
@@ -27,6 +27,7 @@
#include "tcsd.h"
#include "obj.h"
+TSS_UUID owner_evict_uuid = {0, 0, 0, 0, 0, {0, 0, 0, 0, 1, 0}};
TSS_RESULT
Tspi_Context_LoadKeyByUUID(TSS_HCONTEXT tspContext, /* in */
@@ -85,19 +86,26 @@ Tspi_Context_LoadKeyByUUID(TSS_HCONTEXT tspContext, /* in */
} else if (result)
return result;
- if ((result = RPC_GetRegisteredKeyBlob(tspContext, uuidData, &keyBlobSize,
- &keyBlob)))
- return result;
+ /*check if provided UUID has an owner evict key UUID prefix */
+ if (!memcmp(&uuidData, &owner_evict_uuid, sizeof(TSS_UUID)-1)) {
+ if ((result = obj_rsakey_add(tspContext, TSS_RSAKEY_FLAG_OWNEREVICT,
+ phKey)))
+ return result;
+ } else {
+ if ((result = RPC_GetRegisteredKeyBlob(tspContext, uuidData, &keyBlobSize,
+ &keyBlob)))
+ return result;
+
+ if ((result = obj_rsakey_add_by_key(tspContext, &uuidData, keyBlob,
+ TSS_OBJ_FLAG_SYSTEM_PS, phKey))) {
+ free (keyBlob);
+ return result;
+ }
+
+ result = obj_rsakey_set_tcs_handle(*phKey, tcsKeyHandle);
- if ((result = obj_rsakey_add_by_key(tspContext, &uuidData, keyBlob,
- TSS_OBJ_FLAG_SYSTEM_PS, phKey))) {
free (keyBlob);
- return result;
}
-
- result = obj_rsakey_set_tcs_handle(*phKey, tcsKeyHandle);
-
- free (keyBlob);
#else
if ((result = load_from_system_ps(tspContext, &uuidData, phKey)))
return result;
« no previous file with comments | « src/tspi/tspi_nv.c ('k') | src/tspi/tspi_seal.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698