Blame doc/README.tpm_stdll

Packit 8681c6
TPM STDLL README
Packit 8681c6
Kent Yoder <shpedoikal@gmail.com>
Packit 8681c6
Packit 8681c6
Current architecture:
Packit 8681c6
Packit 8681c6
 SRK
Packit 8681c6
 |
Packit 8681c6
 + User Root Key (URK)
Packit 8681c6
 | |
Packit 8681c6
 | + [1..N] User Base Key (UBK)
Packit 8681c6
 |          |
Packit 8681c6
 |          + Migratable Leaf Key (MLK)
Packit 8681c6
 |          | |
Packit 8681c6
 |          | + Auth Data for User Created Keys
Packit 8681c6
 |          |
Packit 8681c6
 |          + [1..N] User Created Keys
Packit 8681c6
 |
Packit 8681c6
 + Migratable Root Key (MRK)
Packit 8681c6
   |
Packit 8681c6
   + Migratable Leaf Key (MLK)
Packit 8681c6
Packit 8681c6
1. When the SO logs in:
Packit 8681c6
  A) its verified that she is root (currently commented out)
Packit 8681c6
  B) the token searches for the User Root Key (URK), and if found, the SO's key
Packit 8681c6
     chain is loaded, up to the SO's protection key.  Some junk data is
Packit 8681c6
     encrypted and decrypted to challenge the auth data passed in and if that
Packit 8681c6
     test passes, the SO is logged in
Packit 8681c6
  C) if the URK isn't found, its assumed that the SO is logging in for the first
Packit 8681c6
     time, and
Packit 8681c6
    i. The URK is generated in software
Packit 8681c6
    ii. The URK's private key is wrapped with the public key of the SRK, and TSS
Packit 8681c6
    and PKCS#11 objects are created for it, storing it in the PKCS#11 data store
Packit 8681c6
  D) i and ii are repeated for the Migratable Root Key (MRK)
Packit 8681c6
  E) The Protection Key is generated by the TPM as a child of the MRK
Packit 8681c6
  F) Some junk data is encrypted and decrypted to challenge the auth data passed
Packit 8681c6
     in and if that test passes, the SO is logged in
Packit 8681c6
Packit 8681c6
2. When the USER logs in:
Packit 8681c6
  A) The URK is searched for and if not found, failure (The SO has not
Packit 8681c6
     initialized the token)
Packit 8681c6
  B) If the URK is found, the User's Base Key (UBK) is searched for and if
Packit 8681c6
     found, the user's key chain is loaded, up to the USER's protection key.
Packit 8681c6
     Some junk data is encrypted and decrypted to challenge the auth data passed
Packit 8681c6
     in and if that test passes, the USER is logged in
Packit 8681c6
  C) if the UBK is not found:
Packit 8681c6
    i. The UBK is generated in software
Packit 8681c6
    ii.The UBK's private key is wrapped with the public key of the URK, and TSS
Packit 8681c6
       and PKCS#11 objects are created for it, storing it in the PKCS#11 data
Packit 8681c6
       store
Packit 8681c6
  D) The User's Protection Key is generated by the TPM as a child of the UBK
Packit 8681c6
  E) Some junk data is encrypted and decrypted to challenge the auth data passed
Packit 8681c6
     in and if that test passes, the USER is logged in
Packit 8681c6
Packit 8681c6
Packit 8681c6
Prior to release 2.4.1, the tpm stdll has the password for the SRK hardcoded to
Packit 8681c6
NULL and the policy secret mode set to TSS_SECRET_MODE_PLAIN. 
Packit 8681c6
Packit 8681c6
Starting in release 2.4.1, the environment variables,
Packit 8681c6
OCK_SRK_SECRET and OCK_SRK_MODE can be set to indicate the Storage Root Key's
Packit 8681c6
secret and it's policy's secret mode to the tpm stdll.
Packit 8681c6
Packit 8681c6
OCK_SRK_MODE
Packit 8681c6
The possible secret modes are:
Packit 8681c6
    - TSS_SECRET_MODE_NONE
Packit 8681c6
    - TSS_SECRET_MODE_PLAIN
Packit 8681c6
    - TSS_SECRET_MODE_SHA1
Packit 8681c6
    - TSS_SECRET_MODE_POPUP
Packit 8681c6
    - TSS_SECRET_MODE_CALLBACK
Packit 8681c6
Packit 8681c6
OCK_SRK_SECRET
Packit 8681c6
The storage root key may be:
Packit 8681c6
    - a text string.
Packit 8681c6
      OCK_SRK_MODE should be set to TSS_SECRET_MODE_PLAIN.
Packit 8681c6
      i.e. export OCK_SRK_SECRET="MyBigSecret"
Packit 8681c6
Packit 8681c6
    - SHA1 hash string.
Packit 8681c6
      The SHA1 hash must be expressed as a 40 byte hexadecimal string. Recall a
Packit 8681c6
      byte value is represented by two hexadecimal digits. So a SHA1 hash length
Packit 8681c6
      of 20 bytes requires 40 hexadecimal digits to represent it.
Packit 8681c6
Packit 8681c6
      This option also requires that OCK_SRK_MODE is set to TSS_SECRET_MODE_SHA1
Packit 8681c6
      to indicate the string is a sha1 hash.
Packit 8681c6
Packit 8681c6
      i.e. export OCK_SRK_SECRET="22596363b3de40b06f981fb85d82312e8c0ed511"
Packit 8681c6
           export OCK_SRK_MODE=TSS_SECRET_MODE_SHA1
Packit 8681c6
Packit 8681c6
      Note: If using the well known secret, then express as a 40 byte hex string
Packit 8681c6
            of zeroes.
Packit 8681c6
	
Packit 8681c6
      i.e. export OCK_SRK_SECRET="0000000000000000000000000000000000000000"
Packit 8681c6
           export OCK_SRK_MODE=TSS_SECRET_MODE_SHA1
Packit 8681c6
			
Packit 8681c6
If neither OCK_SRK_MODE nor OCK_SRK_SECRET are set, then the passwd will be set
Packit 8681c6
to NULL, and the mode to TSS_SECRET_MODE_PLAIN.