* [tpm2] swtpm tests question
@ 2019-09-18 16:35 Stone, Thomas G
0 siblings, 0 replies; 4+ messages in thread
From: Stone, Thomas G @ 2019-09-18 16:35 UTC (permalink / raw)
To: tpm2
[-- Attachment #1: Type: text/plain, Size: 1732 bytes --]
I am trying, unsuccessfully, to see how the TPM_CC_Hash value 0x0000017D gets sent to the swtpm. Additionally, the _test_hashing script is sending the string "1234" to the swtpm and then verifies a twenty byte return, which is 160 bits, against the hash code "97 e9 76 e4 f2 2c d6 d2 4a fd 21 20 85 ad 7a 86 64 7f 2a e5" which does not appear to correspond to to any hash that I separately calculate. Nor do I see where the hashing algorithm to be used is sent to the swtpm (eg 0x0004 for sha1 or 0x000b for sha2.
I was hoping to use the existing tests as templates for new tests such as testing TPM_CC_GetRandom. I can't do that if I cannot find where the TPM_CC_Hash is specified or where the hashing algorithm to use is specified.
The _test_hashing code is
run_swtpm_ioctl ${SWTPM_INTERFACE} -h 1234
if [ $? -ne 0 ]; then
echo "Error: Hash command did not work."
exit 1
fi
# Read PCR 17
Swtpm_open_cmddev ${SWTPM_INTERFACE} 100
RES=$(swtpm_cmd_tx ${SWTPM_INTERFACE} '\x00\xC1\x00\x00\x00\x0E\x00\x00\x00\x15\x00\x00\x00\x11')
exp=' 00 c4 00 00 00 1e 00 00 00 00 97 e9 76 e4 f2 2c d6 d2 4a fd 21 20 85 ad 7a 86 64 7f 2a e5'
if [ "$RES" != "$exp" ]; then
echo "Error: (1) Did not get expected result from TPM_PCRRead(17)"
echo "expected: $exp"
echo "received: $RES"
exit 1
fi
Any pointers will be appreciated. This is the first time I have attempted to use a tpm so the answer is probably something obvious that I am overlooking.
Thomas Stone, CISSP
Information Assurance Engineer Staff
Lockheed Martin Missiles and Fire Control
Phone (407) 356-6913
Cell (919) 812-0607
Email: thomas.g.stone(a)lmco.com<mailto:thomas.g.stone(a)lmco.com>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 8335 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [tpm2] swtpm tests question
@ 2019-09-19 14:34 Roberts, William C
0 siblings, 0 replies; 4+ messages in thread
From: Roberts, William C @ 2019-09-19 14:34 UTC (permalink / raw)
To: tpm2
[-- Attachment #1: Type: text/plain, Size: 2277 bytes --]
That's a different project, I would reach out to that development community.
Bill
> -----Original Message-----
> From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Stone, Thomas G
> Sent: Wednesday, September 18, 2019 9:35 AM
> To: tpm2(a)lists.01.org
> Subject: [tpm2] swtpm tests question
>
> I am trying, unsuccessfully, to see how the TPM_CC_Hash value 0x0000017D gets
> sent to the swtpm. Additionally, the _test_hashing script is sending the string
> "1234" to the swtpm and then verifies a twenty byte return, which is 160 bits,
> against the hash code "97 e9 76 e4 f2 2c d6 d2 4a fd 21 20 85 ad 7a 86 64 7f 2a e5"
> which does not appear to correspond to to any hash that I separately calculate.
> Nor do I see where the hashing algorithm to be used is sent to the swtpm (eg
> 0x0004 for sha1 or 0x000b for sha2.
>
>
>
> I was hoping to use the existing tests as templates for new tests such as testing
> TPM_CC_GetRandom. I can't do that if I cannot find where the TPM_CC_Hash is
> specified or where the hashing algorithm to use is specified.
>
>
>
> The _test_hashing code is
>
>
>
> run_swtpm_ioctl ${SWTPM_INTERFACE} -h 1234
>
> if [ $? -ne 0 ]; then
>
> echo "Error: Hash command did not work."
>
> exit 1
>
> fi
>
>
>
> # Read PCR 17
>
> Swtpm_open_cmddev ${SWTPM_INTERFACE} 100
>
> RES=$(swtpm_cmd_tx ${SWTPM_INTERFACE}
> '\x00\xC1\x00\x00\x00\x0E\x00\x00\x00\x15\x00\x00\x00\x11')
>
> exp=' 00 c4 00 00 00 1e 00 00 00 00 97 e9 76 e4 f2 2c d6 d2 4a fd 21 20 85 ad 7a 86 64
> 7f 2a e5'
>
> if [ "$RES" != "$exp" ]; then
>
> echo "Error: (1) Did not get expected result from TPM_PCRRead(17)"
>
> echo "expected: $exp"
>
> echo "received: $RES"
>
> exit 1
>
> fi
>
>
>
> Any pointers will be appreciated. This is the first time I have attempted to use a
> tpm so the answer is probably something obvious that I am overlooking.
>
>
>
> Thomas Stone, CISSP
>
> Information Assurance Engineer Staff
>
> Lockheed Martin Missiles and Fire Control
>
> Phone (407) 356-6913
>
> Cell (919) 812-0607
>
> Email: thomas.g.stone(a)lmco.com <mailto:thomas.g.stone(a)lmco.com>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [tpm2] swtpm tests question
@ 2019-09-19 15:47 Tricca, Philip B
0 siblings, 0 replies; 4+ messages in thread
From: Tricca, Philip B @ 2019-09-19 15:47 UTC (permalink / raw)
To: tpm2
[-- Attachment #1: Type: text/plain, Size: 3248 bytes --]
Hi Thomas,
Some additional data:
Stefan Berger maintains the swtpm here: https://github.com/stefanberger/swtpm. This question may be more related to libtpms (https://github.com/stefanberger/libtpms) than swtpm though.
Microsoft maintains the TPM2 reference code here: https://github.com/microsoft/ms-tpm-20-ref.
NOTE: the reference code from MS is re-packaged by Stefan in libtpms.
I don't believe either of these projects have a dedicated mailing list but (as Bill points out below) I doubt that they monitor this one for questions.
Good luck,
Philip
-----Original Message-----
From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Roberts, William C
Sent: 19 September, 2019 07:34
To: Stone, Thomas G <thomas.g.stone(a)lmco.com>; tpm2(a)lists.01.org
Subject: Re: [tpm2] swtpm tests question
That's a different project, I would reach out to that development community.
Bill
> -----Original Message-----
> From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Stone,
> Thomas G
> Sent: Wednesday, September 18, 2019 9:35 AM
> To: tpm2(a)lists.01.org
> Subject: [tpm2] swtpm tests question
>
> I am trying, unsuccessfully, to see how the TPM_CC_Hash value 0x0000017D gets
> sent to the swtpm. Additionally, the _test_hashing script is sending the string
> "1234" to the swtpm and then verifies a twenty byte return, which is
> 160 bits, against the hash code "97 e9 76 e4 f2 2c d6 d2 4a fd 21 20 85 ad 7a 86 64 7f 2a e5"
> which does not appear to correspond to to any hash that I separately calculate.
> Nor do I see where the hashing algorithm to be used is sent to the
> swtpm (eg
> 0x0004 for sha1 or 0x000b for sha2.
>
>
>
> I was hoping to use the existing tests as templates for new tests such
> as testing TPM_CC_GetRandom. I can't do that if I cannot find where
> the TPM_CC_Hash is specified or where the hashing algorithm to use is specified.
>
>
>
> The _test_hashing code is
>
>
>
> run_swtpm_ioctl ${SWTPM_INTERFACE} -h 1234
>
> if [ $? -ne 0 ]; then
>
> echo "Error: Hash command did not work."
>
> exit 1
>
> fi
>
>
>
> # Read PCR 17
>
> Swtpm_open_cmddev ${SWTPM_INTERFACE} 100
>
> RES=$(swtpm_cmd_tx ${SWTPM_INTERFACE}
> '\x00\xC1\x00\x00\x00\x0E\x00\x00\x00\x15\x00\x00\x00\x11')
>
> exp=' 00 c4 00 00 00 1e 00 00 00 00 97 e9 76 e4 f2 2c d6 d2 4a fd 21
> 20 85 ad 7a 86 64 7f 2a e5'
>
> if [ "$RES" != "$exp" ]; then
>
> echo "Error: (1) Did not get expected result from TPM_PCRRead(17)"
>
> echo "expected: $exp"
>
> echo "received: $RES"
>
> exit 1
>
> fi
>
>
>
> Any pointers will be appreciated. This is the first time I have
> attempted to use a tpm so the answer is probably something obvious that I am overlooking.
>
>
>
> Thomas Stone, CISSP
>
> Information Assurance Engineer Staff
>
> Lockheed Martin Missiles and Fire Control
>
> Phone (407) 356-6913
>
> Cell (919) 812-0607
>
> Email: thomas.g.stone(a)lmco.com <mailto:thomas.g.stone(a)lmco.com>
>
>
>
>
_______________________________________________
tpm2 mailing list
tpm2(a)lists.01.org
https://lists.01.org/mailman/listinfo/tpm2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [tpm2] swtpm tests question
@ 2019-09-19 16:54 Roberts, William C
0 siblings, 0 replies; 4+ messages in thread
From: Roberts, William C @ 2019-09-19 16:54 UTC (permalink / raw)
To: tpm2
[-- Attachment #1: Type: text/plain, Size: 3908 bytes --]
> -----Original Message-----
> From: Tricca, Philip B
> Sent: Thursday, September 19, 2019 8:47 AM
> To: Stone, Thomas G <thomas.g.stone(a)lmco.com>; tpm2(a)lists.01.org
> Cc: Roberts, William C <william.c.roberts(a)intel.com>
> Subject: RE: swtpm tests question
>
> Hi Thomas,
>
> Some additional data:
> Stefan Berger maintains the swtpm here:
> https://github.com/stefanberger/swtpm. This question may be more related to
> libtpms (https://github.com/stefanberger/libtpms) than swtpm though.
I wasn't 100% sure if that was upstream for that, good to know. AFAICT, they have no mailing list
but they are active on issues. So perhaps file a github issue on that project.
> Microsoft maintains the TPM2 reference code here:
> https://github.com/microsoft/ms-tpm-20-ref.
>
> NOTE: the reference code from MS is re-packaged by Stefan in libtpms.
>
> I don't believe either of these projects have a dedicated mailing list but (as Bill
> points out below) I doubt that they monitor this one for questions.
>
> Good luck,
> Philip
>
> -----Original Message-----
> From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Roberts, William C
> Sent: 19 September, 2019 07:34
> To: Stone, Thomas G <thomas.g.stone(a)lmco.com>; tpm2(a)lists.01.org
> Subject: Re: [tpm2] swtpm tests question
>
> That's a different project, I would reach out to that development community.
>
> Bill
>
> > -----Original Message-----
> > From: tpm2 [mailto:tpm2-bounces(a)lists.01.org] On Behalf Of Stone,
> > Thomas G
> > Sent: Wednesday, September 18, 2019 9:35 AM
> > To: tpm2(a)lists.01.org
> > Subject: [tpm2] swtpm tests question
> >
> > I am trying, unsuccessfully, to see how the TPM_CC_Hash value 0x0000017D
> gets
> > sent to the swtpm. Additionally, the _test_hashing script is sending the string
> > "1234" to the swtpm and then verifies a twenty byte return, which is
> > 160 bits, against the hash code "97 e9 76 e4 f2 2c d6 d2 4a fd 21 20 85 ad 7a 86 64
> 7f 2a e5"
> > which does not appear to correspond to to any hash that I separately calculate.
> > Nor do I see where the hashing algorithm to be used is sent to the
> > swtpm (eg
> > 0x0004 for sha1 or 0x000b for sha2.
> >
> >
> >
> > I was hoping to use the existing tests as templates for new tests such
> > as testing TPM_CC_GetRandom. I can't do that if I cannot find where
> > the TPM_CC_Hash is specified or where the hashing algorithm to use is
> specified.
> >
> >
> >
> > The _test_hashing code is
> >
> >
> >
> > run_swtpm_ioctl ${SWTPM_INTERFACE} -h 1234
> >
> > if [ $? -ne 0 ]; then
> >
> > echo "Error: Hash command did not work."
> >
> > exit 1
> >
> > fi
> >
> >
> >
> > # Read PCR 17
> >
> > Swtpm_open_cmddev ${SWTPM_INTERFACE} 100
> >
> > RES=$(swtpm_cmd_tx ${SWTPM_INTERFACE}
> > '\x00\xC1\x00\x00\x00\x0E\x00\x00\x00\x15\x00\x00\x00\x11')
> >
> > exp=' 00 c4 00 00 00 1e 00 00 00 00 97 e9 76 e4 f2 2c d6 d2 4a fd 21
> > 20 85 ad 7a 86 64 7f 2a e5'
> >
> > if [ "$RES" != "$exp" ]; then
> >
> > echo "Error: (1) Did not get expected result from TPM_PCRRead(17)"
> >
> > echo "expected: $exp"
> >
> > echo "received: $RES"
> >
> > exit 1
> >
> > fi
> >
> >
> >
> > Any pointers will be appreciated. This is the first time I have
> > attempted to use a tpm so the answer is probably something obvious that I am
> overlooking.
> >
> >
> >
> > Thomas Stone, CISSP
> >
> > Information Assurance Engineer Staff
> >
> > Lockheed Martin Missiles and Fire Control
> >
> > Phone (407) 356-6913
> >
> > Cell (919) 812-0607
> >
> > Email: thomas.g.stone(a)lmco.com <mailto:thomas.g.stone(a)lmco.com>
> >
> >
> >
> >
>
> _______________________________________________
> tpm2 mailing list
> tpm2(a)lists.01.org
> https://lists.01.org/mailman/listinfo/tpm2
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-09-19 16:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-18 16:35 [tpm2] swtpm tests question Stone, Thomas G
-- strict thread matches above, loose matches on Subject: below --
2019-09-19 14:34 Roberts, William C
2019-09-19 15:47 Tricca, Philip B
2019-09-19 16:54 Roberts, William C
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox