On Wed, Nov 02, 2022 at 10:38:57AM +0100, Theo Buehler wrote: > Like most x509_* functions, x509_get_time() returns 0 on error and 1 on > success, so rather than changing x509_get_time(), I changed the callers.
OK claudio@ > Index: aspa.c > =================================================================== > RCS file: /cvs/src/usr.sbin/rpki-client/aspa.c,v > retrieving revision 1.5 > diff -u -p -r1.5 aspa.c > --- aspa.c 13 Oct 2022 04:43:32 -0000 1.5 > +++ aspa.c 2 Nov 2022 09:32:55 -0000 > @@ -225,7 +225,7 @@ aspa_parse(X509 **x509, const char *fn, > warnx("%s: X509_get0_notAfter failed", fn); > goto out; > } > - if (x509_get_time(at, &p.res->expires) == -1) { > + if (!x509_get_time(at, &p.res->expires)) { > warnx("%s: ASN1_time_parse failed", fn); > goto out; > } > Index: crl.c > =================================================================== > RCS file: /cvs/src/usr.sbin/rpki-client/crl.c,v > retrieving revision 1.16 > diff -u -p -r1.16 crl.c > --- crl.c 3 Sep 2022 21:24:02 -0000 1.16 > +++ crl.c 2 Nov 2022 09:34:39 -0000 > @@ -57,7 +57,7 @@ crl_parse(const char *fn, const unsigned > warnx("%s: X509_CRL_get0_lastUpdate failed", fn); > goto out; > } > - if (x509_get_time(at, &crl->issued) == -1) { > + if (!x509_get_time(at, &crl->issued)) { > warnx("%s: ASN1_time_parse failed", fn); > goto out; > } > @@ -67,7 +67,7 @@ crl_parse(const char *fn, const unsigned > warnx("%s: X509_CRL_get0_nextUpdate failed", fn); > goto out; > } > - if (x509_get_time(at, &crl->expires) == -1) { > + if (!x509_get_time(at, &crl->expires)) { > warnx("%s: ASN1_time_parse failed", fn); > goto out; > } > Index: roa.c > =================================================================== > RCS file: /cvs/src/usr.sbin/rpki-client/roa.c,v > retrieving revision 1.53 > diff -u -p -r1.53 roa.c > --- roa.c 13 Oct 2022 04:43:32 -0000 1.53 > +++ roa.c 2 Nov 2022 09:33:51 -0000 > @@ -235,7 +235,7 @@ roa_parse(X509 **x509, const char *fn, c > warnx("%s: X509_get0_notAfter failed", fn); > goto out; > } > - if (x509_get_time(at, &p.res->expires) == -1) { > + if (!x509_get_time(at, &p.res->expires)) { > warnx("%s: ASN1_time_parse failed", fn); > goto out; > } > Index: rsc.c > =================================================================== > RCS file: /cvs/src/usr.sbin/rpki-client/rsc.c,v > retrieving revision 1.16 > diff -u -p -r1.16 rsc.c > --- rsc.c 13 Oct 2022 04:43:32 -0000 1.16 > +++ rsc.c 2 Nov 2022 09:34:05 -0000 > @@ -408,7 +408,7 @@ rsc_parse(X509 **x509, const char *fn, c > warnx("%s: X509_get0_notAfter failed", fn); > goto out; > } > - if (x509_get_time(at, &p.res->expires) == -1) { > + if (!x509_get_time(at, &p.res->expires)) { > warnx("%s: ASN1_time_parse failed", fn); > goto out; > } > Index: x509.c > =================================================================== > RCS file: /cvs/src/usr.sbin/rpki-client/x509.c,v > retrieving revision 1.51 > diff -u -p -r1.51 x509.c > --- x509.c 24 Oct 2022 10:26:59 -0000 1.51 > +++ x509.c 2 Nov 2022 09:34:14 -0000 > @@ -377,7 +377,7 @@ x509_get_expire(X509 *x, const char *fn, > warnx("%s: X509_get0_notafter failed", fn); > return 0; > } > - if (x509_get_time(at, tt) == -1) { > + if (!x509_get_time(at, tt)) { > warnx("%s: ASN1_time_parse failed", fn); > return 0; > } > -- :wq Claudio