Rajiv Andrade wrote:
> Hi Wyllys,
>
> Sorry for the delay...
>
>> Ex:
>> if (set_object_policy(hTPM, TSS_SECRET_MODE_POPUP, 0, NULL))
>> return (ERR_FAIL);
>>
>> /* new policy object */
>> ret = Tspi_Context_CreateObject(hContext, TSS_OBJECT_TYPE_POLICY,
>> TSS_POLICY_USAGE, &hNewPolicy);
>>
>> if (ret) {
>> print_error(ret, gettext("Create policy object"));
>> return (ERR_FAIL);
>> }
>> ret = Tspi_Policy_SetSecret(hNewPolicy, TSS_SECRET_MODE_POPUP,
>> 0, NULL);
>
> The bug is here, obj_policy_set_secret() down in the stack isn't
> prompting the user in case the it's a popup mode policy. We also can't
> pass through these layers the flag that tells if it's asking for a new
> password or not. Not a big issue though, can be solved including another
> (yes, one more) flag in the policy struct that informs if the policy is
> assigned to an object or not and that would be set when calling
> Tspi_Policy_AssignToObject.
Would that work for Tspi_ChangeAuth? The new policy isn't assigned to the
object until after the hash is computed (authsess_xsap_init) so when would
the user be prompted in that case?
>
>> if (ret) {
>> print_error(ret, gettext("Set policy object secret"));
>> return (ERR_FAIL);
>> }
>>
>> ret = Tspi_ChangeAuth(hTPM, NULL, hNewPolicy);
>> if (ret) {
>> print_error(ret, gettext("Change authorization"));
>> return (ERR_FAIL);
>> }
>> ...
>>
>>
>> As a test, I have hacked the code in changeauth_owner to do the following
>> at the very beginning:
>>
>> TCPA_SECRET secret;
>> TSS_HOBJECT hPolicy;
>> if ((result = obj_tpm_get_policy(hObjectToChange, TSS_POLICY_USAGE,
>> &hPolicy)))
>> return result;
>>
>> if ((result = obj_policy_get_secret(hPolicy, TR_SECRET_CTX_NEW,
>> &secret)))
>> return result;
>>
>> if ((result = obj_policy_get_secret(hNewPolicy, TR_SECRET_CTX_NEW,
>> &secret)))
>> return result;
>>
>> if ((result = authsess_xsap_init(tspContext, hObjectToChange,
>> hNewPolicy,
>> TSS_AUTH_POLICY_REQUIRED,
>> TPM_ORD_ChangeAuthOwner,
>> TPM_ET_OWNER, &xsap)))
>> ...
>>
>>
>>
>> In the above code the "secret" data is ignored. obj_policy_get_secret is
>> just being
>> called because it is the only way to trigger the call to popup_GetSecret,
>> the result
>> is irrelevant because the actual auth data gets extracted by
>> authsess_xsap_init.
>>
>> This does indeed prompt for 2 Passwords and the command then succeeds,
>> though I
>> don't think this is the correct solution. Also, doing it this way, the user
>> gets the
>> same prompt for both the current password and the new one so its not very
>> intuitive as to
>> which one is being prompted.
>>
>
> The popup string can be set with Tspi_SetAttribData(), as in
> testsuite/tcg/tspi/Tspi_SetAttribData01.c and the differentiation
> between a new password prompt and a current password one is made by
> means of that flag I mentioned above.
Yeah, I eventually figured that part out.
>
> I'm going to write/submit this code the day after tomorrow, let me know
> if there's any concern about it.
Concern noted above, but if the tests pass with your fix, Im satisfied.
-Wyllys
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech