Skip to content

Commit

Permalink
piv-certs: use PRIu64 when formatting SID, try declare get_parse_end
Browse files Browse the repository at this point in the history
  • Loading branch information
arekinath committed Jan 30, 2024
1 parent f977492 commit 6335c46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions piv-ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
#include "piv-internal.h"

#if !defined(JSONC_14)
size_t json_tokener_get_parse_end(struct json_tokener *);

size_t
json_tokener_get_parse_end(struct json_tokener *tok)
{
Expand Down
3 changes: 2 additions & 1 deletion piv-certs.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <limits.h>
#include <err.h>
#include <ctype.h>
#include <inttypes.h>

#if defined(__APPLE__)
#include <PCSC/wintypes.h>
Expand Down Expand Up @@ -1383,7 +1384,7 @@ gen_sid_ext(struct cert_var_scope *cs, X509_EXTENSION **out)
}
idauth = v64 & ((1ULL << 48) - 1);

rc = sshbuf_putf(sbuf, "S-1-%lu", idauth);
rc = sshbuf_putf(sbuf, "S-1-%" PRIu64, idauth);
if (rc != 0) {
err = ssherrf("sshbuf_putf", rc);
goto out;
Expand Down
6 changes: 3 additions & 3 deletions pivy-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -3118,7 +3118,7 @@ main(int ac, char **av)
ptr = optarg;
r = sshkey_read(cak, &ptr);
if (r != 0)
fatal("Invalid CAK key given: %ld", r);
fatal("Invalid CAK key given: %d", r);
break;
case 'S':
err = slotspec_parse(slot_ena, optarg);
Expand Down Expand Up @@ -3224,8 +3224,8 @@ main(int ac, char **av)
perror("mkdtemp: private socket dir");
exit(1);
}
snprintf(socket_name, sizeof socket_name, "%s/agent.%ld", socket_dir,
(long)parent_pid);
snprintf(socket_name, sizeof socket_name, "%s/agent.%ld",
socket_dir, (long)parent_pid);
} else {
/* Try to use specified agent socket */
socket_dir[0] = '\0';
Expand Down

0 comments on commit 6335c46

Please sign in to comment.