openbmc / phosphor-certificate-manager

Apache License 2.0
6 stars 5 forks source link

Missing "OU" OrganizationalUnit when generating CSR #18

Closed josue0175 closed 3 years ago

josue0175 commented 3 years ago

When creating a CSR via Redfish, the Subject array has 5 fields including a required "OrganizationUnit". However, the backedn is not applying the OrganizationalUnit to the CSR when generating it.

The fix is below:

diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.h
pp
index 81d9d05..d11a241 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -556,6 +556,10 @@ static void updateCertIssuerOrSubject(nlohmann::json& out,
         {
             out["State"] = val;
         }
+        else if (key == "emailAddress")
+        {
+            out["Email"] = val;
+        }
         // skip comma character
         if (i != value.end())
         {
ojayanth commented 3 years ago

Phosphor-cerificate manager back-end code related to CSR geneartion is not included OU info , that is causing this issue. I will push patch to fix this issue.

ojayanth commented 3 years ago

https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-certificate-manager/+/42910