-/* $OpenBSD: print.c,v 1.23 2022/12/14 02:34:32 job Exp $ */
+/* $OpenBSD: print.c,v 1.24 2022/12/14 08:46:58 job Exp $ */
/*
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
size_t i, j;
char buf1[64], buf2[64];
int sockt;
- char tbuf[21];
-
- strftime(tbuf, sizeof(tbuf), "%FT%TZ", gmtime(&p->expires));
if (outformats & FORMAT_JSON) {
if (p->pubkey != NULL)
if (p->pubkey != NULL) {
printf("BGPsec ECDSA public key: %s\n",
p->pubkey);
- printf("Router key valid until: %s\n", tbuf);
+ printf("Router key valid until: %s\n",
+ time2str(p->expires));
} else
- printf("Certificate valid until: %s\n", tbuf);
+ printf("Certificate valid until: %s\n",
+ time2str(p->expires));
printf("Subordinate resources:\n");
}
void
rsc_print(const X509 *x, const struct rsc *p)
{
- char buf1[64], buf2[64], tbuf[21];
+ char buf1[64], buf2[64];
char *hash;
int sockt;
size_t i, j;
- strftime(tbuf, sizeof(tbuf), "%FT%TZ", gmtime(&p->expires));
-
if (outformats & FORMAT_JSON) {
printf("\t\"ski\": \"%s\",\n", pretty_key_id(p->ski));
printf("\t\"aki\": \"%s\",\n", pretty_key_id(p->aki));
printf("Authority key identifier: %s\n", pretty_key_id(p->aki));
x509_print(x);
printf("Authority info access: %s\n", p->aia);
- printf("Valid until: %s\n", tbuf);
+ printf("RSC valid until: %s\n", time2str(p->expires));
printf("Signed with resources:\n");
}
printf("\t\"aki\": \"%s\",\n", pretty_key_id(p->aki));
printf("\t\"aia\": \"%s\",\n", p->aia);
printf("\t\"sia\": \"%s\",\n", p->sia);
+ printf("\t\"valid_until\": %lld,\n", (long long)p->expires);
printf("\t\"customer_asid\": %u,\n", p->custasid);
printf("\t\"provider_set\": [\n");
for (i = 0; i < p->providersz; i++) {
printf("Authority key identifier: %s\n", pretty_key_id(p->aki));
printf("Authority info access: %s\n", p->aia);
printf("Subject info access: %s\n", p->sia);
+ printf("ASPA valid until: %s\n", time2str(p->expires));
printf("Customer AS: %u\n", p->custasid);
printf("Provider Set:\n");
for (i = 0; i < p->providersz; i++) {
void
tak_print(const X509 *x, const struct tak *p)
{
- char tbuf[21];
-
if (outformats & FORMAT_JSON) {
printf("\t\"type\": \"tak\",\n");
printf("\t\"ski\": \"%s\",\n", pretty_key_id(p->ski));
printf("\t\"valid_until\": %lld,\n", (long long)p->expires);
printf("\t\"takeys\": [\n");
} else {
- strftime(tbuf, sizeof(tbuf), "%FT%TZ", gmtime(&p->expires));
printf("Subject key identifier: %s\n", pretty_key_id(p->ski));
x509_print(x);
printf("Authority key identifier: %s\n", pretty_key_id(p->aki));
printf("Authority info access: %s\n", p->aia);
printf("Subject info access: %s\n", p->sia);
- printf("TAK valid until: %s\n", tbuf);
+ printf("TAK valid until: %s\n", time2str(p->expires));
}
takey_print("current", p->current);