Project

General

Profile

Actions

Feature #1257

open

Handle encypted CA/Certificate private keys

Added by Brad Langhorst over 10 years ago. Updated about 1 year ago.

Status:
Pull Request Review
Priority:
Normal
Assignee:
-
Category:
Certificates
Target version:
Start date:
02/06/2011
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:

Description

when i export a certificate using
http://192.168.3.1/system_certmanager.php

i get an empty file.

the private key downloads just fine.

Actions #1

Updated by Brad Langhorst over 10 years ago

upon further investigation, i see that the crt was not saved.

here's a bit of the config file.

<descr><![CDATA[walden]]></descr>
<caref>4d460d3298bb2</caref>
<crt/>
<prv>I REMOVED THIS ONE THE OTHER ONE IS BLANK</prv>
</cert>
Actions #2

Updated by Brad Langhorst over 10 years ago

the title of this bug should be "certificate file is not properly generated or saved." using internal cert auth

Actions #3

Updated by Jim Pingle over 10 years ago

  • Status changed from New to Rejected

I can't replicate this - I can make certificates several different ways on current snapshots and they are complete inside of the config.

You might want to make a thread on the forum with more detail about exactly how you are creating the certificates, there may be something else going on, but the certificate generation code appears to be working properly.

Actions #4

Updated by Brad Langhorst over 10 years ago

Seems to be related to importing of a certificate authority.

To isolate a bit... I created an internal certificate authority and generated a cert.
This one looks fine.

I still cannot create certs when i choose the pre-existing cert authority that I created outside of pfsense
(using openssl/tinyca2)

I looked for some kind of log to show what commands php is trying to run, but didn't find one.
How can i help debug this problem?

Actions #5

Updated by Jim Pingle over 10 years ago

When you imported the CA, did you import both the cert and private key of the CA?

All of the certificates are made in certs.inc. The code is laid out pretty well there, shouldn't be hard to see what commands are run.

Actions #6

Updated by Brad Langhorst over 10 years ago

One more clarification...
I just checked and see that the private key is encrypted, so cert signing must fail since it never asks for a password.

I can think of a few possible solutions
  • ask for a password before attempting to sign a new cert (my favorite option)
  • don't allow encrypted private keys (probably not a great idea), and reject an invalid key during import
  • don't allow creation of new certs if no usable key is available for the selected cert

Certificate generation works if I paste in the unencrypted ca key, though this strikes me as a poor security practice.
At minimum, I think the user should be notified if the a new cert cannot be generated.

Actions #7

Updated by Jim Pingle over 10 years ago

  • Subject changed from exported certificate files are empty to Handle encypted CA private keys
  • Status changed from Rejected to New
  • Target version deleted (2.0)
  • Affected Architecture All added
  • Affected Architecture deleted ()

Not sure if this will make 2.0 or not. It may have to wait for 2.1 at this point, it may end up a documented limitation for 2.0 because it works fine for certificates made and managed in the GUI.

Actions #8

Updated by Chris Buechler over 5 years ago

  • Tracker changed from Bug to Feature
Actions #9

Updated by Peter Feichtinger over 2 years ago

I made a preliminary PR that adds support for encrypted private keys to the CA, certificate, and user managers.
Would love to get some feedback: https://github.com/pfsense/pfsense/pull/4062

Actions #10

Updated by Jim Pingle about 2 years ago

  • Subject changed from Handle encypted CA private keys to Handle encypted CA/Certificate private keys
Actions #11

Updated by Jim Pingle about 2 years ago

  • Status changed from New to Pull Request Review
  • Target version set to 2.5.0
Actions #12

Updated by Renato Botelho about 1 year ago

  • Target version changed from 2.5.0 to Future

Moving to Future due to lack of activity on proposed Pull Request

Actions

Also available in: Atom PDF