All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [tpm2] Documentation for configure
@ 2018-05-18 20:49 Tony Yip
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Yip @ 2018-05-18 20:49 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 6387 bytes --]

Thanks for your reply. I'm trying to configure the default for simulator use.

-----

I had to wrap the tctidefaultmodule value in quotes so I did the same for tctidefaultconfig. However, I ran into some errors:
./configure --with-tctidefaultmodule=\"libtss2-tcti-mssim.so\" --enable-unit --with-tctidefaultconfig=\"host=10.139.90.53,port=2321\"

The check against the string "host" fails due to the extra " (i.e. "\"host")
ERROR:tcti:src/util/key-value-parse.c:102:parse_key_value_string() parsing key/value: "host=10.139.90.53 

https://github.com/tpm2-software/tpm2-tss/blob/373d4e4f1678401ac0f5e999be63fc1b63c950b3/src/tss2-tcti/tcti-mssim.c#L471

-----

Changing the configure command to use no quotes results in a compilation error:
./configure --with-tctidefaultmodule=\"libtss2-tcti-mssim.so\" --enable-unit --with-tctidefaultconfig=host=10.139.90.53,port=2321

src/tss2-esys/esys_tcti_default.c: In function ‘get_tcti_default’:
src/tss2-esys/esys_tcti_default.c:186:56: error: macro "_STR" passed 2 arguments, but takes just 1
     const char *config = _XSTR(ESYS_TCTI_DEFAULT_CONFIG);

https://github.com/tpm2-software/tpm2-tss/blob/373d4e4f1678401ac0f5e999be63fc1b63c950b3/src/tss2-esys/esys_tcti_default.c#L181

-----

Anyway, after looking at it some more, I believe I need to use Tss2_Tcti_Mssim_Init instead of relying on a default configuration. I still haven't been able to get the debug/trace logs to output however.

________________________________________
From: tpm2 [tpm2-bounces(a)lists.01.org] on behalf of Anderson, Daniel [daniel.anderson(a)intel.com]
Sent: Friday, May 18, 2018 1:24 PM
To: tpm2(a)lists.01.org
Subject: Re: [tpm2] Documentation for configure

I suggested some documentation on this, but it was pointed out to me that these are rarely-used options and that the documentation is available from here:

./bootstrap; ./configure --help

But to answer your question, configure --enable-tcti-mssim allows use of the Microsoft/IBM TPM 2.0 simulator and
Configure --enable-tcti-device allows use of the real TPM 2.0 (including virtual or firmware TPMs) through the /dev/tpm0 device driver.

Having both enabled is the default and is useful unless you want to do a lot of minimization or something.

If you care, here's the options I use in a testing environment:
./configure --enable-unit --enable-integration --enable-doxygen-doc

Dan

$ ./configure --help
`configure' configures tpm2-tss 2.0.0_rc1 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...
. . .
Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-unit           build cmocka unit tests (default is no)
  --enable-esapi          build the esapi layer (default is yes)
  --enable-tcti-device    build the tcti-device module (default is yes)
  --enable-tcti-mssim     build the tcti-mssim module (default is yes)
  --enable-integration    build and execute integration tests (default is no)
  --enable-ld-version-script
                          enable linker version script (default is enabled when possible)
  --enable-debug          build with debug info (default is no)
  --disable-doxygen-doc   don't generate any doxygen documentation
  --enable-doxygen-dot    generate graphics for doxygen documentation
  --disable-doxygen-man   don't generate doxygen manual pages
  --enable-doxygen-rtf    generate doxygen RTF documentation
  --enable-doxygen-xml    generate doxygen XML documentation
  --enable-doxygen-chm    generate doxygen compressed HTML help documentation
  --enable-doxygen-chi    generate doxygen separate compressed HTML help index file
  --disable-doxygen-html  don't generate doxygen plain HTML documentation
  --enable-doxygen-ps     generate doxygen PostScript documentation
  --enable-doxygen-pdf    generate doxygen PDF documentation
  --enable-code-coverage  Whether to enable code coverage support

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-aix-soname=aix|svr4|both
                          shared library versioning (aka "SONAME") variant to
                          provide on AIX, [default=aix].
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                          compiler's sysroot if not specified).
  --with-tctidefaultmodule
                          The default TCTI module for ESAPI. (Default:
                          libtss2-tcti-default.so
  --with-tctidefaultconfig
                          The default tcti module's configuration.
  --with-udevrulesdir=DIR udev rules directory
  --with-udevrulesprefix=XY
                          prefix for udev rules file
  --with-maxloglevel={none,error,warning,info,debug,trace}
                          sets the maximum log level (default is trace)
  --with-gcov=GCOV        use given GCOV for coverage (GCOV=gcov).

Some influential environment variables:
. . .


_______________________________________________
tpm2 mailing list
tpm2(a)lists.01.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_mailman_listinfo_tpm2&d=DwICAg&c=laiMAACGcvAxeLF9-K5nZ1uCTN9kBzTH8fWOxFTVLgs&r=GVrlcb0t_QREzpaQn_xsFgE-o00NN5nuTSi4_Sd9gHI&m=HQhsQuNedhU2-zRlvGxzibWyAeNnmstvACWgTm1oboA&s=rXnlMmDWmljIyD0CXgg7UcVd9iI9-hSri0xkPC6vSuY&e=

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tpm2] Documentation for configure
@ 2018-05-21 17:09 Tony Yip
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Yip @ 2018-05-21 17:09 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

Thanks Tadeusz. That was what I needed.
________________________________________
From: Tadeusz Struk [tadeusz.struk(a)intel.com]
Sent: Monday, May 21, 2018 9:49 AM
To: Tony Yip; Anderson, Daniel; tpm2(a)lists.01.org
Subject: Re: [tpm2] Documentation for configure

On 05/18/2018 01:49 PM, Tony Yip wrote:
> Anyway, after looking at it some more, I believe I need to use Tss2_Tcti_Mssim_Init instead of relying on a default configuration. I still haven't been able to get the debug/trace logs to output however.

Hi Tony,
To enable tracing in runtime you need to set a TSS2_LOG variable.
See https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_tpm2-2Dsoftware_tpm2-2Dtss_blob_master_doc_logging.md&d=DwIC-g&c=laiMAACGcvAxeLF9-K5nZ1uCTN9kBzTH8fWOxFTVLgs&r=GVrlcb0t_QREzpaQn_xsFgE-o00NN5nuTSi4_Sd9gHI&m=q4mSNfsoij2EgXU8TPoH60MhI8zFTlFRzS66Ov2ltCc&s=g6eUy8ub9yn1gupzMj8vzLjmQLYjblnJdCGHlft3S3c&e= for more details.
--
Tadeusz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tpm2] Documentation for configure
@ 2018-05-21 16:57 Tony Yip
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Yip @ 2018-05-21 16:57 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

Hi Daniel,

I ran the configure command you suggested though it ends up with the same error as before.

ERROR:tcti:src/util/key-value-parse.c:94:parse_key_value_string() kv_str: ""host=10.139.90.53,port=2321"", callback: 0x7fafe555a590, user_data: 0x7ffdcc9928c0 
ERROR:tcti:src/util/key-value-parse.c:102:parse_key_value_string() parsing key/value: "host=10.139.90.53 
ERROR:tcti:src/util/key-value-parse.c:53:parse_key_value() key_value_str: ""host=10.139.90.53" and key_value_t: 0x7ffdcc992870 

Anyway, I was able to communicate with the simulator using Tss2_Tcti_Mssim_Init. I've included the code snippet below for posterity:

size_t size = 0;
TSS2_TCTI_CONTEXT* tcti_context = NULL;
Tss2_Tcti_Mssim_Init(NULL, &size, NULL);
tcti_context = (TSS2_TCTI_CONTEXT*) calloc(1, size);
Tss2_Tcti_Mssim_Init(tcti_context, &size, "host=localhost,port=2321");

________________________________________
From: Anderson, Daniel [daniel.anderson(a)intel.com]
Sent: Friday, May 18, 2018 3:57 PM
To: Tony Yip; tpm2(a)lists.01.org
Subject: RE: Documentation for configure

> I had to wrap the tctidefaultmodule value in quotes so I did the same for > tctidefaultconfig. However, I ran into some errors:
>./configure --with-tctidefaultmodule=\"libtss2-tcti-mssim.so\" --enable-unit --with-> tctidefaultconfig=\"host=10.139.90.53,port=2321\"


Tony,
This might work (among other possibilities):

./configure --with-tctidefaultmodule='"libtss2-tcti-mssim.so"' --enable-unit --with-tctidefaultconfig='"host=10.139.90.53,port=2321"'

That is try enclosing the double quotes "" in single quotes ''



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tpm2] Documentation for configure
@ 2018-05-21 16:49 Tadeusz Struk
  0 siblings, 0 replies; 7+ messages in thread
From: Tadeusz Struk @ 2018-05-21 16:49 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

On 05/18/2018 01:49 PM, Tony Yip wrote:
> Anyway, after looking at it some more, I believe I need to use Tss2_Tcti_Mssim_Init instead of relying on a default configuration. I still haven't been able to get the debug/trace logs to output however.

Hi Tony,
To enable tracing in runtime you need to set a TSS2_LOG variable.
See https://github.com/tpm2-software/tpm2-tss/blob/master/doc/logging.md for more details.
-- 
Tadeusz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tpm2] Documentation for configure
@ 2018-05-18 22:57 Anderson, Daniel
  0 siblings, 0 replies; 7+ messages in thread
From: Anderson, Daniel @ 2018-05-18 22:57 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

> I had to wrap the tctidefaultmodule value in quotes so I did the same for > tctidefaultconfig. However, I ran into some errors:
>./configure --with-tctidefaultmodule=\"libtss2-tcti-mssim.so\" --enable-unit --with-> tctidefaultconfig=\"host=10.139.90.53,port=2321\"


Tony,
This might work (among other possibilities):

./configure --with-tctidefaultmodule='"libtss2-tcti-mssim.so"' --enable-unit --with-tctidefaultconfig='"host=10.139.90.53,port=2321"'

That is try enclosing the double quotes "" in single quotes ''



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [tpm2] Documentation for configure
@ 2018-05-18 20:24 Anderson, Daniel
  0 siblings, 0 replies; 7+ messages in thread
From: Anderson, Daniel @ 2018-05-18 20:24 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 4290 bytes --]

I suggested some documentation on this, but it was pointed out to me that these are rarely-used options and that the documentation is available from here:

./bootstrap; ./configure --help

But to answer your question, configure --enable-tcti-mssim allows use of the Microsoft/IBM TPM 2.0 simulator and
Configure --enable-tcti-device allows use of the real TPM 2.0 (including virtual or firmware TPMs) through the /dev/tpm0 device driver.

Having both enabled is the default and is useful unless you want to do a lot of minimization or something.

If you care, here's the options I use in a testing environment:
./configure --enable-unit --enable-integration --enable-doxygen-doc

Dan

$ ./configure --help
`configure' configures tpm2-tss 2.0.0_rc1 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...
. . .
Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-static[=PKGS]  build static libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-unit           build cmocka unit tests (default is no)
  --enable-esapi          build the esapi layer (default is yes)
  --enable-tcti-device    build the tcti-device module (default is yes)
  --enable-tcti-mssim     build the tcti-mssim module (default is yes)
  --enable-integration    build and execute integration tests (default is no)
  --enable-ld-version-script
                          enable linker version script (default is enabled when possible)
  --enable-debug          build with debug info (default is no)
  --disable-doxygen-doc   don't generate any doxygen documentation
  --enable-doxygen-dot    generate graphics for doxygen documentation
  --disable-doxygen-man   don't generate doxygen manual pages
  --enable-doxygen-rtf    generate doxygen RTF documentation
  --enable-doxygen-xml    generate doxygen XML documentation
  --enable-doxygen-chm    generate doxygen compressed HTML help documentation
  --enable-doxygen-chi    generate doxygen separate compressed HTML help index file
  --disable-doxygen-html  don't generate doxygen plain HTML documentation
  --enable-doxygen-ps     generate doxygen PostScript documentation
  --enable-doxygen-pdf    generate doxygen PDF documentation
  --enable-code-coverage  Whether to enable code coverage support

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-aix-soname=aix|svr4|both
                          shared library versioning (aka "SONAME") variant to
                          provide on AIX, [default=aix].
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                          compiler's sysroot if not specified).
  --with-tctidefaultmodule
                          The default TCTI module for ESAPI. (Default:
                          libtss2-tcti-default.so
  --with-tctidefaultconfig
                          The default tcti module's configuration.
  --with-udevrulesdir=DIR udev rules directory
  --with-udevrulesprefix=XY
                          prefix for udev rules file
  --with-maxloglevel={none,error,warning,info,debug,trace}
                          sets the maximum log level (default is trace)
  --with-gcov=GCOV        use given GCOV for coverage (GCOV=gcov).

Some influential environment variables:
. . .



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tpm2] Documentation for configure
@ 2018-05-18 17:52 Tony Yip
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Yip @ 2018-05-18 17:52 UTC (permalink / raw)
  To: tpm2

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

Hi,

Is there any documentation for the configure step?

There's https://github.com/tpm2-software/tpm2-tss/blob/master/INSTALL.md but it does not talk about accepted values for "tctidefaultconfig" or "tctidefaultmodule".

Moreover, I notice that "maxloglevel" is set to "trace", however I do not see any LOG_TRACE messages on console and have to change the source to use LOG_ERROR to see any output.

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 953 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-05-21 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 20:49 [tpm2] Documentation for configure Tony Yip
  -- strict thread matches above, loose matches on Subject: below --
2018-05-21 17:09 Tony Yip
2018-05-21 16:57 Tony Yip
2018-05-21 16:49 Tadeusz Struk
2018-05-18 22:57 Anderson, Daniel
2018-05-18 20:24 Anderson, Daniel
2018-05-18 17:52 Tony Yip

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.