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.
> 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.
I'm going to write/submit this code the day after tomorrow, let me know
if there's any concern about it.
Thanks,
Rajiv Andrade
IBM LTC Security Development
> >
> > On Fri, 2009-10-16 at 15:23 -0400, Wyllys Ingersoll wrote:
> >> Is it a bug that one cannot use the TSS_SECRET_MODE_POPUP mode for the
> >> old and new policies when calling Tspi_ChangeAuth?
> >>
> >> Ideally, I would like to utilize the built-in prompting mechanisms
> >> instead of having to write my program to prompt for the passwords,
> >> but Tspi_ChangeAuth never calls the functions that cause the user
> >> to be prompted, they just return "auth failed" if the POPUP method
> >> is specified because the auth secrets never get initialized.
> >>
> >> This seems like a bug, the spec does not say that you cannot use
> >> those modes with the policies involved in the ChangeAuth command.
> >>
> >> thoughts?
> >>
> >> thanks,
> >> -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-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/trousers-users
> >
> >
> > ------------------------------------------------------------------------------
> > 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
>
------------------------------------------------------------------------------
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