Skip to content
Snippets Groups Projects
Commit 96511f30 authored by Léo Banno-Cloutier's avatar Léo Banno-Cloutier
Browse files

ca: warn if caLifetime < userLifetime < deviceLifetime

Change-Id: I7d4c73baf8a673018807030e32f7349b0aa62456
parent daae2398
No related branches found
No related tags found
No related merge requests found
......@@ -78,12 +78,27 @@ public class JamsCA implements CertificateAuthority {
CertificateAuthorityConfig config =
gson.fromJson(settings, CertificateAuthorityConfig.class);
CA = ca;
OCSP = ca;
OCSP = ocsp;
serverDomain = config.getServerDomain();
signingAlgorithm = config.getSigningAlgorithm();
crlLifetime = config.getCrlLifetime();
userLifetime = config.getUserLifetime();
deviceLifetime = config.getDeviceLifetime();
if (deviceLifetime > userLifetime) {
log.warn(
"Device lifetime is greater than user lifetime, this is not recommended, please change this in the config file.");
}
X509Certificate cert = ca.getCertificate();
long caLifetime = cert.getNotAfter().getTime() - cert.getNotBefore().getTime();
if (userLifetime > caLifetime) {
log.warn(
"User lifetime is greater than CA lifetime, this is not recommended, please change this in the config file.");
}
if (ca != null && ocsp != null) {
crlWorker = new CRLWorker(CA.getPrivateKey(), CA.getCertificate());
try {
......
......@@ -62,13 +62,11 @@ export default function ServerParameters(props) {
{ value: 7889238000, label: i18next.t("3_months", "3 months") },
{ value: 15778476000, label: i18next.t("6_months", "6 months") },
{ value: 31556952000, label: i18next.t("1_year", "1 year") },
{ value: 157784760000, label: i18next.t("5_years", "5 years") },
];
const userAccountLifetimeTypes = [
{ value: 31556952000, label: i18next.t("1_year", "1 year") },
{ value: 157784760000, label: i18next.t("5_years", "5 years") },
{ value: 315569520000, label: i18next.t("10_years", "10 years") },
];
const certificateRevocationTypesItems = tool.buildSelectMenuItems(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment