Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ if(WITH_ASAN)
endif()
endif()


add_subdirectory(kmipcore)
add_subdirectory(kmipclient)

Expand Down
1 change: 0 additions & 1 deletion kmipclient/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ Dec, 2025 Version 0.1.1
Apr, 2025 Version 0.1.0

Initial implementation of all functionality available in "kmippp"

1 change: 0 additions & 1 deletion kmipclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -839,4 +839,3 @@ connection parameters:
```
example_get_tls_verify <host> <port> <client_cert> <client_key> <server_ca_cert> <key_id> <mode: strict, no-hostname, insecure>
```

2 changes: 0 additions & 2 deletions kmipclient/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ The list of things yet to be done
6. Version negotiation with the KMIP server (Default is 1.4)
7. Complete version 2.0 specification support in the scope of current functionality.
8. Additional security features like optional certificates verification, client authentication, etc.


1 change: 1 addition & 0 deletions kmipclient/include/kmipclient/KeyBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ namespace kmipclient {
/** @brief Build protocol-level representation from the client key object.
*/
[[nodiscard]] kmipcore::Key to_core_key() const;

/** @brief Build the corresponding client key subclass from protocol-level
* data. */
[[nodiscard]] static std::unique_ptr<Key>
Expand Down
4 changes: 4 additions & 0 deletions kmipclient/include/kmipclient/Kmip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

#ifndef KMIP_HPP
#define KMIP_HPP

#include "kmipclient/KmipClient.hpp"
#include "kmipclient/NetClientOpenSSL.hpp"
#include "kmipcore/kmip_protocol.hpp"

#include <memory>

namespace kmipclient {

/**
* @brief Convenience wrapper that owns transport and client instances.
*
Expand Down Expand Up @@ -167,5 +169,7 @@ namespace kmipclient {
/** @brief High-level KMIP protocol client bound to @ref m_net_client. */
KmipClient m_client;
};

} // namespace kmipclient

#endif // KMIP_HPP
7 changes: 2 additions & 5 deletions kmipclient/include/kmipclient/KmipClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ namespace kmipclient {
const std::string &name, const std::string &group, const Secret &secret
) const;


/**
* @brief Executes KMIP Create to generate a server-side AES key.
* @param name Value of the KMIP "Name" attribute.
Expand Down Expand Up @@ -209,7 +208,6 @@ namespace kmipclient {
[[nodiscard]] std::vector<std::string>
op_locate_by_name(const std::string &name, object_type o_type) const;


/**
* @brief Executes KMIP Locate using the object group filter.
* @param group Group name to match.
Expand Down Expand Up @@ -246,7 +244,6 @@ namespace kmipclient {
std::optional<std::size_t> *located_items = nullptr
) const;


/**
* @brief Executes KMIP Revoke for a managed object.
* @param id Unique identifier of the object to revoke.
Expand All @@ -263,6 +260,7 @@ namespace kmipclient {
const std::string &message,
time_t occurrence_time
) const;

/**
* @brief Executes KMIP Destroy for a managed object.
* @param id Unique identifier of the object to destroy.
Expand Down Expand Up @@ -305,7 +303,6 @@ namespace kmipclient {
std::optional<std::size_t> *located_items = nullptr
) const;


/**
* @brief Executes KMIP Discover Versions to query supported protocol
* versions.
Expand Down Expand Up @@ -367,7 +364,6 @@ namespace kmipclient {
return close_on_destroy_;
}


private:
NetClient *net_client = nullptr;
std::shared_ptr<NetClient> net_client_owner_;
Expand All @@ -381,4 +377,5 @@ namespace kmipclient {
};

} // namespace kmipclient

#endif // KMIP_CLIENT_HPP
3 changes: 3 additions & 0 deletions kmipclient/include/kmipclient/KmipClientPool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ namespace kmipclient {
public:
// ---- Constants
// -------------------------------------------------------------

/** Default upper bound for simultaneously open KMIP connections. */
static constexpr size_t DEFAULT_MAX_CONNECTIONS = 16;

// ---- Config
// ----------------------------------------------------------------

/**
* @brief Connection and pooling settings used to construct @ref
* KmipClientPool.
Expand Down Expand Up @@ -95,6 +97,7 @@ namespace kmipclient {

// ---- BorrowedClient
// --------------------------------------------------------

/**
* RAII guard wrapping a single borrowed connection.
*
Expand Down
6 changes: 5 additions & 1 deletion kmipclient/include/kmipclient/NetClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <string>

namespace kmipclient {

/**
* @brief Abstract transport interface used by @ref KmipClient.
*
Expand Down Expand Up @@ -68,12 +69,12 @@ namespace kmipclient {
virtual NetClient &operator=(const NetClient &) = delete;
NetClient(NetClient &&) = delete;
virtual NetClient &operator=(NetClient &&) = delete;

/**
* @brief Establishes network/TLS connection to the KMIP server.
* Must honor @ref m_timeout_ms for connect + handshake phases.
* @return true on successful connection establishment, false otherwise.
*/

virtual bool connect() = 0;
/** @brief Closes the connection and releases underlying resources. */
virtual void close() = 0;
Expand Down Expand Up @@ -101,6 +102,7 @@ namespace kmipclient {
* @return true when connected, false otherwise.
*/
[[nodiscard]] bool is_connected() const noexcept { return m_isConnected; }

/**
* @brief Sends bytes over the established connection.
* @param data Source buffer.
Expand All @@ -125,5 +127,7 @@ namespace kmipclient {
TlsVerificationOptions m_tls_verification{};
std::atomic<bool> m_isConnected{false};
};

} // namespace kmipclient

#endif // KMIP_NET_CLIENT_HPP
2 changes: 2 additions & 0 deletions kmipclient/include/kmipclient/NetClientOpenSSL.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void BIO_free_all(BIO *);
}

namespace kmipclient {

/**
* @brief OpenSSL BIO-based implementation of @ref NetClient.
*/
Expand Down Expand Up @@ -96,6 +97,7 @@ namespace kmipclient {

bool checkConnected();
};

} // namespace kmipclient

#endif // KMIPNETCLILENTOPENSSL_HPP
1 change: 0 additions & 1 deletion kmipclient/src/IOUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ namespace kmipclient {
)
);


return response;
}

Expand Down
1 change: 0 additions & 1 deletion kmipclient/src/KmipClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ namespace kmipclient {
.getUniqueIdentifier();
}


std::string KmipClient::op_create_aes_key(
const std::string &name,
const std::string &group,
Expand Down
1 change: 0 additions & 1 deletion kmipclient/src/PrivateKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace kmipclient {


std::unique_ptr<Key> PrivateKey::clone() const {
return std::make_unique<PrivateKey>(*this);
}
Expand Down
1 change: 0 additions & 1 deletion kmipclient/src/PublicKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace kmipclient {


std::unique_ptr<Key> PublicKey::clone() const {
return std::make_unique<PublicKey>(*this);
}
Expand Down
4 changes: 2 additions & 2 deletions kmipclient/src/StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <array>
#include <string_view>
#include <vector>

namespace kmipclient {

unsigned char char2int(const char input) {
Expand Down Expand Up @@ -74,5 +75,4 @@ namespace kmipclient {
return out;
}


} // namespace kmipclient
} // namespace kmipclient
1 change: 0 additions & 1 deletion kmipclient/src/SymmetricKey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ namespace kmipclient {

} // anonymous namespace


std::unique_ptr<Key> SymmetricKey::clone() const {
return std::make_unique<SymmetricKey>(*this);
}
Expand Down
1 change: 0 additions & 1 deletion kmipclient/src/X509Certificate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace kmipclient {


std::unique_ptr<Key> X509Certificate::clone() const {
return std::make_unique<X509Certificate>(*this);
}
Expand Down
2 changes: 0 additions & 2 deletions kmipclient/tests/KmipClientIntegrationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@

using namespace kmipclient;


static std::string TESTING_NAME_PREFIX = "tests_";


// Helper class to manage environment variables
class KmipTestConfig {
public:
Expand Down
1 change: 0 additions & 1 deletion kmipclient/tests/KmipClientPoolIntegrationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ TEST_F(KmipClientPoolIntegrationTest, PoolCreateAndGet) {
}
}


// ============================================================================
// Concurrent Operations Tests
// ============================================================================
Expand Down
1 change: 0 additions & 1 deletion kmipcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ project(kmipcore LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "src/*.cpp")
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS "include/kmipcore/*.hpp")

Expand Down
2 changes: 0 additions & 2 deletions kmipcore/include/kmipcore/kmip_basics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <variant>
#include <vector>


namespace kmipcore {

// Forward declaration for SerializationBuffer
Expand Down Expand Up @@ -201,7 +200,6 @@ namespace kmipcore {
[[nodiscard]] uint32_t toInterval() const;
};


} // namespace kmipcore

#endif /* KMIPCORE_KMIP_BASICS_HPP */
3 changes: 0 additions & 3 deletions kmipcore/include/kmipcore/kmip_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ namespace kmipcore {
/** Generic sentinel value representing unset enum/int fields. */
inline constexpr std::int32_t KMIP_UNSET = -1;


inline constexpr std::int32_t KMIP_OK = 0;
inline constexpr std::int32_t KMIP_NOT_IMPLEMENTED = -1;
inline constexpr std::int32_t KMIP_ERROR_BUFFER_FULL = -2;
Expand Down Expand Up @@ -376,7 +375,6 @@ namespace kmipcore {
KMIP_WRAPTYPE_AS_REGISTERED = 0x02
};


enum class mask_generator : std::uint32_t {
// KMIP 1.4
KMIP_MASKGEN_MGF1 = 0x01
Expand Down Expand Up @@ -2540,7 +2538,6 @@ namespace kmipcore {
inline constexpr std::uint32_t KMIP_SECDATA_EXTENSIONS =
static_cast<std::uint32_t>(secret_data_type::KMIP_SECDATA_EXTENSIONS);


} // namespace kmipcore

#endif // KMIPCORE_KMIP_ENUMS_HPP
2 changes: 1 addition & 1 deletion kmipcore/include/kmipcore/kmip_protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <string>
#include <utility>
#include <vector>

namespace kmipcore {

/**
Expand Down Expand Up @@ -314,7 +315,6 @@ namespace kmipcore {
nextBatchItemId_ = 1;
}


/** @brief Sets maximum response size hint in request header. */
void setMaxResponseSize(size_t size);
/** @brief Returns maximum response size hint from request header. */
Expand Down
3 changes: 0 additions & 3 deletions kmipcore/include/kmipcore/kmip_requests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace kmipcore {
// Construct one and pass it directly to RequestMessage::addBatchItem().
// ---------------------------------------------------------------------------


// ---------------------------------------------------------------------------
// Template for simple requests that only carry a unique identifier.
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -58,7 +57,6 @@ namespace kmipcore {
/** @brief Typed request alias for KMIP Get Attribute List operation. */
using GetAttributeListRequest = SimpleIdRequest<KMIP_OP_GET_ATTRIBUTE_LIST>;


/** @brief Request for KMIP Get Attributes operation. */
class GetAttributesRequest : public RequestBatchItem {
public:
Expand Down Expand Up @@ -201,7 +199,6 @@ namespace kmipcore {
);
};


} // namespace kmipcore

#endif /* KMIPCORE_KMIP_REQUESTS_HPP */
1 change: 0 additions & 1 deletion kmipcore/include/kmipcore/kmip_responses.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ namespace kmipcore {
std::string clusterInfo_;
};


} // namespace kmipcore

#endif /* KMIPCORE_KMIP_RESPONSES_HPP */
1 change: 0 additions & 1 deletion kmipcore/src/kmip_basics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ namespace kmipcore {
}
}


void Element::serialize(SerializationBuffer &buf) const {
// Write Tag (3 bytes, big-endian)
const auto raw_tag = static_cast<std::uint32_t>(tag);
Expand Down
2 changes: 1 addition & 1 deletion kmipcore/src/kmip_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <limits>
#include <span>
#include <vector>

namespace kmipcore {

namespace {
Expand Down Expand Up @@ -286,7 +287,6 @@ namespace kmipcore {
}
}


void RequestMessage::setMaxResponseSize(size_t size) {
if (size > static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
throw KmipException(
Expand Down
1 change: 0 additions & 1 deletion kmipcore/src/kmip_requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,5 +861,4 @@ namespace kmipcore {
setRequestPayload(payload);
}


} // namespace kmipcore
Loading
Loading