Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 1 | #pragma once |
Jayanth Othayoth | dd74bd2 | 2018-09-28 06:13:35 -0500 | [diff] [blame] | 2 | |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 3 | #include "certificate.hpp" |
| 4 | #include "csr.hpp" |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 5 | #include "watch.hpp" |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 6 | |
Nan Zhou | 014be0b | 2021-12-28 18:00:14 -0800 | [diff] [blame] | 7 | #include <openssl/evp.h> |
| 8 | #include <openssl/ossl_typ.h> |
| 9 | #include <openssl/x509.h> |
| 10 | |
| 11 | #include <cstdint> |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 12 | #include <filesystem> |
Nan Zhou | 014be0b | 2021-12-28 18:00:14 -0800 | [diff] [blame] | 13 | #include <memory> |
| 14 | #include <sdbusplus/server/object.hpp> |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 15 | #include <sdeventplus/source/child.hpp> |
| 16 | #include <sdeventplus/source/event.hpp> |
Nan Zhou | 014be0b | 2021-12-28 18:00:14 -0800 | [diff] [blame] | 17 | #include <string> |
| 18 | #include <vector> |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 19 | #include <xyz/openbmc_project/Certs/CSR/Create/server.hpp> |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 20 | #include <xyz/openbmc_project/Certs/Install/server.hpp> |
Zbigniew Kurzynski | a3bb38f | 2019-09-17 13:34:25 +0200 | [diff] [blame] | 21 | #include <xyz/openbmc_project/Collection/DeleteAll/server.hpp> |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 22 | |
Nan Zhou | e1289ad | 2021-12-28 11:02:56 -0800 | [diff] [blame] | 23 | namespace phosphor::certs |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 24 | { |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 25 | |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 26 | namespace internal |
| 27 | { |
| 28 | using ManagerInterface = sdbusplus::server::object_t< |
| 29 | sdbusplus::xyz::openbmc_project::Certs::server::Install, |
| 30 | sdbusplus::xyz::openbmc_project::Certs::CSR::server::Create, |
| 31 | sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>; |
| 32 | } |
Jayanth Othayoth | b50789c | 2018-10-09 07:13:54 -0500 | [diff] [blame] | 33 | |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 34 | class Manager : public internal::ManagerInterface |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 35 | { |
| 36 | public: |
| 37 | /* Define all of the basic class operations: |
| 38 | * Not allowed: |
| 39 | * - Default constructor is not possible due to member |
| 40 | * reference |
| 41 | * - Move operations due to 'this' being registered as the |
| 42 | * 'context' with sdbus. |
| 43 | * Allowed: |
| 44 | * - copy |
| 45 | * - Destructor. |
| 46 | */ |
| 47 | Manager() = delete; |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 48 | Manager(const Manager&) = delete; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 49 | Manager& operator=(const Manager&) = delete; |
| 50 | Manager(Manager&&) = delete; |
| 51 | Manager& operator=(Manager&&) = delete; |
| 52 | virtual ~Manager() = default; |
| 53 | |
| 54 | /** @brief Constructor to put object onto bus at a dbus path. |
| 55 | * @param[in] bus - Bus to attach to. |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 56 | * @param[in] event - sd event handler. |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 57 | * @param[in] path - Path to attach at. |
| 58 | * @param[in] type - Type of the certificate. |
| 59 | * @param[in] unit - Unit consumed by this certificate. |
Marri Devender Rao | 6ceec40 | 2019-02-01 03:15:19 -0600 | [diff] [blame] | 60 | * @param[in] installPath - Certificate installation path. |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 61 | */ |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 62 | Manager(sdbusplus::bus::bus& bus, sdeventplus::Event& event, |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 63 | const char* path, CertificateType type, const std::string& unit, |
| 64 | const std::string& installPath); |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 65 | |
| 66 | /** @brief Implementation for Install |
| 67 | * Replace the existing certificate key file with another |
| 68 | * (possibly CA signed) Certificate key file. |
| 69 | * |
Marri Devender Rao | 6ceec40 | 2019-02-01 03:15:19 -0600 | [diff] [blame] | 70 | * @param[in] filePath - Certificate key file path. |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 71 | * |
| 72 | * @return Certificate object path. |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 73 | */ |
Zbigniew Kurzynski | 06a69d7 | 2019-09-27 10:57:38 +0200 | [diff] [blame] | 74 | std::string install(const std::string filePath) override; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 75 | |
Zbigniew Kurzynski | a3bb38f | 2019-09-17 13:34:25 +0200 | [diff] [blame] | 76 | /** @brief Implementation for DeleteAll |
| 77 | * Delete all objects in the collection. |
Deepak Kodihalli | ae70b3d | 2018-09-30 05:42:00 -0500 | [diff] [blame] | 78 | */ |
Zbigniew Kurzynski | a3bb38f | 2019-09-17 13:34:25 +0200 | [diff] [blame] | 79 | void deleteAll() override; |
| 80 | |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 81 | /** @brief Delete the certificate. |
Zbigniew Kurzynski | a3bb38f | 2019-09-17 13:34:25 +0200 | [diff] [blame] | 82 | */ |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 83 | void deleteCertificate(const Certificate* const certificate); |
| 84 | |
| 85 | /** @brief Replace the certificate. |
| 86 | */ |
| 87 | void replaceCertificate(Certificate* const certificate, |
| 88 | const std::string& filePath); |
Deepak Kodihalli | ae70b3d | 2018-09-30 05:42:00 -0500 | [diff] [blame] | 89 | |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 90 | /** @brief Generate Private key and CSR file |
| 91 | * Generates the Private key file and CSR file based on the input |
| 92 | * parameters. Validation of the parameters is callers responsibility. |
| 93 | * At present supports only RSA algorithm type |
| 94 | * |
| 95 | * @param[in] alternativeNames - Additional hostnames of the component that |
| 96 | * is being secured. |
| 97 | * @param[in] challengePassword - The challenge password to be applied to |
| 98 | * the certificate for revocation requests. |
| 99 | * @param[in] city - The city or locality of the organization making the |
| 100 | * request. For Example Austin |
| 101 | * @param[in] commonName - The fully qualified domain name of the component |
| 102 | * that is being secured. |
| 103 | * @param[in] contactPerson - The name of the user making the request. |
| 104 | * @param[in] country - The country of the organization making the request. |
| 105 | * @param[in] email - The email address of the contact within the |
| 106 | * organization making the request. |
| 107 | * @param[in] givenName - The given name of the user making the request. |
| 108 | * @param[in] initials - The initials of the user making the request. |
| 109 | * @param[in] keyBitLength - The length of the key in bits, if needed based |
| 110 | * on the value of the KeyPairAlgorithm parameter. |
| 111 | * @param[in] keyCurveId - The curve ID to be used with the key, if needed |
| 112 | * based on the value of the KeyPairAlgorithm parameter. |
| 113 | * @param[in] keyPairAlgorithm - The type of key pair for use with signing |
| 114 | * algorithms. Valid built-in algorithm names for private key |
| 115 | * generation are: RSA, DSA, DH and EC. |
| 116 | * @param[in] keyUsage - Key usage extensions define the purpose of the |
| 117 | * public key contained in a certificate. Valid Key usage extensions |
| 118 | * and its usage description. |
| 119 | * - ClientAuthentication: The public key is used for TLS WWW client |
| 120 | * authentication. |
| 121 | * - CodeSigning: The public key is used for the signing of executable |
| 122 | * code |
| 123 | * - CRLSigning: The public key is used for verifying signatures on |
| 124 | * certificate revocation lists (CLRs). |
| 125 | * - DataEncipherment: The public key is used for directly enciphering |
| 126 | * raw user data without the use of an intermediate symmetric |
| 127 | * cipher. |
| 128 | * - DecipherOnly: The public key could be used for deciphering data |
| 129 | * while performing key agreement. |
| 130 | * - DigitalSignature: The public key is used for verifying digital |
| 131 | * signatures, other than signatures on certificatesand CRLs. |
| 132 | * - EmailProtection: The public key is used for email protection. |
| 133 | * - EncipherOnly: Thepublic key could be used for enciphering data |
| 134 | * while performing key agreement. |
| 135 | * - KeyCertSign: The public key is used for verifying signatures on |
| 136 | * public key certificates. |
| 137 | * - KeyEncipherment: The public key is used for enciphering private or |
| 138 | * secret keys. |
| 139 | * - NonRepudiation: The public key is used to verify digital |
| 140 | * signatures, other than signatures on certificates and CRLs, and |
| 141 | * used to provide a non-repudiation service that protects against |
| 142 | * the signing entity falsely denying some action. |
| 143 | * - OCSPSigning: The public key is used for signing OCSP responses. |
| 144 | * - ServerAuthentication: The public key is used for TLS WWW server |
| 145 | * authentication. |
| 146 | * - Timestamping: The public key is used for binding the hash of an |
| 147 | * object to a time. |
| 148 | * @param[in] organization - The legal name of the organization. This |
| 149 | * should not be abbreviated and should include suffixes such as Inc, |
| 150 | * Corp, or LLC.For example, IBM Corp. |
| 151 | * @param[in] organizationalUnit - The name of the unit or division of the |
| 152 | * organization making the request. |
| 153 | * @param[in] state - The state or province where the organization is |
| 154 | * located. This should not be abbreviated. For example, Texas. |
| 155 | * @param[in] surname - The surname of the user making the request. |
| 156 | * @param[in] unstructuredName - The unstructured name of the subject. |
| 157 | * |
| 158 | * @return path[std::string] - The object path of the D-Bus object |
| 159 | * representing CSR string. Note: For new CSR request will overwrite |
| 160 | * the existing CSR in the system. |
| 161 | */ |
| 162 | std::string generateCSR( |
| 163 | std::vector<std::string> alternativeNames, |
| 164 | std::string challengePassword, std::string city, std::string commonName, |
| 165 | std::string contactPerson, std::string country, std::string email, |
| 166 | std::string givenName, std::string initials, int64_t keyBitLength, |
| 167 | std::string keyCurveId, std::string keyPairAlgorithm, |
| 168 | std::vector<std::string> keyUsage, std::string organization, |
| 169 | std::string organizationalUnit, std::string state, std::string surname, |
| 170 | std::string unstructuredName) override; |
| 171 | |
Kowalski, Kamil | db029c9 | 2019-07-08 17:09:39 +0200 | [diff] [blame] | 172 | /** @brief Get reference to certificates' collection |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 173 | * |
Kowalski, Kamil | db029c9 | 2019-07-08 17:09:39 +0200 | [diff] [blame] | 174 | * @return Reference to certificates' collection |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 175 | */ |
Kowalski, Kamil | db029c9 | 2019-07-08 17:09:39 +0200 | [diff] [blame] | 176 | std::vector<std::unique_ptr<Certificate>>& getCertificates(); |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 177 | |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 178 | private: |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 179 | void generateCSRHelper(std::vector<std::string> alternativeNames, |
| 180 | std::string challengePassword, std::string city, |
| 181 | std::string commonName, std::string contactPerson, |
| 182 | std::string country, std::string email, |
| 183 | std::string givenName, std::string initials, |
| 184 | int64_t keyBitLength, std::string keyCurveId, |
| 185 | std::string keyPairAlgorithm, |
| 186 | std::vector<std::string> keyUsage, |
| 187 | std::string organization, |
| 188 | std::string organizationalUnit, std::string state, |
| 189 | std::string surname, std::string unstructuredName); |
| 190 | |
Ramesh Iyyar | 8a09b52 | 2019-06-07 05:23:29 -0500 | [diff] [blame] | 191 | /** @brief Generate RSA Key pair and get private key from key pair |
| 192 | * @param[in] keyBitLength - KeyBit length. |
| 193 | * @return Pointer to RSA private key |
| 194 | */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 195 | std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)> |
| 196 | generateRSAKeyPair(const int64_t keyBitLength); |
Ramesh Iyyar | 8a09b52 | 2019-06-07 05:23:29 -0500 | [diff] [blame] | 197 | |
| 198 | /** @brief Generate EC Key pair and get private key from key pair |
| 199 | * @param[in] p_KeyCurveId - Curve ID |
| 200 | * @return Pointer to EC private key |
| 201 | */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 202 | std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)> |
| 203 | generateECKeyPair(const std::string& p_KeyCurveId); |
Ramesh Iyyar | 8a09b52 | 2019-06-07 05:23:29 -0500 | [diff] [blame] | 204 | |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 205 | /** @brief Write private key data to file |
| 206 | * |
Ramesh Iyyar | 8a09b52 | 2019-06-07 05:23:29 -0500 | [diff] [blame] | 207 | * @param[in] pKey - pointer to private key |
Ramesh Iyyar | c6e58c7 | 2019-07-16 08:52:47 -0500 | [diff] [blame] | 208 | * @param[in] privKeyFileName - private key filename |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 209 | */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 210 | void writePrivateKey( |
| 211 | const std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)>& pKey, |
| 212 | const std::string& privKeyFileName); |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 213 | |
| 214 | /** @brief Add the specified CSR field with the data |
| 215 | * @param[in] x509Name - Structure used in setting certificate properties |
| 216 | * @param[in] field - field name |
| 217 | * @param[in] bytes - field value in bytes |
| 218 | */ |
| 219 | void addEntry(X509_NAME* x509Name, const char* field, |
| 220 | const std::string& bytes); |
| 221 | |
Marri Devender Rao | 7641105 | 2019-08-07 01:25:07 -0500 | [diff] [blame] | 222 | /** @brief Check if usage is extended key usage |
| 223 | * @param[in] usage - key usage value |
| 224 | * @return true if part of extended key usage |
| 225 | */ |
| 226 | bool isExtendedKeyUsage(const std::string& usage); |
| 227 | |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 228 | /** @brief Create CSR D-Bus object by reading the data in the CSR file |
Nan Zhou | bf3cf75 | 2021-12-28 11:02:07 -0800 | [diff] [blame] | 229 | * @param[in] statis - SUCCESS/FAILURE In CSR generation. |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 230 | */ |
| 231 | void createCSRObject(const Status& status); |
| 232 | |
| 233 | /** @brief Write generated CSR data to file |
| 234 | * |
| 235 | * @param[in] filePath - CSR file path. |
| 236 | * @param[in] x509Req - OpenSSL Request Pointer. |
| 237 | */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 238 | void writeCSR( |
| 239 | const std::string& filePath, |
| 240 | const std::unique_ptr<X509_REQ, decltype(&::X509_REQ_free)>& x509Req); |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 241 | |
Nan Zhou | bf3cf75 | 2021-12-28 11:02:07 -0800 | [diff] [blame] | 242 | /** @brief Load certificate |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 243 | * Load certificate and create certificate object |
| 244 | */ |
Kowalski, Kamil | db029c9 | 2019-07-08 17:09:39 +0200 | [diff] [blame] | 245 | void createCertificates(); |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 246 | |
Ramesh Iyyar | c6e58c7 | 2019-07-16 08:52:47 -0500 | [diff] [blame] | 247 | /** @brief Create RSA private key file |
| 248 | * Create RSA private key file by generating rsa key if not created |
| 249 | */ |
| 250 | void createRSAPrivateKeyFile(); |
| 251 | |
| 252 | /** @brief Getting RSA private key |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 253 | * Getting RSA private key from generated file |
Ramesh Iyyar | c6e58c7 | 2019-07-16 08:52:47 -0500 | [diff] [blame] | 254 | * @param[in] keyBitLength - Key bit length |
| 255 | * @return Pointer to RSA key |
| 256 | */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 257 | std::unique_ptr<EVP_PKEY, decltype(&::EVP_PKEY_free)> |
| 258 | getRSAKeyPair(const int64_t keyBitLength); |
Ramesh Iyyar | c6e58c7 | 2019-07-16 08:52:47 -0500 | [diff] [blame] | 259 | |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 260 | /** @brief Update certificate storage (remove outdated files, recreate |
| 261 | * symbolic links, etc.). |
| 262 | */ |
| 263 | void storageUpdate(); |
| 264 | |
| 265 | /** @brief Systemd unit reload or reset helper function |
| 266 | * Reload if the unit supports it and use a restart otherwise. |
| 267 | * @param[in] unit - service need to reload. |
| 268 | */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 269 | void reloadOrReset(const std::string& unit); |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 270 | |
| 271 | /** @brief Check if provided certificate is unique across all certificates |
| 272 | * on the internal list. |
| 273 | * @param[in] certFilePath - Path to the file with certificate for |
| 274 | * uniqueness check. |
| 275 | * @param[in] certToDrop - Pointer to the certificate from the internal |
| 276 | * list which should be not taken into account while uniqueness check. |
| 277 | * @return Checking result. True if certificate is unique, false if |
| 278 | * not. |
| 279 | */ |
| 280 | bool isCertificateUnique(const std::string& certFilePath, |
| 281 | const Certificate* const certToDrop = nullptr); |
| 282 | |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 283 | /** @brief sdbusplus handler */ |
| 284 | sdbusplus::bus::bus& bus; |
| 285 | |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 286 | // sdevent Event handle |
| 287 | sdeventplus::Event& event; |
| 288 | |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 289 | /** @brief object path */ |
Marri Devender Rao | 6ceec40 | 2019-02-01 03:15:19 -0600 | [diff] [blame] | 290 | std::string objectPath; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 291 | |
| 292 | /** @brief Type of the certificate **/ |
Marri Devender Rao | 6ceec40 | 2019-02-01 03:15:19 -0600 | [diff] [blame] | 293 | CertificateType certType; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 294 | |
| 295 | /** @brief Unit name associated to the service **/ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 296 | std::string unitToRestart; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 297 | |
| 298 | /** @brief Certificate file installation path **/ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 299 | std::string certInstallPath; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 300 | |
Kowalski, Kamil | db029c9 | 2019-07-08 17:09:39 +0200 | [diff] [blame] | 301 | /** @brief Collection of pointers to certificate */ |
| 302 | std::vector<std::unique_ptr<Certificate>> installedCerts; |
Jayanth Othayoth | cfbc8dc | 2018-09-03 07:22:27 -0500 | [diff] [blame] | 303 | |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 304 | /** @brief pointer to CSR */ |
| 305 | std::unique_ptr<CSR> csrPtr = nullptr; |
| 306 | |
| 307 | /** @brief SDEventPlus child pointer added to event loop */ |
Marri Devender Rao | ffad1ef | 2019-06-03 04:54:12 -0500 | [diff] [blame] | 308 | std::unique_ptr<sdeventplus::source::Child> childPtr = nullptr; |
| 309 | |
| 310 | /** @brief Watch on self signed certificates */ |
| 311 | std::unique_ptr<Watch> certWatchPtr = nullptr; |
Ramesh Iyyar | c6e58c7 | 2019-07-16 08:52:47 -0500 | [diff] [blame] | 312 | |
Zbigniew Lukwinski | 2f3563c | 2020-01-08 12:35:23 +0100 | [diff] [blame] | 313 | /** @brief Parent path i.e certificate directory path */ |
Nan Zhou | cf06ccd | 2021-12-28 16:25:45 -0800 | [diff] [blame] | 314 | std::filesystem::path certParentInstallPath; |
Kowalski, Kamil | db029c9 | 2019-07-08 17:09:39 +0200 | [diff] [blame] | 315 | |
| 316 | /** @brief Certificate ID pool */ |
| 317 | uint64_t certIdCounter = 1; |
Marri Devender Rao | f468271 | 2019-03-19 05:00:28 -0500 | [diff] [blame] | 318 | }; |
Nan Zhou | e1289ad | 2021-12-28 11:02:56 -0800 | [diff] [blame] | 319 | } // namespace phosphor::certs |