commit | 3021581655861c74e8c0c71ce1ca49bb7b54f72d | [log] [tgz] |
---|---|---|
author | Marri Devender Rao <devenrao@in.ibm.com> | Mon Mar 18 08:59:21 2019 -0500 |
committer | Ed Tanous <ed.tanous@intel.com> | Fri Aug 16 18:08:23 2019 +0000 |
tree | 2a8df7b1185c2301e0470e6c60b7f54dd38105a0 | |
parent | adc4f0db57568c5e5d2a3398fce00dbb050a3b72 [diff] |
Redfish: GenerateCSR action for HTTPS certificate Implemented GenerateCSR action of CertificateService for generating CSR of HTTPS certificate CSR requests initiated through D-Bus are time-consuming and might result D-Bus time-out error GenerateCSR request is performed in child process in the backend so that caller is returned immediately. Caller need to register for "InterfacesAdded" signal generated when a new CSR object is creatd by backend after completion of the CSR request. Caller initiates read on the CSR object created to read the CSR string. Timer is added to cancel the operation if "Interfaces Added" signal is not received in a specified time. Modified to support only 2048 keybit length due to time taken in private key generation. Tested 1) Tested schema with validator and no issues 2) curl -c cjar -b cjar -k -H "X-Auth-Token: $bmc_token" -X POST https://${bmc}/redfish/v1/CertificateService/Actions/CertificateService.GenerateCSR/ -d @generate_https.json { "CSRString": "-----BEGIN CERTIFICATE ..." "CertificateCollection": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" } } 3. generate_https.json { "City": "Austin", "CertificateCollection": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" }, "CommonName": "www.ibm.com", "ContactPerson":"myname", "AlternativeNames":["www.ibm.com"], "ChallengePassword":"", "Email":"openbmc@in.ibm.com", "GivenName":"", "Initials":"", "Country": "US", "KeyCurveId":"", "KeyUsage":["KeyAgreement"], "KeyBitLength": 1024, "KeyPairAlgorithm": "RSA", "Organization": "IBM", "OrganizationalUnit": "ISL", "State": "AU", "Surname": "", "UnstructuredName": "" } 4) Verified Required and Optional parameters 5) Generate EC CSR with curve ID secp224r1 curl -c cjar -b cjar -k -H "X-Auth-Token: $bmc_token" -X POST https://${bmc}/redfish/v1/CertificateService/Actions/CertificateService.GenerateCSR/ -d @generate_https.json { "CSRString": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBQzCB8wIBATCBmzEUMBIGA1UdEQwLd3d3LmlibS5jb20xDzANBgNVBAcMBkF1\nc3RpbjEUMBIGA1UEAwwLd3d3LmlibS5jb20xDzANBgNVBCkMBm15bmFtZTELMAkG\nA1UEBhMCVVMxDDAKBgQrDgMCDAJFQzEVMBMGA1UdDwwMS2V5QWdyZWVtZW50MQww\nCgYDVQQKDANJQk0xCzAJBgNVBAgMAkFVME4wEAYHKoZIzj0CAQYFK4EEACEDOgAE\n7hyL8FWmeCBRpCxWKjlce9nRghwS0lBrBdslOZ+n9+hFD+0KD8L+BORwm7dfzGlG\nTblh2G6cQ8KgADAKBggqhkjOPQQDAgM/ADA8Ahw1nlGdEFfnb+2zxdfVeTQYgCTw\nNos0t2rsGc/zAhxS9/paXZtVqR+WzdQVsjSLC/BedbXv1EmW52Uo\n-----END CERTIFICATE REQUEST-----\n", "CertificateCollection": { "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol/HTTPS/Certificates/" } } Change-Id: I2528c802ff3c6f63570cdb355b9c1195797a0e53 Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
This component attempts to be a "do everything" embedded webserver for openbmc.
At this time, the webserver implements a few interfaces:
BMCWeb is configured by setting -D
flags that correspond to options in bmcweb/CMakeLists.txt
and then compiling. For example, cmake -DBMCWEB_ENABLE_KVM=NO ...
followed by make
. The option names become C++ preprocessor symbols that control which code is compiled into the program.
When BMCWeb starts running, it reads persistent configuration data (such as UUID and session data) from a local file. If this is not usable, it generates a new configuration.
When BMCWeb SSL support is enabled and a usable certificate is not found, it will generate a self-sign a certificate before launching the server. The keys are generated by the prime256v1
algorithm. The certificate
C=US, O=OpenBMC, CN=testhost
,SHA-256
algorithm.The crow project has had a number of additions to make it more useful for use in the OpenBmc Project. A non-exhaustive list is below. At the time of this writing, the crow project is not accepting patches, so for the time being crow will simply be checked in as is.