Netgate SG-1000 microFirewall

Author Topic: Certificate Manager internal CA and certificate validity  (Read 125 times)

0 Members and 1 Guest are viewing this topic.

Offline mhollis60

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Certificate Manager internal CA and certificate validity
« on: February 14, 2018, 07:10:56 am »
Hi,

I'm running pfSense 2.4.2p1 and just started playing with the certificate manager. I have created an internal-ca with a validity of 10 years (default). I then created a new server certificate, but as a test entered a longer "valid until" date than the CA. I was a bit surprised to find the CA signed the certificate using the longer expiry date. My understanding was that a CA should only sign certificates based on its own valid until date. I can see a problem whereby a user will install a server certificate in future thinking it is valid for x number of years only to find the CA expires before.

Does anyone know if this is a known issue that needs to be highlighted in a bug tracker?

Cheers,
Mark.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15188
  • Karma: +1414/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Certificate Manager internal CA and certificate validity
« Reply #1 on: February 14, 2018, 07:40:51 am »
So your saying your CA good until say Jan 1 2028, and you cert says its good til jan 1 2030? or something like that?

I do not believe there is a requirement in any RFC that a CA can not issue a cert longer than its current life.. While some CA's have implemented such a check - off the top of my head I am not aware of any specific RFC that declares a CA can not sign a cert with a life longer than the CA current life..
« Last Edit: February 14, 2018, 07:44:41 am by johnpoz »
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline mhollis60

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Certificate Manager internal CA and certificate validity
« Reply #2 on: February 14, 2018, 07:43:31 am »
Thats correct. Thats what I'm seeing. I create a server certificate using the internal CA and it allows me to put a longer valid date on the certificate.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15188
  • Karma: +1414/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Certificate Manager internal CA and certificate validity
« Reply #3 on: February 14, 2018, 07:44:57 am »
See my edit...

Even when the CA expires as long as you create the new CA with the private key of the old CA.. The signed cert will still validate off the new CA.. you would just need to trust the new CA you created from the old CA private key.

If that wasn't the case as the CA got closer to its expire date you could only sign shorter and shorter lengths of time for certs...
« Last Edit: February 14, 2018, 07:51:24 am by johnpoz »
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)

Offline mhollis60

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Certificate Manager internal CA and certificate validity
« Reply #4 on: February 14, 2018, 07:54:04 am »
OK thanks. I guess the server certificate would be deemed invalid once the CA expires anyway as the chain of trust would be broken? Putting a check into the code at the time of signing would prevent certificates mistakenly being signed with a non-valid expiry date, but then again I guess it is up to the admin to make sure his CA and the certificates being signed are using the correct dates in the first place  :)

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 15188
  • Karma: +1414/-206
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Certificate Manager internal CA and certificate validity
« Reply #5 on: February 14, 2018, 07:56:07 am »
Yeah I do not think there is a RFC stating you can not sign certs long - there are scenarios when you would for sure need to be able to do that..

Lets say you need to issue certs for 3 years, but your CA expires in 2.. so now you have to redo your CA 2 years before it expires.. That would suck ;)  So you just make sure that you create your NEW ca with the same private key before the 2 year expires.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.4.2-RELEASE-p1 (work)
1x SG-4860 2.4.2-RELEASE-p1 (home)