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

Side by Side Diff: src/tspi/tsp_auth.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/tspi/rpc/hosttable.c ('k') | src/tspi/tsp_context_mem.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Licensed Materials - Property of IBM 3 * Licensed Materials - Property of IBM
4 * 4 *
5 * trousers - An open source TCG Software Stack 5 * trousers - An open source TCG Software Stack
6 * 6 *
7 * (C) Copyright International Business Machines Corp. 2004-2007 7 * (C) Copyright International Business Machines Corp. 2004-2007
8 * 8 *
9 */ 9 */
10 10
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 goto error; 849 goto error;
850 } else 850 } else
851 sess->parentMode = TSS_SECRET_MODE_NONE; 851 sess->parentMode = TSS_SECRET_MODE_NONE;
852 852
853 switch (command) { 853 switch (command) {
854 /* Child is a Key object */ 854 /* Child is a Key object */
855 case TPM_ORD_CreateWrapKey: 855 case TPM_ORD_CreateWrapKey:
856 case TPM_ORD_CMK_CreateKey: 856 case TPM_ORD_CMK_CreateKey:
857 if ((result = obj_rsakey_get_policies(obj_child, &sess->hUsageCh ild, 857 if ((result = obj_rsakey_get_policies(obj_child, &sess->hUsageCh ild,
858 &sess->hMigChild, &authdat ausage))) 858 &sess->hMigChild, &authdat ausage)))
859 » » » return result; 859 » » » goto error;
860 860
861 if (authdatausage && !sess->hUsageChild) { 861 if (authdatausage && !sess->hUsageChild) {
862 result = TSPERR(TSS_E_TSP_AUTHREQUIRED); 862 result = TSPERR(TSS_E_TSP_AUTHREQUIRED);
863 goto error; 863 goto error;
864 } 864 }
865 865
866 if (obj_rsakey_is_migratable(obj_child)) { 866 if (obj_rsakey_is_migratable(obj_child)) {
867 if (!sess->hMigChild) { 867 if (!sess->hMigChild) {
868 result = TSPERR(TSS_E_KEY_NO_MIGRATION_POLICY); 868 result = TSPERR(TSS_E_KEY_NO_MIGRATION_POLICY);
869 goto error; 869 goto error;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 * is OK. At this point, authsess->pAuth is NULL, so the TCS API will n ot get any 958 * is OK. At this point, authsess->pAuth is NULL, so the TCS API will n ot get any
959 * authdata. */ 959 * authdata. */
960 if (req_auth == FALSE && sess->parentMode == TSS_SECRET_MODE_NONE) 960 if (req_auth == FALSE && sess->parentMode == TSS_SECRET_MODE_NONE)
961 goto done; 961 goto done;
962 962
963 if (get_child_auth) { 963 if (get_child_auth) {
964 if ((result = obj_policy_get_xsap_params(sess->hUsageChild, 0, 0 , NULL, NULL, 964 if ((result = obj_policy_get_xsap_params(sess->hUsageChild, 0, 0 , NULL, NULL,
965 sess->encAuthUse.authda ta, NULL, NULL, 965 sess->encAuthUse.authda ta, NULL, NULL,
966 &sess->cb_sealx, &sess- >uMode, 966 &sess->cb_sealx, &sess- >uMode,
967 new_secret))) 967 new_secret)))
968 » » » return result; 968 » » » goto error;
969 } 969 }
970 970
971 if ((result = get_local_random(tspContext, FALSE, sizeof(TPM_NONCE), 971 if ((result = get_local_random(tspContext, FALSE, sizeof(TPM_NONCE),
972 (BYTE **)sess->nonceOddxSAP.nonce))) 972 (BYTE **)sess->nonceOddxSAP.nonce)))
973 goto error; 973 goto error;
974 974
975 sess->obj_child = obj_child; 975 sess->obj_child = obj_child;
976 sess->tspContext = tspContext; 976 sess->tspContext = tspContext;
977 sess->pAuth = &sess->auth; 977 sess->pAuth = &sess->auth;
978 sess->command = command; 978 sess->command = command;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1122
1123 void 1123 void
1124 authsess_free(struct authsess *xsap) 1124 authsess_free(struct authsess *xsap)
1125 { 1125 {
1126 if (xsap) { 1126 if (xsap) {
1127 if (xsap->auth.AuthHandle && xsap->auth.fContinueAuthSession) 1127 if (xsap->auth.AuthHandle && xsap->auth.fContinueAuthSession)
1128 (void)__tspi_free_resource(xsap->tspContext, xsap->auth. AuthHandle, TPM_RT_AUTH); 1128 (void)__tspi_free_resource(xsap->tspContext, xsap->auth. AuthHandle, TPM_RT_AUTH);
1129 1129
1130 free(xsap->entityValue); 1130 free(xsap->entityValue);
1131 free(xsap); 1131 free(xsap);
1132 xsap = NULL;
1132 } 1133 }
1133 } 1134 }
1134 1135
1135 #ifdef TSS_BUILD_TRANSPORT 1136 #ifdef TSS_BUILD_TRANSPORT
1136 TSS_RESULT 1137 TSS_RESULT
1137 Transport_OIAP(TSS_HCONTEXT tspContext, /* in */ 1138 Transport_OIAP(TSS_HCONTEXT tspContext, /* in */
1138 TCS_AUTHHANDLE* authHandle, /* out */ 1139 TCS_AUTHHANDLE* authHandle, /* out */
1139 TPM_NONCE* nonce0) /* out */ 1140 TPM_NONCE* nonce0) /* out */
1140 { 1141 {
1141 TSS_RESULT result; 1142 TSS_RESULT result;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 } 1218 }
1218 1219
1219 *handles = handle; 1220 *handles = handle;
1220 1221
1221 result = obj_context_transport_execute(tspContext, TPM_ORD_Terminate_Han dle, 0, NULL, 1222 result = obj_context_transport_execute(tspContext, TPM_ORD_Terminate_Han dle, 0, NULL,
1222 NULL, &handlesLen, &handles, NULL , NULL, NULL, NULL); 1223 NULL, &handlesLen, &handles, NULL , NULL, NULL, NULL);
1223 1224
1224 return result; 1225 return result;
1225 } 1226 }
1226 #endif 1227 #endif
OLDNEW
« no previous file with comments | « src/tspi/rpc/hosttable.c ('k') | src/tspi/tsp_context_mem.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698