code sytle update
Change-Id: Ie9845912d9561ee6164b895350abe4a3f962a61e
diff --git a/src/detail/crypto-helpers.cpp b/src/detail/crypto-helpers.cpp
index b3b9520..6b496b3 100644
--- a/src/detail/crypto-helpers.cpp
+++ b/src/detail/crypto-helpers.cpp
@@ -129,7 +129,7 @@
EC_POINT_free(peerPoint);
NDN_THROW(std::runtime_error("Cannot convert peer's key into a EC point when calling EC_POINT_oct2point()"));
}
- EC_KEY *ecPeerkey = EC_KEY_new();
+ EC_KEY* ecPeerkey = EC_KEY_new();
if (ecPeerkey == nullptr) {
EC_POINT_free(peerPoint);
NDN_THROW(std::runtime_error("TBD"));
@@ -143,7 +143,7 @@
EC_POINT_free(peerPoint);
NDN_THROW(std::runtime_error("Cannot initialize peer EC_KEY with the EC_POINT."));
}
- EVP_PKEY *evpPeerkey = EVP_PKEY_new();
+ EVP_PKEY* evpPeerkey = EVP_PKEY_new();
if (EVP_PKEY_set1_EC_KEY(evpPeerkey, ecPeerkey) == 0) {
EC_KEY_free(ecPeerkey);
EC_POINT_free(peerPoint);
@@ -152,33 +152,33 @@
EC_KEY_free(ecPeerkey);
EC_POINT_free(peerPoint);
// ECDH context
- EVP_PKEY_CTX* ctx = EVP_PKEY_CTX_new(m_privkey, NULL);
+ EVP_PKEY_CTX* ctx = EVP_PKEY_CTX_new(m_privkey, nullptr);
if (ctx == nullptr) {
EVP_PKEY_free(evpPeerkey);
NDN_THROW(std::runtime_error("TBD"));
}
- /* Initialise */
- if(1 != EVP_PKEY_derive_init(ctx)) {
+ // Initialize
+ if (1 != EVP_PKEY_derive_init(ctx)) {
EVP_PKEY_CTX_free(ctx);
EVP_PKEY_free(evpPeerkey);
NDN_THROW(std::runtime_error("TBD"));
}
- /* Provide the peer public key */
- if(1 != EVP_PKEY_derive_set_peer(ctx, evpPeerkey)) {
+ // Provide the peer public key
+ if (1 != EVP_PKEY_derive_set_peer(ctx, evpPeerkey)) {
EVP_PKEY_CTX_free(ctx);
EVP_PKEY_free(evpPeerkey);
NDN_THROW(std::runtime_error("TBD"));
}
- /* Determine buffer length for shared secret */
+ // Determine buffer length for shared secret
size_t secretLen = 0;
- if(1 != EVP_PKEY_derive(ctx, NULL, &secretLen)) {
+ if (1 != EVP_PKEY_derive(ctx, nullptr, &secretLen)) {
EVP_PKEY_CTX_free(ctx);
EVP_PKEY_free(evpPeerkey);
NDN_THROW(std::runtime_error("TBD"));
}
- m_secret.resize(secretLen);
- /* Derive the shared secret */
- if(1 != (EVP_PKEY_derive(ctx, m_secret.data(), &secretLen))) {
+ m_secret.resize(secretLen);
+ // Derive the shared secret
+ if (1 != (EVP_PKEY_derive(ctx, m_secret.data(), &secretLen))) {
EVP_PKEY_CTX_free(ctx);
EVP_PKEY_free(evpPeerkey);
NDN_THROW(std::runtime_error("TBD"));
diff --git a/src/detail/crypto-helpers.hpp b/src/detail/crypto-helpers.hpp
index 4461475..5611dcc 100644
--- a/src/detail/crypto-helpers.hpp
+++ b/src/detail/crypto-helpers.hpp
@@ -18,8 +18,8 @@
* See AUTHORS.md for complete list of ndncert authors and contributors.
*/
-#ifndef NDNCERT_DETAIL_CRYPTO_HELPER_HPP
-#define NDNCERT_DETAIL_CRYPTO_HELPER_HPP
+#ifndef NDNCERT_DETAIL_CRYPTO_HELPERS_HPP
+#define NDNCERT_DETAIL_CRYPTO_HELPERS_HPP
#include "ndncert-common.hpp"
#include <openssl/evp.h>
@@ -153,4 +153,4 @@
} // namespace ndncert
} // namespace ndn
-#endif // NDNCERT_DETAIL_CRYPTO_HELPER_HPP
+#endif // NDNCERT_DETAIL_CRYPTO_HELPERS_HPP