From: Nikos Mavrogiannopoulos Date: Fri, 20 Jul 2012 20:17:23 +0000 (+0200) Subject: updated TPM doc X-Git-Tag: gnutls_3_1_0pre0~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ab33db4a5eca6fbef551ef56516caa6900851c4;p=thirdparty%2Fgnutls.git updated TPM doc --- diff --git a/src/tpmtool-args.c b/src/tpmtool-args.c index a2474b1572..cc50de38f4 100644 --- a/src/tpmtool-args.c +++ b/src/tpmtool-args.c @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (tpmtool-args.c) * - * It has been AutoGen-ed July 14, 2012 at 10:40:19 AM by AutoGen 5.16 + * It has been AutoGen-ed July 20, 2012 at 10:21:17 PM by AutoGen 5.16 * From the definitions tpmtool-args.def * and the template file options * @@ -102,15 +102,15 @@ static char const tpmtool_opt_strs[2031] = /* 1096 */ "Any generated key will be a signing key\0" /* 1136 */ "SIGNING\0" /* 1144 */ "signing\0" -/* 1152 */ "Any registered key will be a user key\0" -/* 1190 */ "USER\0" -/* 1195 */ "user\0" -/* 1200 */ "Any registred key will be a system key\0" -/* 1239 */ "SYSTEM\0" -/* 1246 */ "system\0" -/* 1253 */ "Any generated key will be a legacy key\0" -/* 1292 */ "LEGACY\0" -/* 1299 */ "legacy\0" +/* 1152 */ "Any generated key will be a legacy key\0" +/* 1191 */ "LEGACY\0" +/* 1198 */ "legacy\0" +/* 1205 */ "Any registered key will be a user key\0" +/* 1243 */ "USER\0" +/* 1248 */ "user\0" +/* 1253 */ "Any registred key will be a system key\0" +/* 1292 */ "SYSTEM\0" +/* 1299 */ "system\0" /* 1306 */ "Prints the public key of the provided key\0" /* 1348 */ "PUBKEY\0" /* 1355 */ "pubkey\0" @@ -202,13 +202,26 @@ static int const aSigningCantList[] = { INDEX_OPT_LEGACY, NO_EQUIVALENT }; #define SIGNING_FLAGS (OPTST_DISABLED) +/* + * legacy option description with + * "Must also have options" and "Incompatible options": + */ +#define LEGACY_DESC (tpmtool_opt_strs+1152) +#define LEGACY_NAME (tpmtool_opt_strs+1191) +#define LEGACY_name (tpmtool_opt_strs+1198) +static int const aLegacyMustList[] = { + INDEX_OPT_GENERATE_RSA, NO_EQUIVALENT }; +static int const aLegacyCantList[] = { + INDEX_OPT_SIGNING, NO_EQUIVALENT }; +#define LEGACY_FLAGS (OPTST_DISABLED) + /* * user option description with * "Must also have options" and "Incompatible options": */ -#define USER_DESC (tpmtool_opt_strs+1152) -#define USER_NAME (tpmtool_opt_strs+1190) -#define USER_name (tpmtool_opt_strs+1195) +#define USER_DESC (tpmtool_opt_strs+1205) +#define USER_NAME (tpmtool_opt_strs+1243) +#define USER_name (tpmtool_opt_strs+1248) static int const aUserMustList[] = { INDEX_OPT_REGISTER, NO_EQUIVALENT }; static int const aUserCantList[] = { @@ -219,28 +232,15 @@ static int const aUserCantList[] = { * system option description with * "Must also have options" and "Incompatible options": */ -#define SYSTEM_DESC (tpmtool_opt_strs+1200) -#define SYSTEM_NAME (tpmtool_opt_strs+1239) -#define SYSTEM_name (tpmtool_opt_strs+1246) +#define SYSTEM_DESC (tpmtool_opt_strs+1253) +#define SYSTEM_NAME (tpmtool_opt_strs+1292) +#define SYSTEM_name (tpmtool_opt_strs+1299) static int const aSystemMustList[] = { INDEX_OPT_REGISTER, NO_EQUIVALENT }; static int const aSystemCantList[] = { INDEX_OPT_USER, NO_EQUIVALENT }; #define SYSTEM_FLAGS (OPTST_DISABLED) -/* - * legacy option description with - * "Must also have options" and "Incompatible options": - */ -#define LEGACY_DESC (tpmtool_opt_strs+1253) -#define LEGACY_NAME (tpmtool_opt_strs+1292) -#define LEGACY_name (tpmtool_opt_strs+1299) -static int const aLegacyMustList[] = { - INDEX_OPT_GENERATE_RSA, NO_EQUIVALENT }; -static int const aLegacyCantList[] = { - INDEX_OPT_SIGNING, NO_EQUIVALENT }; -#define LEGACY_FLAGS (OPTST_DISABLED) - /* * pubkey option description: */ @@ -398,8 +398,20 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ SIGNING_DESC, SIGNING_NAME, SIGNING_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 6, VALUE_OPT_USER, - /* equiv idx, value */ 6, VALUE_OPT_USER, + { /* entry idx, value */ 6, VALUE_OPT_LEGACY, + /* equiv idx, value */ 6, VALUE_OPT_LEGACY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LEGACY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --legacy */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aLegacyMustList, aLegacyCantList, + /* option proc */ NULL, + /* desc, NAME, name */ LEGACY_DESC, LEGACY_NAME, LEGACY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_USER, + /* equiv idx, value */ 7, VALUE_OPT_USER, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ USER_FLAGS, 0, @@ -410,8 +422,8 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 7, VALUE_OPT_SYSTEM, - /* equiv idx, value */ 7, VALUE_OPT_SYSTEM, + { /* entry idx, value */ 8, VALUE_OPT_SYSTEM, + /* equiv idx, value */ 8, VALUE_OPT_SYSTEM, /* equivalenced to */ NO_EQUIVALENT, /* min, max, act ct */ 0, 1, 0, /* opt state flags */ SYSTEM_FLAGS, 0, @@ -422,18 +434,6 @@ static tOptDesc optDesc[OPTION_CT] = { /* desc, NAME, name */ SYSTEM_DESC, SYSTEM_NAME, SYSTEM_name, /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 8, VALUE_OPT_LEGACY, - /* equiv idx, value */ 8, VALUE_OPT_LEGACY, - /* equivalenced to */ NO_EQUIVALENT, - /* min, max, act ct */ 0, 1, 0, - /* opt state flags */ LEGACY_FLAGS, 0, - /* last opt argumnt */ { NULL }, /* --legacy */ - /* arg list/cookie */ NULL, - /* must/cannot opts */ aLegacyMustList, aLegacyCantList, - /* option proc */ NULL, - /* desc, NAME, name */ LEGACY_DESC, LEGACY_NAME, LEGACY_name, - /* disablement strs */ NULL, NULL }, - { /* entry idx, value */ 9, VALUE_OPT_PUBKEY, /* equiv idx, value */ 9, VALUE_OPT_PUBKEY, /* equivalenced to */ NO_EQUIVALENT, diff --git a/src/tpmtool-args.def b/src/tpmtool-args.def index 59bb846cb0..5afc0fa370 100644 --- a/src/tpmtool-args.def +++ b/src/tpmtool-args.def @@ -13,7 +13,9 @@ explain = ""; flag = { name = generate-rsa; descrip = "Generate an RSA private-public key pair"; - doc = "Generates an RSA private-public key pair on the specified token."; + doc = "Generates an RSA private-public key pair in the TPM chip. +The key may be stored in filesystem and protected by a PIN, or stored (registered) +in the TPM chip flash."; }; flag = { @@ -31,6 +33,14 @@ flag = { doc = ""; }; +flag = { + name = legacy; + descrip = "Any generated key will be a legacy key"; + flags_must = generate-rsa; + flags_cant = signing; + doc = ""; +}; + flag = { name = user; descrip = "Any registered key will be a user key"; @@ -47,13 +57,6 @@ flag = { doc = "The generated key will be stored in system persistent storage."; }; -flag = { - name = legacy; - descrip = "Any generated key will be a legacy key"; - flags_must = generate-rsa; - flags_cant = signing; - doc = ""; -}; flag = { name = pubkey; @@ -82,7 +85,8 @@ flag = { arg-type = string; arg-name = "Security parameter"; descrip = "Specify the security level [low, legacy, normal, high, ultra]."; - doc = "This is alternative to the bits option."; + doc = "This is alternative to the bits option. Note however that the +values allowed by the TPM chip are quantized and given values may be rounded up."; }; flag = { @@ -104,14 +108,30 @@ doc-section = { ds-type = 'EXAMPLES'; ds-format = 'texi'; ds-text = <<-_EOT_ -To generate a public key use: +To generate a key that is to be stored in filesystem use: +@example +$ tpmtool --generate-rsa --bits 2048 --outfile tpmkey.pem +@end example + +To generate a key that is to be stored in TPM's flash use: @example -$ tpmtool --generate-rsa --sec-param normal --outfile tpmkey.pem +$ tpmtool --generate-rsa --bits 2048 --register --user @end example To get the public key of a TPM key use: @example -$ tpmtool --pubkey --infile tpmkey.tpm --outfile pubkey.pem +$ tpmtool --pubkey tpmkey:uuid=58ad734b-bde6-45c7-89d8-756a55ad1891;storage=user \ + --outfile pubkey.pem +@end example + +or if the key is stored in the filesystem: +@example +$ tpmtool --pubkey tpmkey:file=tmpkey.pem --outfile pubkey.pem +@end example + +To list all keys stored in TPM use: +@example +$ tpmtool --list @end example _EOT_; }; diff --git a/src/tpmtool-args.h b/src/tpmtool-args.h index f4d98ae048..d268f28493 100644 --- a/src/tpmtool-args.h +++ b/src/tpmtool-args.h @@ -2,7 +2,7 @@ * * DO NOT EDIT THIS FILE (tpmtool-args.h) * - * It has been AutoGen-ed July 14, 2012 at 10:40:19 AM by AutoGen 5.16 + * It has been AutoGen-ed July 20, 2012 at 10:21:17 PM by AutoGen 5.16 * From the definitions tpmtool-args.def * and the template file options * @@ -73,9 +73,9 @@ typedef enum { INDEX_OPT_GENERATE_RSA = 3, INDEX_OPT_REGISTER = 4, INDEX_OPT_SIGNING = 5, - INDEX_OPT_USER = 6, - INDEX_OPT_SYSTEM = 7, - INDEX_OPT_LEGACY = 8, + INDEX_OPT_LEGACY = 6, + INDEX_OPT_USER = 7, + INDEX_OPT_SYSTEM = 8, INDEX_OPT_PUBKEY = 9, INDEX_OPT_LIST = 10, INDEX_OPT_DELETE = 11, @@ -132,9 +132,9 @@ typedef enum { #define VALUE_OPT_GENERATE_RSA 3 #define VALUE_OPT_REGISTER 4 #define VALUE_OPT_SIGNING 5 -#define VALUE_OPT_USER 6 -#define VALUE_OPT_SYSTEM 7 -#define VALUE_OPT_LEGACY 8 +#define VALUE_OPT_LEGACY 6 +#define VALUE_OPT_USER 7 +#define VALUE_OPT_SYSTEM 8 #define VALUE_OPT_PUBKEY 9 #define VALUE_OPT_LIST 10 #define VALUE_OPT_DELETE 11