Skip to content

Commit

Permalink
Remove spaces in empty lines
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Brand <[email protected]>
  • Loading branch information
brandsimon authored and AndreasFuchsTPM committed Dec 18, 2023
1 parent 07ce850 commit 2f157e7
Show file tree
Hide file tree
Showing 30 changed files with 53 additions and 53 deletions.
22 changes: 11 additions & 11 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Starting with release 5.4, The format is based on [Keep a Changelog](http://keep
* tpm2_policyauthorize:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_PolicyAuthorize.

* tpm2_print:
- Support printing serialized ESYS_TR's

Expand Down Expand Up @@ -187,18 +187,18 @@ Starting with release 5.4, The format is based on [Keep a Changelog](http://keep

* tpm2_import: fix an issue where openssl load function resets a specified
scheme with TPM2_ALG_NULL.

* tpm2_sign, tpm2_verifysignature: fixes for sm2 signing and verification.

* Support alternative ECC curves for which default EK templates exist
(NIST_P256, NIST_P384, NIST_P521, and SM2_P256).

* tools/misc/tpm2_checkquote: add sm2 verification of signature.

* tpm2_startauthsession:
- Added option **-G**, **--key-algorithm=ALGORITHM** to specify the
symmetric algorithm used in parameter encryption/decryption.

* tpm2_certify:
- Added option **\--scheme**=_ALGORITHM_ for supporting signature schemes.
Signing schemes should follow the "formatting standards", see section
Expand Down Expand Up @@ -345,15 +345,15 @@ Starting with release 5.4, The format is based on [Keep a Changelog](http://keep
* tpm2_pcrreset:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_PCR_Reset.

* tpm2_pcrread:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_PCR_Read.

* tpm2_pcrevent:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_PCR_Event.

* tpm2_pcrallocate:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_PCR_Allocate.
Expand All @@ -380,11 +380,11 @@ Starting with release 5.4, The format is based on [Keep a Changelog](http://keep
* tpm2_ecephemeral:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_EC_Ephemeral.

* tpm2_ecdhzgen:
- Added option **--cphash** to output the cpHash for the command
TPM2_CC_ECDH_ZGen.

* tpm2_load:
- Added capability to load pem files in TSS2-Private-Key format for
interoperability with tpm2-tss-engine, tpm2-openssl provider,
Expand Down Expand Up @@ -421,7 +421,7 @@ Starting with release 5.4, The format is based on [Keep a Changelog](http://keep
- Added option **\--with-policydelete** when calculating cpHash with
**\--tcti=none** there is no way to know if the attribute
TPMA_NV_POLICYDELETE has been set from the NV index name alone.

* tpm2_nvreadlock:
- Added option **\--rphash**=_FILE_ to specify file path to record the
hash of the response parameters. This is commonly termed as rpHash.
Expand Down Expand Up @@ -933,7 +933,7 @@ Starting with release 5.4, The format is based on [Keep a Changelog](http://keep
* Default hash algorithm is now sha256. Prior versions claimed sha1, but were
inconsistent in choice. Best practice is to specify the hash algorithm to
avoid suprises.

* tpm2_tools and tss2_tools are now a busybox style commandlet. Ie
tpm2\_getrandom becomes tpm2 getrandom. make install will install symlinks
to the old tool names and the tpm2 commandlet will interogate argv[0] for
Expand Down
2 changes: 1 addition & 1 deletion lib/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ tool_rc tpm2_util_object_fetch_priv_pub_from_tpk(const char *objectstr,
LOG_ERR("Error deserializing TSS Privkey Object");
goto ret;
}

rc = Tss2_MU_TPM2B_PUBLIC_Unmarshal(tpk->pubkey->data, pub_len,
NULL, pub);
if (rc != tool_rc_success) {
Expand Down
2 changes: 1 addition & 1 deletion lib/pcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static bool pcr_parse_list(const char *str, size_t len,
pcr_select->pcrSelect[2] = 0xff;
return true;
}

if (!strncmp(str, "none", 4)) {
pcr_select->pcrSelect[0] = 0x00;
pcr_select->pcrSelect[1] = 0x00;
Expand Down
10 changes: 5 additions & 5 deletions lib/tpm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ tool_rc tpm2_policy_restart(ESYS_CONTEXT *esys_context, ESYS_TR session_handle,
LOG_ERR("Failed to acquire SAPI handle");
return tool_rc_general_error;
}

TPM2B_NAME name1 = { 0 };
name1.size = sizeof(TPM2_HANDLE);
rval = Tss2_MU_TPM2_HANDLE_Marshal(sapi_policy_session, name1.name,
Expand Down Expand Up @@ -641,7 +641,7 @@ tool_rc tpm2_pcr_read(ESYS_CONTEXT *esys_context, ESYS_TR shandle1,

goto tpm2_pcrread_skip_esapi_call;
}

rval = Esys_PCR_Read(esys_context, shandle1, shandle2, shandle3,
pcr_selection_in, pcr_update_counter, pcr_selection_out, pcr_values);
if (rval != TSS2_RC_SUCCESS) {
Expand Down Expand Up @@ -5609,16 +5609,16 @@ tool_rc tpm2_ecephemeral(ESYS_CONTEXT *esys_context, TPMI_ECC_CURVE curve_id,
LOG_PERR(Tss2_Sys_EC_Ephemeral_Prepare, rval);
return tool_rc_general_error;
}

rc = tpm2_sapi_getcphash(sys_context, NULL, NULL, NULL,
parameter_hash_algorithm, cp_hash);
/*
* Exit here without making the ESYS call since we just need the cpHash
*/
goto tpm2_ecephemeral_skip_esapi_call;
}


rval = Esys_EC_Ephemeral(esys_context, ESYS_TR_NONE, ESYS_TR_NONE,
ESYS_TR_NONE, curve_id, Q, counter);
if (rval != TSS2_RC_SUCCESS) {
Expand Down
4 changes: 2 additions & 2 deletions lib/tpm2_eventlog_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ char *yaml_devicepath(BYTE* dp, UINT64 dp_len) {
LOG_ERR("failed to allocate memory: %s\n", strerror(errno));
return NULL;
}

/* The void* cast is a hack to support efivar versions < 38 */
ret = efidp_format_device_path((void *)text_path,
text_path_len, (const_efidp)dp, dp_len);
Expand Down Expand Up @@ -682,7 +682,7 @@ static bool yaml_uefi_var(UEFI_VARIABLE_DATA *data, size_t size, UINT32 type,
if ((strlen(ret) == NAME_BOOTORDER_LEN && strncmp(ret, NAME_BOOTORDER, NAME_BOOTORDER_LEN) == 0)) {
free(ret);
tpm2_tool_output(" VariableData:\n");

if (data->VariableDataLength % 2 != 0) {
LOG_ERR("BootOrder value length %" PRIu64 " is not divisible by 2\n",
data->VariableDataLength);
Expand Down
2 changes: 1 addition & 1 deletion lib/tpm2_kdfa.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/*
* Disable optimization because of an error in FORTIFY_SOURCE
*/

#ifdef _FORTIFY_SOURCE
#pragma GCC push_options
#pragma GCC optimize ("O0")
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_ecdhkeygen.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ shared secret value using the parameters from a ECC public key.
* **-o**, **\--output**=_FILE_

Specify file path to save the calculated ecdh secret or Z point.

* **\--cphash**=_FILE_

File path to record the hash of the command parameters. This is commonly
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_ecdhzgen.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ resultant point (Z = (xZ , yZ) ≔ [hds]QB; where h is the cofactor of the curve
File path to record the hash of the command parameters. This is commonly
termed as cpHash. NOTE: When this option is selected, The tool will not
actually execute the command, it simply returns a cpHash.

## References

[algorithm specifiers](common/alg.md) details the options for specifying
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_ecephemeral.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exchange protocol.
File path to record the hash of the command parameters. This is commonly
termed as cpHash. NOTE: When this option is selected, The tool will not
actually execute the command, it simply returns a cpHash.

## References

[algorithm specifiers](common/alg.md) details the options for specifying
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_geteccparameters.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ identified by its TCG-assigned curveID.
File path to record the hash of the command parameters. This is commonly
termed as cpHash. NOTE: When this option is selected, The tool will not
actually execute the command, it simply returns a cpHash.

## References

[algorithm specifiers](common/alg.md) details the options for specifying
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_getekcertificate.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ conditions dictating the certificate location lookup.
tpmEPSgenerated bit is SET AND manufacturer is INTC.

Note:

In this operation information is provided regarding additional software to
be run as part of the re-provisioning/ re-certification service.

Expand Down
4 changes: 2 additions & 2 deletions man/tpm2_pcrallocate.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ The new allocations become effective after the next reboot.
"authorization formatting standards", see section "Authorization Formatting".

* **ARGUMENT** the command line argument specifies the PCR allocation.

* **\--cphash**=_FILE_

File path to record the hash of the command parameters. This is commonly
termed as cpHash. NOTE: When this option is selected, The tool will not
actually execute the command, it simply returns a cpHash.

## References

[context object format](common/ctxobj.md) details the methods for specifying
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_pcrevent.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ These options control extending the pcr:
File path to record the hash of the command parameters. This is commonly
termed as cpHash. NOTE: When this option is selected, The tool will not
actually execute the command, it simply returns a cpHash.

[common options](common/options.md)

[common tcti options](common/tcti.md)
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_pcrread.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sha256 :
* **-o**, **\--output**=_FILE_:

The output file to write the PCR values in binary format, optional.

* **\--cphash**=_FILE_

File path to record the hash of the command parameters. This is commonly
Expand Down
2 changes: 1 addition & 1 deletion man/tpm2_policyrestart.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ would still need to satisfy the policy.
Optional, A session file from **tpm2_startauthsession**(1)'s **-S** option.
This session is used in lieu of starting a session and using the PCR policy
options.

* **\--cphash**=_FILE_

File path to record the hash of the command parameters. This is commonly
Expand Down
6 changes: 3 additions & 3 deletions tools/fapi/tss2_gettpm2object.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ static int tss2_tool_onrun (FAPI_CONTEXT *fctx) {
}

e_rc = Esys_Initialize(&esys_ctx, tcti, NULL);

if (blob_type == FAPI_ESYSBLOB_CONTEXTLOAD) {
size_t offset = 0;
TPMS_CONTEXT context;

if (e_rc != TPM2_RC_SUCCESS) {
LOG_PERR("Esys_Initialize", e_rc);
goto error;
Expand Down Expand Up @@ -148,7 +148,7 @@ static int tss2_tool_onrun (FAPI_CONTEXT *fctx) {
LOG_ERR("IO error for path \"%s\"", ctx.data);
goto error;
}

Esys_TR_Close(esys_ctx, &esys_handle_deser);
Esys_Finalize(&esys_ctx);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/misc/tpm2_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static bool print_TPM2B_PUBLIC(FILE *fstream) {
static bool print_TSSPRIVKEY_OBJ(FILE *fstream) {

UNUSED(fstream);

TPM2B_PUBLIC pub = { 0 };
TPM2B_PRIVATE priv = { 0 };
tool_rc rc = tpm2_util_object_fetch_priv_pub_from_tpk(ctx.file.path, &pub,
Expand Down
2 changes: 1 addition & 1 deletion tools/tpm2_certifycreation.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static tool_rc process_inputs(ESYS_CONTEXT *ectx) {
rc = tpm2_util_bin_from_hex_or_file(ctx.policy_qualifier_data,
&ctx.policy_qualifier.size, ctx.policy_qualifier.buffer) ?
tool_rc_success : tool_rc_general_error;

if (rc != tool_rc_success) {
LOG_ERR("Could not load qualifier data");
return rc;
Expand Down
4 changes: 2 additions & 2 deletions tools/tpm2_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static tool_rc process_output(ESYS_CONTEXT *ectx) {
if (ctx.is_createloaded && ctx.object.template_data_path) {
is_file_op_success = files_save_template(
&ctx.object.in_public.publicArea, ctx.object.template_data_path);

if (!is_file_op_success) {
LOG_ERR("Could not save public template to file.");
return tool_rc_general_error;
Expand Down Expand Up @@ -312,7 +312,7 @@ static tool_rc process_output(ESYS_CONTEXT *ectx) {
if (ctx.object.ctx_path) {
rc = files_save_tpm_context_to_path(ectx, ctx.object.object_handle,
ctx.object.ctx_path);

if (rc != tool_rc_success) {
goto out;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/tpm2_duplicate.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static bool set_key_algorithm(const char *algstr, TPMT_SYM_DEF_OBJECT * obj) {
obj->algorithm = TPM2_ALG_NULL;
return true;
}

bool is_algstr_aes = (strcmp(algstr, "aes") == 0);
if (is_algstr_aes) {
obj->algorithm = TPM2_ALG_AES;
Expand Down
2 changes: 1 addition & 1 deletion tools/tpm2_ecdhzgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct tpm_ecdhzgen_ctx {
*/
const char *ecdh_Z_path;
TPM2B_ECC_POINT *Z;

/*
* Parameter hashes
*/
Expand Down
4 changes: 2 additions & 2 deletions tools/tpm2_flushcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static tool_rc process_inputs(ESYS_CONTEXT *ectx) {

ctx.context_handle_count++;
}

if (!ctx.is_t_l_s_specified && !ctx.is_arg_transient) {
rc = tpm2_session_restore(ectx, ctx.context_arg, true,
&ctx.arg_session);
Expand Down Expand Up @@ -195,7 +195,7 @@ static tool_rc process_inputs(ESYS_CONTEXT *ectx) {
LOG_ERR("Error reading handle info from TPM.");
return tool_rc_general_error;
}

unsigned j = 0; //Iterates through all available handles in t/l/s
for (j = 0; j < capability_data->data.handles.count; j++) {
rc = tpm2_util_sys_handle_to_esys_handle(ectx,
Expand Down
2 changes: 1 addition & 1 deletion tools/tpm2_geteccparameters.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static tpm_geteccparameters_ctx ctx = {
};

static tool_rc geteccparameters(ESYS_CONTEXT *ectx) {

tool_rc rc = tpm2_geteccparameters(ectx, ctx.curve_id, &ctx.parameters,
&ctx.cp_hash, ctx.parameter_hash_algorithm);
if (rc != tool_rc_success) {
Expand Down
2 changes: 1 addition & 1 deletion tools/tpm2_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static tool_rc process_inputs(ESYS_CONTEXT *ectx) {
if (!is_file_op_success) {
return tool_rc_general_error;
}

is_file_op_success = files_load_private(ctx.object.privpath,
&ctx.object.private);
if (!is_file_op_success) {
Expand Down
4 changes: 2 additions & 2 deletions tools/tpm2_nvreadpublic.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct tpm2_nvreadpublic_ctx {
* Outputs
*/
TPM2B_NV_PUBLIC **nv_public_list;

/*
* Parameter hashes
*/
Expand Down Expand Up @@ -216,7 +216,7 @@ static tool_rc process_inputs(ESYS_CONTEXT *ectx) {
return rc;
}
}

if (ctx.nv_index != 0 || !ctx.is_command_dispatch) {
/*
* This path is taken for calculating cpHash as NV index cannot be 0
Expand Down
2 changes: 1 addition & 1 deletion tools/tpm2_nvwritelock.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static tpm_nvwritelock_ctx ctx = {
static tool_rc nv_writelock(ESYS_CONTEXT *ectx) {

return ctx.global_writelock ?

tpm2_nvglobalwritelock(ectx, &ctx.auth_hierarchy.object, &ctx.cp_hash,
&ctx.rp_hash, ctx.parameter_hash_algorithm,
ctx.aux_session_handle[0], ctx.aux_session_handle[1]) :
Expand Down
Loading

0 comments on commit 2f157e7

Please sign in to comment.