S/MIME certificates with step-ca: problem #2358
-
Hello all. I am trying to understand the various RFCs, CA/Browser S/MIME WG basic requirements, I have collected a bunch of S/MIME certs from other providers to abstract all of that into using step-ca to create working S/MIME certificates. BUT. I run into a few problems. The biggest one being the Subject CN. So I'd like to ask: Am I doing something wrong or is step-ca a bit too strict? Here's the thing. According to the RFCs etc, for modern S/MIME certs the use of emailAddress in the subject is deprecated, all email addresses must be SANs. The CN in the subject is typically used for the full name of the recipient (there are a lot more rules, but this is the one I am struggling with). Step-ca just won't do it and always refuses with Here's what I did:
{
"subject": {
"Organization": {{ toJson .Organization }},
"organizationalUnit": {{ toJson .OrganizationalUnit }},
"commonName": {{ toJson .Subject.CommonName }}
},
"basicConstraints": {
"isCA": false
},
"extensions": [
{"id": "2.5.29.32", "value": {{ asn1Seq (asn1Seq (asn1Enc "oid:2.23.140.1.5.2.2")) | toJson }}}
],
"sans": {{ toJson .SANs }},
"extKeyUsage": ["emailProtection", "clientAuth"],
"keyUsage": ["keyEncipherment", "digitalSignature", "contentCommitment"]
}
{
"Organization": "JHW HomeLab",
"OrganizationalUnit": "S/MIME"
} This should be sufficient for minimal S/MIME certs. And it happily works when I use the email address as subject/CN: step ca certificate "[email protected]" --san "[email protected]" --san "[email protected]" --san "[email protected]" nsmith.crt nsmith.key --provisioner smime But it fails when I use the name as CN: step ca certificate "Nathaniel Smith" --san "[email protected]" --san "[email protected]" --san "[email protected]" nsmith.crt nsmith.key --provisioner smime
✔ Provisioner: smime (JWK) [kid: na5k[...]VA]
Please enter the password to decrypt the provisioner key:
✔ CA: https://ca.at.home:4443
error creating certificate
Re-run with STEPDEBUG=1 for more info. And step-ca tells me:
So, the question is ...Is there a way to configure step-ca to accept the full name as CN? I also tried adding Bonus question: How do I set the authority policy to get step-ca to accept any email address? It seems I have to add every single domain I own with a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @jwildeboer, The error originates from our issuance policy engine. You mention it at the end of the message, but it's not showing the full policy configured, so I can't say for sure what the policy is that you're using. For the Common Name, it's currently a bit of a special case: https://smallstep.com/docs/step-ca/policies/#subject-common-name. If you only need "Nathaniel Smith", you should add that as an allowed CN, explicitly. It's pretty limited intentionally, so that we don't get too much configuration sprawl here, but I suppose we're open for suggestions. There's in fact logic in the CA to disable validation of the CN, but there's currently no knob exposed for that. If your policy has rules for a different kind than |
Beta Was this translation helpful? Give feedback.
Thank you, that helps a lot in understanding. I analysed a bunch of S/MIME certs from several commercial CAs to understand how they work with CN in the subject. The "CN is a flexible identifier and not an email address" seems to be the most common choice. (I changed the names, obviously:
Telekom Business Security S/MIME
Subject: C=DE, O=Company GmbH, CN=Albert Smith, GN=Albert, SN=Smith, [email protected], organizationIdentifier=NTRDE-HRB111111
GlobalSign GCC R6 SMIME CA 2023
Subject: C=CH, ST=Zürich, L=Zürich, organizationIdentifier=VATCH-CHE-111.111.1111, O=ACompany ag, CN=Albert Lastname
GEANT Personal CA 4
Subject: postalCode=199 99, O=České v Praze, street=Jugoslá…