blob: 9d119b3a0eb4993045c7061312f2add938c86add [file] [log] [blame]
Adriana Kobylak70ca2422018-09-06 14:23:38 -05001#pragma once
2
3// With OpenSSL 1.1.0, some functions were deprecated. Need to abstract them
4// to make the code backward compatible with older OpenSSL veresions.
5// Reference: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
6#if OPENSSL_VERSION_NUMBER < 0x10100000L
7
8#include <openssl/evp.h>
9
Lei YUe4994462019-03-14 14:41:53 +080010#include <sdbusplus/bus.hpp>
11
Adriana Kobylak70ca2422018-09-06 14:23:38 -050012extern "C" {
13EVP_MD_CTX* EVP_MD_CTX_new(void);
14void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
15}
16
Lei YUe4994462019-03-14 14:41:53 +080017namespace utils
18{
19
20/**
21 * @brief Gets the D-Bus Service name for the input D-Bus path
22 *
23 * @param[in] bus - Bus handler
24 * @param[in] path - Object Path
25 * @param[in] intf - Interface
26 *
27 * @return Service name
28 * @error InternalFailure exception thrown
29 */
30std::string getService(sdbusplus::bus::bus& bus, const std::string& path,
31 const std::string& intf);
32
33/** @brief Suspend hiomapd.
34 *
35 * @param[in] bus - The D-Bus bus object.
36 */
37void hiomapdSuspend(sdbusplus::bus::bus& bus);
38
39/** @brief Resume hiomapd.
40 *
41 * @param[in] bus - The D-Bus bus object.
42 */
43void hiomapdResume(sdbusplus::bus::bus& bus);
44
45} // namespace utils
46
Adriana Kobylak70ca2422018-09-06 14:23:38 -050047#endif // OPENSSL_VERSION_NUMBER < 0x10100000L