Skip to content

Commit 4a87504

Browse files
JuergenReppSITAndreasFuchsTPM
authored andcommitted
build: Fix several compile errors related to usage of const
* const is added to a declaration in tpm2_attr_util.c and in tpm2_eventlog_yaml.c * unnecessary const is removed in tools/tpm2_getekcertificate.c Signed-off-by: Juergen Repp <juergen_repp@web.de>
1 parent e21f8ab commit 4a87504

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/tpm2_attr_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static dispatch_table obj_attr_table[] = { // Bit Index
381381
dispatch_reserved(31), // 31
382382
};
383383

384-
static bool token_match(const char *name, const char *token, bool has_arg,
384+
static bool token_match(const char *name, char *token, bool has_arg,
385385
char **sep) {
386386

387387
/* if it has an argument, we expect a separator */

lib/tpm2_eventlog_yaml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ char **yaml_split_escape_string(UINT8 const *description, size_t size)
338338
size_t nlines = 0;
339339
size_t i, j, k;
340340
size_t len;
341-
UINT8 *nl;
341+
const UINT8 *nl;
342342

343343
i = 0;
344344
do {

tools/tpm2_getekcertificate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ static tool_rc process_output(void) {
12141214
* Base 64: https://tools.ietf.org/html/rfc4648#section-5 to PEM
12151215
*/
12161216
if (ctx.web_cert_buffer && is_intel_cert && !ctx.is_cert_raw) {
1217-
char *split = strstr((const char *)ctx.web_cert_buffer, "certificate");
1217+
char *split = strstr((char *)ctx.web_cert_buffer, "certificate");
12181218
char *copy_buffer = base64_decode(&split, ctx.web_cert_buffer_size);
12191219
ctx.web_cert_buffer_size = strlen(PEM_BEGIN_CERT_LINE) +
12201220
strlen(copy_buffer) + strlen(PEM_END_CERT_LINE);

0 commit comments

Comments
 (0)