-/* $OpenBSD: crl.c,v 1.24 2023/03/10 12:44:56 job Exp $ */
+/* $OpenBSD: crl.c,v 1.25 2023/05/22 15:07:02 tb Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
goto out;
}
if (!x509_get_time(at, &crl->lastupdate)) {
- warnx("%s: ASN1_time_parse failed", fn);
+ warnx("%s: ASN1_TIME_to_tm failed", fn);
goto out;
}
goto out;
}
if (!x509_get_time(at, &crl->nextupdate)) {
- warnx("%s: ASN1_time_parse failed", fn);
+ warnx("%s: ASN1_TIME_to_tm failed", fn);
goto out;
}
-/* $OpenBSD: x509.c,v 1.70 2023/03/14 07:09:11 tb Exp $ */
+/* $OpenBSD: x509.c,v 1.71 2023/05/22 15:07:02 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
return 0;
}
if (!x509_get_time(at, tt)) {
- warnx("%s: ASN1_time_parse failed", fn);
+ warnx("%s: ASN1_TIME_to_tm failed", fn);
return 0;
}
return 1;
return 0;
}
if (!x509_get_time(at, tt)) {
- warnx("%s: ASN1_time_parse failed", fn);
+ warnx("%s: ASN1_TIME_to_tm failed", fn);
return 0;
}
return 1;
*t = 0;
memset(&tm, 0, sizeof(tm));
- if (ASN1_time_parse(at->data, at->length, &tm, 0) == -1)
+ /* Fail instead of silently falling back to the current time. */
+ if (at == NULL)
+ return 0;
+ if (!ASN1_TIME_to_tm(at, &tm))
return 0;
if ((*t = timegm(&tm)) == -1)
errx(1, "timegm failed");