summaryrefslogtreecommitdiffstats
path: root/src/shared/tpm2-util.c
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@ieee.org>2023-08-22 00:09:52 +0200
committerDan Streetman <ddstreet@ieee.org>2023-08-24 18:33:26 +0200
commitae2b38e4630b76103367869b5ace87ae0dd34f99 (patch)
tree55339f368aa3829b0a1091aa398471d0ad426939 /src/shared/tpm2-util.c
parenttpm2: split TPM2_PCR_VALUE_MAKE() over multiple lines (diff)
downloadsystemd-ae2b38e4630b76103367869b5ace87ae0dd34f99.tar.xz
systemd-ae2b38e4630b76103367869b5ace87ae0dd34f99.zip
tpm2: remove ret_ prefix from input/output params
Diffstat (limited to '')
-rw-r--r--src/shared/tpm2-util.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c
index 2b9bdb1da4..d53f4cd5a2 100644
--- a/src/shared/tpm2-util.c
+++ b/src/shared/tpm2-util.c
@@ -4802,33 +4802,33 @@ int tpm2_parse_pcr_argument(const char *arg, Tpm2PCRValue **ret_pcr_values, size
* including application of the default hash algorithm. Then the two arrays are combined, the default hash
* algorithm check applied again (in case either the previous or current array had no default hash
* algorithm), and then the resulting array is sorted and rechecked for validity. */
-int tpm2_parse_pcr_argument_append(const char *arg, Tpm2PCRValue **ret_pcr_values, size_t *ret_n_pcr_values) {
+int tpm2_parse_pcr_argument_append(const char *arg, Tpm2PCRValue **pcr_values, size_t *n_pcr_values) {
#if HAVE_TPM2
int r;
assert(arg);
- assert(ret_pcr_values);
- assert(ret_n_pcr_values);
+ assert(pcr_values);
+ assert(n_pcr_values);
- _cleanup_free_ Tpm2PCRValue *pcr_values = NULL;
- size_t n_pcr_values;
- r = tpm2_parse_pcr_argument(arg, &pcr_values, &n_pcr_values);
+ _cleanup_free_ Tpm2PCRValue *more_pcr_values = NULL;
+ size_t n_more_pcr_values;
+ r = tpm2_parse_pcr_argument(arg, &more_pcr_values, &n_more_pcr_values);
if (r < 0)
return r;
/* If we got previous values, append them. */
- if (*ret_pcr_values && !GREEDY_REALLOC_APPEND(pcr_values, n_pcr_values, *ret_pcr_values, *ret_n_pcr_values))
+ if (*pcr_values && !GREEDY_REALLOC_APPEND(more_pcr_values, n_more_pcr_values, *pcr_values, *n_pcr_values))
return log_oom();
- tpm2_pcr_values_apply_default_hash_alg(pcr_values, n_pcr_values);
+ tpm2_pcr_values_apply_default_hash_alg(more_pcr_values, n_more_pcr_values);
- tpm2_sort_pcr_values(pcr_values, n_pcr_values);
+ tpm2_sort_pcr_values(more_pcr_values, n_more_pcr_values);
- if (!tpm2_pcr_values_valid(pcr_values, n_pcr_values))
+ if (!tpm2_pcr_values_valid(more_pcr_values, n_more_pcr_values))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Parsed PCR values are not valid.");
- SWAP_TWO(*ret_pcr_values, pcr_values);
- *ret_n_pcr_values = n_pcr_values;
+ SWAP_TWO(*pcr_values, more_pcr_values);
+ *n_pcr_values = n_more_pcr_values;
return 0;
#else