diff --git a/README.md b/README.md index a77a4b0c..32fd5e89 100644 --- a/README.md +++ b/README.md @@ -105,13 +105,14 @@ ## studying + * RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1 * RFC 2817 Upgrading to TLS Within HTTP/1.1 * RFC 7540 Hypertext Transfer Protocol Version 2 (HTTP/2) + * RFC 7541 HPACK: Header Compression for HTTP/2 * RFC 9114 HTTP/3 ## next time - * RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1 * RFC 8778 Use of the HSS/LMS Hash-Based Signature Algorithm with CBOR Object Signing and Encryption (COSE) * RFC 9021 Use of the Walnut Digital Signature Algorithm with CBOR Object Signing and Encryption (COSE) * RFC 9054 CBOR Object Signing and Encryption (COSE): Hash Algorithms diff --git a/sdk/base.hpp b/sdk/base.hpp index 056ad14f..0675c6fc 100644 --- a/sdk/base.hpp +++ b/sdk/base.hpp @@ -27,15 +27,22 @@ #include #include #include +#include #include #include #include #include #include + +/* stream */ #include #include #include + +/* string */ #include + +/* system */ #include #include #include @@ -52,11 +59,12 @@ #include #include #include - #if defined _WIN32 || defined _WIN64 #include #include #endif + +/* unittest */ #include #endif diff --git a/sdk/crypto.hpp b/sdk/crypto.hpp index 720e0c6d..8bcbf030 100644 --- a/sdk/crypto.hpp +++ b/sdk/crypto.hpp @@ -11,11 +11,20 @@ #ifndef __HOTPLACE_SDK_CRYPTO__ #define __HOTPLACE_SDK_CRYPTO__ +/* top-most */ #include +#include +#include +#include + +/* authenticode */ #include #include #include #include +#include + +/* basic */ #include #include #include @@ -30,16 +39,21 @@ #include #include #include + +/* COSE */ #include #include #include #include #include #include + +/* JOSE */ +#include +#include #include #include #include -#include -#include +#include #endif diff --git a/sdk/crypto/authenticode/authenticode_plugin.hpp b/sdk/crypto/authenticode/authenticode_plugin.hpp index 2c505c83..d9daef13 100644 --- a/sdk/crypto/authenticode/authenticode_plugin.hpp +++ b/sdk/crypto/authenticode/authenticode_plugin.hpp @@ -17,7 +17,8 @@ #define __HOTPLACE_SDK_CRYPTO_AUTHENTICODE_PLUGIN__ #include -#include +#include +#include #include namespace hotplace { diff --git a/sdk/crypto/authenticode/authenticode_verifier.cpp b/sdk/crypto/authenticode/authenticode_verifier.cpp index 2feb734d..43941aea 100644 --- a/sdk/crypto/authenticode/authenticode_verifier.cpp +++ b/sdk/crypto/authenticode/authenticode_verifier.cpp @@ -10,22 +10,17 @@ */ #include -#include -#include -#include -#include +#include #include #include #include #include #include #include -#include #include namespace hotplace { using namespace io; -using namespace net; namespace crypto { #define AUTHENTICODE_CONTEXT_SIGNATURE 0x20170710 diff --git a/sdk/crypto/authenticode/authenticode_verifier.hpp b/sdk/crypto/authenticode/authenticode_verifier.hpp index e391bd39..55d523cc 100644 --- a/sdk/crypto/authenticode/authenticode_verifier.hpp +++ b/sdk/crypto/authenticode/authenticode_verifier.hpp @@ -26,10 +26,8 @@ #include #include #include -//#include namespace hotplace { -// using namespace io; namespace crypto { class authenticode_plugin; diff --git a/sdk/crypto/authenticode/sdk.hpp b/sdk/crypto/authenticode/sdk.hpp index 5ee16d11..052bad20 100644 --- a/sdk/crypto/authenticode/sdk.hpp +++ b/sdk/crypto/authenticode/sdk.hpp @@ -11,6 +11,7 @@ #ifndef __HOTPLACE_SDK_CRYPTO_AUTHENTICODE_SDK__ #define __HOTPLACE_SDK_CRYPTO_AUTHENTICODE_SDK__ +#include #include #include #include diff --git a/sdk/crypto/cose/cbor_object_signing_encryption.cpp b/sdk/crypto/cose/cbor_object_signing_encryption.cpp index b3557fdd..eff7df44 100644 --- a/sdk/crypto/cose/cbor_object_signing_encryption.cpp +++ b/sdk/crypto/cose/cbor_object_signing_encryption.cpp @@ -180,7 +180,7 @@ return_t cbor_object_signing_encryption::encrypt(cose_context_t* handle, crypto_ return ret; } -return_t cbor_object_signing_encryption::encrypt2(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output) { +return_t cbor_object_signing_encryption::encrypt(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output) { return_t ret = errorcode_t::success; __try2 { @@ -259,7 +259,7 @@ return_t cbor_object_signing_encryption::sign(cose_context_t* handle, crypto_key return ret; } -return_t cbor_object_signing_encryption::sign2(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output) { +return_t cbor_object_signing_encryption::sign(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output) { return_t ret = errorcode_t::success; __try2 { @@ -323,7 +323,7 @@ return_t cbor_object_signing_encryption::mac(cose_context_t* handle, crypto_key* return ret; } -return_t cbor_object_signing_encryption::mac2(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output) { +return_t cbor_object_signing_encryption::mac(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output) { return_t ret = errorcode_t::success; __try2 { diff --git a/sdk/crypto/cose/cbor_object_signing_encryption.hpp b/sdk/crypto/cose/cbor_object_signing_encryption.hpp index a5a900a7..d4c25747 100644 --- a/sdk/crypto/cose/cbor_object_signing_encryption.hpp +++ b/sdk/crypto/cose/cbor_object_signing_encryption.hpp @@ -125,11 +125,11 @@ class cbor_object_signing_encryption { * recipient.get_protected().add(cose_key_t::cose_alg, keyalg); * * // fill others and compose - * ret = cose.encrypt2(handle, key, input, cbor); + * ret = cose.encrypt(handle, key, input, cbor); * } * cose.close(handle); */ - return_t encrypt2(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output); + return_t encrypt(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output); /** * @brief decrypt * @param cose_context_t* handle [in] @@ -190,11 +190,11 @@ class cbor_object_signing_encryption { * body.get_protected().add(cose_key_t::cose_alg, alg); * * // fill others and compose - * ret = cose.sign2(handle, key, input, cbor); + * ret = cose.sign(handle, key, input, cbor); * * cose.close(handle); */ - return_t sign2(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output); + return_t sign(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output); /** * @brief mac * @param cose_context_t* handle [in] @@ -249,11 +249,11 @@ class cbor_object_signing_encryption { * recipient.get_protected().add(cose_key_t::cose_alg, keyalg); * * // fill others and compose - * ret = cose.mac2(handle, key, input, cbor); + * ret = cose.mac(handle, key, input, cbor); * } * cose.close(handle); */ - return_t mac2(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output); + return_t mac(cose_context_t* handle, crypto_key* key, binary_t const& input, binary_t& output); /** * @brief verify with kid * @param cose_context_t* handle [in] diff --git a/sdk/crypto/jose/json_object_encryption.cpp b/sdk/crypto/jose/json_object_encryption.cpp index 9fb1b793..deeaea71 100644 --- a/sdk/crypto/jose/json_object_encryption.cpp +++ b/sdk/crypto/jose/json_object_encryption.cpp @@ -12,8 +12,6 @@ #include #include -#include -#include #include #include #include diff --git a/sdk/crypto/jose/json_object_signing_encryption.cpp b/sdk/crypto/jose/json_object_signing_encryption.cpp index 35e62d0a..0d088327 100644 --- a/sdk/crypto/jose/json_object_signing_encryption.cpp +++ b/sdk/crypto/jose/json_object_signing_encryption.cpp @@ -16,8 +16,6 @@ #include #include -#include -#include #include #include #include diff --git a/sdk/io.hpp b/sdk/io.hpp index e0d35111..9206230a 100644 --- a/sdk/io.hpp +++ b/sdk/io.hpp @@ -11,12 +11,18 @@ #ifndef __HOTPLACE_SDK_IO__ #define __HOTPLACE_SDK_IO__ +/* top-most */ #include +#include + +/* basic */ #include #include #include #include #include + +/* CBOR */ #include #include #include @@ -25,14 +31,21 @@ #include #include #include +#include + +/* stream */ #include #include #include + +/* string */ #include + +/* system */ #include #include #include -#include +#include #if defined __linux__ #elif defined _WIN32 || defined _WIN64 #include diff --git a/sdk/io/basic/json.hpp b/sdk/io/basic/json.hpp index e372e014..1a307ec6 100644 --- a/sdk/io/basic/json.hpp +++ b/sdk/io/basic/json.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include namespace hotplace { diff --git a/sdk/io/basic/keyvalue.cpp b/sdk/io/basic/keyvalue.cpp index 8e74452e..ddd1ec78 100644 --- a/sdk/io/basic/keyvalue.cpp +++ b/sdk/io/basic/keyvalue.cpp @@ -8,7 +8,7 @@ * Date Name Description */ -#include +#include #include namespace hotplace { diff --git a/sdk/io/basic/keyvalue.hpp b/sdk/io/basic/keyvalue.hpp index 013014aa..d73ef15b 100644 --- a/sdk/io/basic/keyvalue.hpp +++ b/sdk/io/basic/keyvalue.hpp @@ -13,8 +13,6 @@ #include #include -#include -#include namespace hotplace { namespace io { diff --git a/sdk/io/basic/zlib.hpp b/sdk/io/basic/zlib.hpp index 50c55abc..7a7c6379 100644 --- a/sdk/io/basic/zlib.hpp +++ b/sdk/io/basic/zlib.hpp @@ -13,7 +13,6 @@ #define __HOTPLACE_SDK_IO_BASIC_ZLIB__ #include -#include namespace hotplace { namespace io { diff --git a/sdk/io/cbor/cbor_encode.cpp b/sdk/io/cbor/cbor_encode.cpp index 9f1a6cc8..24815485 100644 --- a/sdk/io/cbor/cbor_encode.cpp +++ b/sdk/io/cbor/cbor_encode.cpp @@ -11,8 +11,7 @@ * 2023.09.01 Soo Han, Kim refactor */ -#include -#include +#include #include #include diff --git a/sdk/io/cbor/cbor_object.hpp b/sdk/io/cbor/cbor_object.hpp index eb663de6..d352edb0 100644 --- a/sdk/io/cbor/cbor_object.hpp +++ b/sdk/io/cbor/cbor_object.hpp @@ -17,7 +17,6 @@ #include #include #include -#include namespace hotplace { namespace io { diff --git a/sdk/io/cbor/concise_binary_object_representation.hpp b/sdk/io/cbor/concise_binary_object_representation.hpp index 7d5d2ea9..44328d18 100644 --- a/sdk/io/cbor/concise_binary_object_representation.hpp +++ b/sdk/io/cbor/concise_binary_object_representation.hpp @@ -44,7 +44,6 @@ #include #include -#include namespace hotplace { namespace io { diff --git a/sdk/io/stream/ansi_string.cpp b/sdk/io/stream/ansi_string.cpp index 29921a10..f1475c0f 100644 --- a/sdk/io/stream/ansi_string.cpp +++ b/sdk/io/stream/ansi_string.cpp @@ -8,7 +8,7 @@ * Date Name Description */ -#include +#include #include #include diff --git a/sdk/io/stream/dump_memory.cpp b/sdk/io/stream/dump_memory.cpp index 251bb9ec..0cd74558 100644 --- a/sdk/io/stream/dump_memory.cpp +++ b/sdk/io/stream/dump_memory.cpp @@ -8,8 +8,7 @@ * Date Name Description */ -#include -#include +#include #include namespace hotplace { diff --git a/sdk/io/stream/printf.cpp b/sdk/io/stream/printf.cpp index 51e3905c..2d59a575 100644 --- a/sdk/io/stream/printf.cpp +++ b/sdk/io/stream/printf.cpp @@ -9,10 +9,7 @@ */ #include -#include -#include -#include -#include +#include #include #include #include diff --git a/sdk/io/stream/stream.hpp b/sdk/io/stream/stream.hpp index 28184f59..edefb805 100644 --- a/sdk/io/stream/stream.hpp +++ b/sdk/io/stream/stream.hpp @@ -11,10 +11,7 @@ #ifndef __HOTPLACE_SDK_STREAM_STREAM__ #define __HOTPLACE_SDK_STREAM_STREAM__ -#include -#include -#include -#include +#include namespace hotplace { namespace io { diff --git a/sdk/io/stream/string.hpp b/sdk/io/stream/string.hpp index 69f6f813..ee50c4e5 100644 --- a/sdk/io/stream/string.hpp +++ b/sdk/io/stream/string.hpp @@ -11,7 +11,7 @@ #ifndef __HOTPLACE_SDK_IO_STREAM_STRING__ #define __HOTPLACE_SDK_IO_STREAM_STRING__ -#include +#include #include namespace hotplace { diff --git a/sdk/io/string/regex.cpp b/sdk/io/string/regex.cpp index 7130d7a1..770ba56e 100644 --- a/sdk/io/string/regex.cpp +++ b/sdk/io/string/regex.cpp @@ -9,7 +9,7 @@ */ #include -#include +#include #include #if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)) #else diff --git a/sdk/io/string/url.cpp b/sdk/io/string/url.cpp index 3b162e14..66e96fd6 100644 --- a/sdk/io/string/url.cpp +++ b/sdk/io/string/url.cpp @@ -9,7 +9,7 @@ */ #include -#include +#include #include #if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)) #else diff --git a/sdk/io/system/multiplexer.cpp b/sdk/io/system/multiplexer.cpp index 87a0c780..113855f7 100644 --- a/sdk/io/system/multiplexer.cpp +++ b/sdk/io/system/multiplexer.cpp @@ -9,8 +9,7 @@ */ #include -#include -#include +#include #include namespace hotplace { diff --git a/sdk/io/system/sdk.hpp b/sdk/io/system/sdk.hpp index 1015d809..40ce9915 100644 --- a/sdk/io/system/sdk.hpp +++ b/sdk/io/system/sdk.hpp @@ -12,10 +12,14 @@ #define __HOTPLACE_SDK_IO_SYSTEM_SDK__ #include -#include +#include namespace hotplace { -namespace io {} +namespace io { + +// reserved + +} } // namespace hotplace #endif diff --git a/sdk/net.hpp b/sdk/net.hpp index a893e593..bcac30fc 100644 --- a/sdk/net.hpp +++ b/sdk/net.hpp @@ -11,23 +11,20 @@ #ifndef __HOTPLACE_SDK_NET__ #define __HOTPLACE_SDK_NET__ +/* top-most */ #include #include #include +#include + +/* basic */ #include #include #include #include -#include -#include -#include -#include -#include -#include -#include + +/* http */ #include -#include -#include #include #include #include @@ -39,17 +36,36 @@ #include #include #include -#include -#include -#include #include + +/* http/auth */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* http/http2 */ +#include +#include +#include + +/* server */ #include #include #include +#include + +/* TLS */ #include +#include #include #include #include -#include #endif diff --git a/sdk/net/CMakeLists.txt b/sdk/net/CMakeLists.txt index 599eab0f..457a9959 100644 --- a/sdk/net/CMakeLists.txt +++ b/sdk/net/CMakeLists.txt @@ -8,7 +8,8 @@ file (GLOB FILEGROUP_SDK_HEADER_NET ${PROJECT_SOURCE_DIR}/sdk/net/*.hpp ${PROJECT_SOURCE_DIR}/sdk/net/basic/*.hpp ${PROJECT_SOURCE_DIR}/sdk/net/http/*.hpp - ${PROJECT_SOURCE_DIR}/sdk/net/protocol/*.hpp + ${PROJECT_SOURCE_DIR}/sdk/net/http/auth/*.hpp + ${PROJECT_SOURCE_DIR}/sdk/net/http/http2/*.hpp ${PROJECT_SOURCE_DIR}/sdk/net/server/*.hpp ${PROJECT_SOURCE_DIR}/sdk/net/tls/*.hpp ) @@ -17,7 +18,8 @@ file (GLOB FILEGROUP_SDK_SOURCE_NET ${PROJECT_SOURCE_DIR}/sdk/net/*.cpp ${PROJECT_SOURCE_DIR}/sdk/net/basic/*.cpp ${PROJECT_SOURCE_DIR}/sdk/net/http/*.cpp - ${PROJECT_SOURCE_DIR}/sdk/net/protocol/*.cpp + ${PROJECT_SOURCE_DIR}/sdk/net/http/auth/*.cpp + ${PROJECT_SOURCE_DIR}/sdk/net/http/http2/*.cpp ${PROJECT_SOURCE_DIR}/sdk/net/server/*.cpp ${PROJECT_SOURCE_DIR}/sdk/net/tls/*.cpp ) diff --git a/sdk/net/basic/ipaddr_acl.cpp b/sdk/net/basic/ipaddr_acl.cpp index 1bcf4590..b6fe0546 100644 --- a/sdk/net/basic/ipaddr_acl.cpp +++ b/sdk/net/basic/ipaddr_acl.cpp @@ -8,8 +8,8 @@ * Date Name Description */ -#include -#include +#include +#include #include #include // ws2tcpip.h first diff --git a/sdk/net/http/basic_authentication_provider.cpp b/sdk/net/http/auth/basic_authentication_provider.cpp similarity index 82% rename from sdk/net/http/basic_authentication_provider.cpp rename to sdk/net/http/auth/basic_authentication_provider.cpp index 81c5a400..e84fd4f0 100644 --- a/sdk/net/http/basic_authentication_provider.cpp +++ b/sdk/net/http/auth/basic_authentication_provider.cpp @@ -8,18 +8,11 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/basic_authentication_provider.hpp b/sdk/net/http/auth/basic_authentication_provider.hpp similarity index 87% rename from sdk/net/http/basic_authentication_provider.hpp rename to sdk/net/http/auth/basic_authentication_provider.hpp index dc1441a6..8b224c3b 100644 --- a/sdk/net/http/basic_authentication_provider.hpp +++ b/sdk/net/http/auth/basic_authentication_provider.hpp @@ -14,11 +14,13 @@ #include #include -#include -#include -#include +#include +#include #include -#include +#include +#include +#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/basic_credentials.cpp b/sdk/net/http/auth/basic_credentials.cpp similarity index 73% rename from sdk/net/http/basic_credentials.cpp rename to sdk/net/http/auth/basic_credentials.cpp index e0379d15..ccdfe448 100644 --- a/sdk/net/http/basic_credentials.cpp +++ b/sdk/net/http/auth/basic_credentials.cpp @@ -8,17 +8,12 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/basic_credentials.hpp b/sdk/net/http/auth/basic_credentials.hpp similarity index 94% rename from sdk/net/http/basic_credentials.hpp rename to sdk/net/http/auth/basic_credentials.hpp index b3d9d398..693429b9 100644 --- a/sdk/net/http/basic_credentials.hpp +++ b/sdk/net/http/auth/basic_credentials.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include namespace hotplace { diff --git a/sdk/net/http/bearer_authentication_provider.cpp b/sdk/net/http/auth/bearer_authentication_provider.cpp similarity index 84% rename from sdk/net/http/bearer_authentication_provider.cpp rename to sdk/net/http/auth/bearer_authentication_provider.cpp index 553c9196..dd0f5288 100644 --- a/sdk/net/http/bearer_authentication_provider.cpp +++ b/sdk/net/http/auth/bearer_authentication_provider.cpp @@ -8,18 +8,11 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/bearer_authentication_provider.hpp b/sdk/net/http/auth/bearer_authentication_provider.hpp similarity index 90% rename from sdk/net/http/bearer_authentication_provider.hpp rename to sdk/net/http/auth/bearer_authentication_provider.hpp index e504b3fd..6f6bea3c 100644 --- a/sdk/net/http/bearer_authentication_provider.hpp +++ b/sdk/net/http/auth/bearer_authentication_provider.hpp @@ -14,13 +14,13 @@ #include #include -#include -#include -#include +#include +#include #include +#include #include #include -#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/bearer_credentials.cpp b/sdk/net/http/auth/bearer_credentials.cpp similarity index 67% rename from sdk/net/http/bearer_credentials.cpp rename to sdk/net/http/auth/bearer_credentials.cpp index 2b5a5e49..30b167db 100644 --- a/sdk/net/http/bearer_credentials.cpp +++ b/sdk/net/http/auth/bearer_credentials.cpp @@ -8,17 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/bearer_credentials.hpp b/sdk/net/http/auth/bearer_credentials.hpp similarity index 96% rename from sdk/net/http/bearer_credentials.hpp rename to sdk/net/http/auth/bearer_credentials.hpp index 6d6e8b7d..ea84a636 100644 --- a/sdk/net/http/bearer_credentials.hpp +++ b/sdk/net/http/auth/bearer_credentials.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include namespace hotplace { diff --git a/sdk/net/http/custom_credentials.cpp b/sdk/net/http/auth/custom_credentials.cpp similarity index 74% rename from sdk/net/http/custom_credentials.cpp rename to sdk/net/http/auth/custom_credentials.cpp index 1c03d2be..fdd8766d 100644 --- a/sdk/net/http/custom_credentials.cpp +++ b/sdk/net/http/auth/custom_credentials.cpp @@ -8,17 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/custom_credentials.hpp b/sdk/net/http/auth/custom_credentials.hpp similarity index 92% rename from sdk/net/http/custom_credentials.hpp rename to sdk/net/http/auth/custom_credentials.hpp index 2de1de1c..6d32eaae 100644 --- a/sdk/net/http/custom_credentials.hpp +++ b/sdk/net/http/auth/custom_credentials.hpp @@ -14,13 +14,12 @@ #include #include -#include +#include #include namespace hotplace { namespace net { -class http_authenticate_provider; class custom_credentials { public: custom_credentials(); diff --git a/sdk/net/http/digest_access_authentication_provider.cpp b/sdk/net/http/auth/digest_access_authentication_provider.cpp similarity index 95% rename from sdk/net/http/digest_access_authentication_provider.cpp rename to sdk/net/http/auth/digest_access_authentication_provider.cpp index fbe37dc4..2ca3906c 100644 --- a/sdk/net/http/digest_access_authentication_provider.cpp +++ b/sdk/net/http/auth/digest_access_authentication_provider.cpp @@ -8,19 +8,11 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/digest_access_authentication_provider.hpp b/sdk/net/http/auth/digest_access_authentication_provider.hpp similarity index 95% rename from sdk/net/http/digest_access_authentication_provider.hpp rename to sdk/net/http/auth/digest_access_authentication_provider.hpp index 09f82839..2b1e82bf 100644 --- a/sdk/net/http/digest_access_authentication_provider.hpp +++ b/sdk/net/http/auth/digest_access_authentication_provider.hpp @@ -21,12 +21,11 @@ #include #include -#include -#include -#include #include -#include -#include +#include +#include +#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/digest_credentials.cpp b/sdk/net/http/auth/digest_credentials.cpp similarity index 82% rename from sdk/net/http/digest_credentials.cpp rename to sdk/net/http/auth/digest_credentials.cpp index af29bb80..98bd1e44 100644 --- a/sdk/net/http/digest_credentials.cpp +++ b/sdk/net/http/auth/digest_credentials.cpp @@ -8,18 +8,12 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/digest_credentials.hpp b/sdk/net/http/auth/digest_credentials.hpp similarity index 96% rename from sdk/net/http/digest_credentials.hpp rename to sdk/net/http/auth/digest_credentials.hpp index e8450724..5d6d99f6 100644 --- a/sdk/net/http/digest_credentials.hpp +++ b/sdk/net/http/auth/digest_credentials.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include namespace hotplace { diff --git a/sdk/net/http/oauth2.cpp b/sdk/net/http/auth/oauth2.cpp similarity index 97% rename from sdk/net/http/oauth2.cpp rename to sdk/net/http/auth/oauth2.cpp index a711f41c..55d7d590 100644 --- a/sdk/net/http/oauth2.cpp +++ b/sdk/net/http/auth/oauth2.cpp @@ -9,21 +9,9 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include -#include -#include -#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/oauth2.hpp b/sdk/net/http/auth/oauth2.hpp similarity index 96% rename from sdk/net/http/oauth2.hpp rename to sdk/net/http/auth/oauth2.hpp index 5384b0f1..0f07b37a 100644 --- a/sdk/net/http/oauth2.hpp +++ b/sdk/net/http/auth/oauth2.hpp @@ -11,13 +11,13 @@ #ifndef __HOTPLACE_SDK_NET_HTTP_OAUTH2__ #define __HOTPLACE_SDK_NET_HTTP_OAUTH2__ -#include -#include -#include -#include +#include +#include +#include #include -#include -#include +#include +#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/oauth2_credentials.cpp b/sdk/net/http/auth/oauth2_credentials.cpp similarity index 95% rename from sdk/net/http/oauth2_credentials.cpp rename to sdk/net/http/auth/oauth2_credentials.cpp index 8863ad4b..6506e529 100644 --- a/sdk/net/http/oauth2_credentials.cpp +++ b/sdk/net/http/auth/oauth2_credentials.cpp @@ -9,19 +9,11 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/oauth2_credentials.hpp b/sdk/net/http/auth/oauth2_credentials.hpp similarity index 97% rename from sdk/net/http/oauth2_credentials.hpp rename to sdk/net/http/auth/oauth2_credentials.hpp index 2fbec3b3..50e7de17 100644 --- a/sdk/net/http/oauth2_credentials.hpp +++ b/sdk/net/http/auth/oauth2_credentials.hpp @@ -11,13 +11,8 @@ #ifndef __HOTPLACE_SDK_NET_HTTP_OAUTH2_CREDENTIALS__ #define __HOTPLACE_SDK_NET_HTTP_OAUTH2_CREDENTIALS__ -#include -#include -#include -#include -#include -#include -#include +#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/rfc2617_digest.cpp b/sdk/net/http/auth/rfc2617_digest.cpp similarity index 90% rename from sdk/net/http/rfc2617_digest.cpp rename to sdk/net/http/auth/rfc2617_digest.cpp index 6ae4e427..58e14fe1 100644 --- a/sdk/net/http/rfc2617_digest.cpp +++ b/sdk/net/http/auth/rfc2617_digest.cpp @@ -8,13 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/rfc2617_digest.hpp b/sdk/net/http/auth/rfc2617_digest.hpp similarity index 96% rename from sdk/net/http/rfc2617_digest.hpp rename to sdk/net/http/auth/rfc2617_digest.hpp index df47650b..80246a7c 100644 --- a/sdk/net/http/rfc2617_digest.hpp +++ b/sdk/net/http/auth/rfc2617_digest.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include namespace hotplace { diff --git a/sdk/net/http/html_documents.cpp b/sdk/net/http/html_documents.cpp index 28509061..1c76687c 100644 --- a/sdk/net/http/html_documents.cpp +++ b/sdk/net/http/html_documents.cpp @@ -9,16 +9,8 @@ */ #include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/html_documents.hpp b/sdk/net/http/html_documents.hpp index ae0a2285..049967ea 100644 --- a/sdk/net/http/html_documents.hpp +++ b/sdk/net/http/html_documents.hpp @@ -21,10 +21,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http2/hpack.cpp b/sdk/net/http/http2/hpack.cpp new file mode 100644 index 00000000..6763c8b8 --- /dev/null +++ b/sdk/net/http/http2/hpack.cpp @@ -0,0 +1,21 @@ +/* vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab smarttab : */ +/** + * @file {file} + * @author Soo Han, Kim (princeb612.kr@gmail.com) + * @desc + * + * Revision History + * Date Name Description + */ + +#include +#include + +namespace hotplace { +using namespace io; +namespace net { + +// study + +} // namespace net +} // namespace hotplace diff --git a/sdk/net/http/http2/hpack.hpp b/sdk/net/http/http2/hpack.hpp new file mode 100644 index 00000000..fbd0a598 --- /dev/null +++ b/sdk/net/http/http2/hpack.hpp @@ -0,0 +1,27 @@ +/* vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab smarttab : */ +/** + * @file {file} + * @author Soo Han, Kim (princeb612.kr@gmail.com) + * @desc + * + * Revision History + * Date Name Description + */ + +#ifndef __HOTPLACE_SDK_NET_HTTP_HTTP2_HPACK__ +#define __HOTPLACE_SDK_NET_HTTP_HTTP2_HPACK__ + +#include +#include +#include +#include + +namespace hotplace { +namespace net { + +// study + +} // namespace net +} // namespace hotplace + +#endif diff --git a/sdk/net/http/http2_frame.cpp b/sdk/net/http/http2/http2_frame.cpp similarity index 97% rename from sdk/net/http/http2_frame.cpp rename to sdk/net/http/http2/http2_frame.cpp index b4ce3379..d8744ee7 100644 --- a/sdk/net/http/http2_frame.cpp +++ b/sdk/net/http/http2/http2_frame.cpp @@ -13,8 +13,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -157,10 +157,10 @@ void http2_frame_header::dump(stream_t* s) { s->printf("- http/2 frame type %d %s\n", get_type(), frame_name.c_str()); s->printf("> "); - s->printf("%s %u", constexpr_frame_length, get_payload_size()); - s->printf("%s %u", constexpr_frame_type, get_type()); - s->printf("%s %02x", constexpr_frame_flags, get_flags()); - s->printf("%s %u", constexpr_frame_stream_identifier, get_stream_id()); + s->printf("%s %u ", constexpr_frame_length, get_payload_size()); + s->printf("%s %u ", constexpr_frame_type, get_type()); + s->printf("%s %02x ", constexpr_frame_flags, get_flags()); + s->printf("%s %u ", constexpr_frame_stream_identifier, get_stream_id()); s->printf("\n"); s->printf("> %s [ ", constexpr_frame_flags); @@ -560,8 +560,10 @@ void http2_settings_frame::dump(stream_t* s) { h2_setting_map_t::iterator iter; for (iter = _settings.begin(); iter != _settings.end(); iter++) { - s->printf("> %s %u\n", constexpr_frame_identifier, iter->first); - s->printf("> %s %u (0x%08x)\n", constexpr_frame_value, iter->second, iter->second); + s->printf("> "); + s->printf("%s %u ", constexpr_frame_identifier, iter->first); + s->printf("%s %u (0x%08x) ", constexpr_frame_value, iter->second, iter->second); + s->printf("\n"); } } } diff --git a/sdk/net/http/http2_frame.hpp b/sdk/net/http/http2/http2_frame.hpp similarity index 100% rename from sdk/net/http/http2_frame.hpp rename to sdk/net/http/http2/http2_frame.hpp diff --git a/sdk/net/http/http2_protocol.cpp b/sdk/net/http/http2/http2_protocol.cpp similarity index 99% rename from sdk/net/http/http2_protocol.cpp rename to sdk/net/http/http2/http2_protocol.cpp index 4c7ea759..6ccbd113 100644 --- a/sdk/net/http/http2_protocol.cpp +++ b/sdk/net/http/http2/http2_protocol.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include namespace hotplace { diff --git a/sdk/net/http/http2_protocol.hpp b/sdk/net/http/http2/http2_protocol.hpp similarity index 97% rename from sdk/net/http/http2_protocol.hpp rename to sdk/net/http/http2/http2_protocol.hpp index a39bd8ae..23c10b09 100644 --- a/sdk/net/http/http2_protocol.hpp +++ b/sdk/net/http/http2/http2_protocol.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include namespace hotplace { diff --git a/sdk/net/http/http_authentication_provider.cpp b/sdk/net/http/http_authentication_provider.cpp index 484daace..d4b36b4e 100644 --- a/sdk/net/http/http_authentication_provider.cpp +++ b/sdk/net/http/http_authentication_provider.cpp @@ -8,18 +8,11 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/http_authentication_provider.hpp b/sdk/net/http/http_authentication_provider.hpp index 2a7db2b9..9f743c82 100644 --- a/sdk/net/http/http_authentication_provider.hpp +++ b/sdk/net/http/http_authentication_provider.hpp @@ -21,11 +21,10 @@ #include #include -#include -#include +#include #include #include -#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_authentication_resolver.cpp b/sdk/net/http/http_authentication_resolver.cpp index 5f412122..e77e1d2b 100644 --- a/sdk/net/http/http_authentication_resolver.cpp +++ b/sdk/net/http/http_authentication_resolver.cpp @@ -8,16 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include namespace hotplace { using namespace crypto; diff --git a/sdk/net/http/http_authentication_resolver.hpp b/sdk/net/http/http_authentication_resolver.hpp index 56612486..52b32dfe 100644 --- a/sdk/net/http/http_authentication_resolver.hpp +++ b/sdk/net/http/http_authentication_resolver.hpp @@ -21,17 +21,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_client.cpp b/sdk/net/http/http_client.cpp index ca0a886f..a09a0d15 100644 --- a/sdk/net/http/http_client.cpp +++ b/sdk/net/http/http_client.cpp @@ -8,14 +8,11 @@ * Date Name Description */ -#include -#include -#include +#include +#include #include #include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_client.hpp b/sdk/net/http/http_client.hpp index d6782062..f1e6c794 100644 --- a/sdk/net/http/http_client.hpp +++ b/sdk/net/http/http_client.hpp @@ -21,9 +21,7 @@ #include #include -#include -#include -#include +#include #include #include #include diff --git a/sdk/net/http/http_header.cpp b/sdk/net/http/http_header.cpp index 07d1e86e..1c7c1c7d 100644 --- a/sdk/net/http/http_header.cpp +++ b/sdk/net/http/http_header.cpp @@ -8,12 +8,9 @@ * Date Name Description */ -#include -#include -#include -#include +#include +#include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_header.hpp b/sdk/net/http/http_header.hpp index fd287c9d..5ffe1659 100644 --- a/sdk/net/http/http_header.hpp +++ b/sdk/net/http/http_header.hpp @@ -21,13 +21,8 @@ #include #include -#include -#include -#include -#include +#include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_protocol.cpp b/sdk/net/http/http_protocol.cpp index 40ac3ddf..28670462 100644 --- a/sdk/net/http/http_protocol.cpp +++ b/sdk/net/http/http_protocol.cpp @@ -10,7 +10,6 @@ #include #include -#include namespace hotplace { namespace net { diff --git a/sdk/net/http/http_protocol.hpp b/sdk/net/http/http_protocol.hpp index fac12a49..15add0f8 100644 --- a/sdk/net/http/http_protocol.hpp +++ b/sdk/net/http/http_protocol.hpp @@ -12,7 +12,6 @@ #define __HOTPLACE_SDK_NET_HTTP_PROTOCOL__ #include -#include #include namespace hotplace { diff --git a/sdk/net/http/http_request.cpp b/sdk/net/http/http_request.cpp index 8a446550..00f4648e 100644 --- a/sdk/net/http/http_request.cpp +++ b/sdk/net/http/http_request.cpp @@ -8,13 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include +#include +#include #include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_request.hpp b/sdk/net/http/http_request.hpp index f57328ae..61424595 100644 --- a/sdk/net/http/http_request.hpp +++ b/sdk/net/http/http_request.hpp @@ -21,15 +21,10 @@ #include #include -#include -#include -#include -#include +#include #include #include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_resource.cpp b/sdk/net/http/http_resource.cpp index cc2ae1c9..422d930a 100644 --- a/sdk/net/http/http_resource.cpp +++ b/sdk/net/http/http_resource.cpp @@ -8,13 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include -#include +#include +#include +#include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_resource.hpp b/sdk/net/http/http_resource.hpp index f1e6993a..250a59d8 100644 --- a/sdk/net/http/http_resource.hpp +++ b/sdk/net/http/http_resource.hpp @@ -21,13 +21,8 @@ #include #include -#include -#include -#include -#include +#include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_response.cpp b/sdk/net/http/http_response.cpp index 51ecb3ef..bb403c95 100644 --- a/sdk/net/http/http_response.cpp +++ b/sdk/net/http/http_response.cpp @@ -8,14 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include +#include +#include #include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_response.hpp b/sdk/net/http/http_response.hpp index 7142deb7..6715695f 100644 --- a/sdk/net/http/http_response.hpp +++ b/sdk/net/http/http_response.hpp @@ -21,15 +21,11 @@ #include #include -#include -#include -#include -#include +#include #include #include #include -#include -#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_router.cpp b/sdk/net/http/http_router.cpp index 771d2f6d..f9428ff2 100644 --- a/sdk/net/http/http_router.cpp +++ b/sdk/net/http/http_router.cpp @@ -8,17 +8,10 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_router.hpp b/sdk/net/http/http_router.hpp index 26d7a005..eb283252 100644 --- a/sdk/net/http/http_router.hpp +++ b/sdk/net/http/http_router.hpp @@ -21,13 +21,11 @@ #include #include -#include -#include +#include +#include #include #include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_server.cpp b/sdk/net/http/http_server.cpp index 1527a765..6c4643f3 100644 --- a/sdk/net/http/http_server.cpp +++ b/sdk/net/http/http_server.cpp @@ -8,14 +8,9 @@ * Date Name Description */ -#include -#include -#include -#include -#include -#include +#include +#include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_server.hpp b/sdk/net/http/http_server.hpp index 825d85ea..1f4c40db 100644 --- a/sdk/net/http/http_server.hpp +++ b/sdk/net/http/http_server.hpp @@ -19,9 +19,13 @@ #ifndef __HOTPLACE_SDK_NET_HTTP_HTTPSERVER__ #define __HOTPLACE_SDK_NET_HTTP_HTTPSERVER__ +#include +#include #include #include +#include #include +#include // ws2tcpip.h first namespace hotplace { namespace net { diff --git a/sdk/net/http/http_uri.cpp b/sdk/net/http/http_uri.cpp index df5d05b4..a4d650d1 100644 --- a/sdk/net/http/http_uri.cpp +++ b/sdk/net/http/http_uri.cpp @@ -8,12 +8,9 @@ * Date Name Description */ -#include -#include -#include -#include +#include +#include #include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/http_uri.hpp b/sdk/net/http/http_uri.hpp index b33d0dab..96a0e5b8 100644 --- a/sdk/net/http/http_uri.hpp +++ b/sdk/net/http/http_uri.hpp @@ -21,13 +21,7 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/http/types.hpp b/sdk/net/http/types.hpp index 216da8e9..61416d71 100644 --- a/sdk/net/http/types.hpp +++ b/sdk/net/http/types.hpp @@ -21,12 +21,7 @@ #include #include -#include -#include -#include -#include -#include -#include +#include namespace hotplace { using namespace io; diff --git a/sdk/net/server/network_protocol.cpp b/sdk/net/server/network_protocol.cpp index 368a448d..8227b7b8 100644 --- a/sdk/net/server/network_protocol.cpp +++ b/sdk/net/server/network_protocol.cpp @@ -8,7 +8,7 @@ * Date Name Description */ -#include +#include #include namespace hotplace { diff --git a/sdk/net/server/network_protocol.hpp b/sdk/net/server/network_protocol.hpp index fc9f800b..d2315bae 100644 --- a/sdk/net/server/network_protocol.hpp +++ b/sdk/net/server/network_protocol.hpp @@ -13,7 +13,6 @@ #include #include -#include #include namespace hotplace { diff --git a/sdk/net/server/network_server.cpp b/sdk/net/server/network_server.cpp index 57458643..528de96b 100644 --- a/sdk/net/server/network_server.cpp +++ b/sdk/net/server/network_server.cpp @@ -9,13 +9,9 @@ */ #include -#include -#include -#include -#include +#include +#include #include -#include -#include namespace hotplace { using namespace io; diff --git a/sdk/net/server/network_server.hpp b/sdk/net/server/network_server.hpp index 2cf9df8f..96372a5e 100644 --- a/sdk/net/server/network_server.hpp +++ b/sdk/net/server/network_server.hpp @@ -11,9 +11,13 @@ #ifndef __HOTPLACE_SDK_NET_SERVER_NETWORKSERVER__ #define __HOTPLACE_SDK_NET_SERVER_NETWORKSERVER__ +#include +#include #include #include #include +#include +#include #include namespace hotplace { diff --git a/sdk/net/server/network_session.cpp b/sdk/net/server/network_session.cpp index c4fbcbe3..5706eff4 100644 --- a/sdk/net/server/network_session.cpp +++ b/sdk/net/server/network_session.cpp @@ -8,10 +8,8 @@ * Date Name Description */ -#include -#include +#include #include -#include namespace hotplace { namespace net { diff --git a/sdk/net/server/network_session.hpp b/sdk/net/server/network_session.hpp index 5ebf217d..f8d06c7b 100644 --- a/sdk/net/server/network_session.hpp +++ b/sdk/net/server/network_session.hpp @@ -11,17 +11,16 @@ #ifndef __HOTPLACE_SDK_NET_SERVER_NETWORKSESSION__ #define __HOTPLACE_SDK_NET_SERVER_NETWORKSESSION__ -#include -#include +#include +#include +#include #include +#include namespace hotplace { using namespace io; namespace net { -class network_priority_queue; -class tcp_server_socket; - /** * @brief session data */ @@ -100,9 +99,9 @@ class network_session { virtual int release(); /** * @brief produce, push into stream - * @param network_priority_queue* q [IN] - * @param byte_t* buf_read [IN] - * @param size_t size_buf_read [IN] + * @param t_mlfq* q [IN] + * @param byte_t* buf_read [IN] + * @param size_t size_buf_read [IN] * @remarks */ return_t produce(t_mlfq* q, byte_t* buf_read, size_t size_buf_read); diff --git a/sdk/net/server/network_stream.cpp b/sdk/net/server/network_stream.cpp index d28de831..b6c7439d 100644 --- a/sdk/net/server/network_stream.cpp +++ b/sdk/net/server/network_stream.cpp @@ -8,7 +8,8 @@ * Date Name Description */ -#include +#include +#include #include namespace hotplace { diff --git a/sdk/net/server/network_stream.hpp b/sdk/net/server/network_stream.hpp index 61e8eaae..2336a69f 100644 --- a/sdk/net/server/network_stream.hpp +++ b/sdk/net/server/network_stream.hpp @@ -11,7 +11,7 @@ #ifndef __HOTPLACE_SDK_NET_SERVER_NETWORKSTREAM__ #define __HOTPLACE_SDK_NET_SERVER_NETWORKSTREAM__ -#include +#include namespace hotplace { namespace net { diff --git a/sdk/net/tls/sdk.cpp b/sdk/net/tls/sdk.cpp index 345ae2a7..45551a8a 100644 --- a/sdk/net/tls/sdk.cpp +++ b/sdk/net/tls/sdk.cpp @@ -8,7 +8,7 @@ * Date Name Description */ -#include +#include #include namespace hotplace { diff --git a/sdk/net/tls/sdk.hpp b/sdk/net/tls/sdk.hpp index 67139f14..c48b8388 100644 --- a/sdk/net/tls/sdk.hpp +++ b/sdk/net/tls/sdk.hpp @@ -11,7 +11,7 @@ #ifndef __HOTPLACE_SDK_NET_TLS_SDK__ #define __HOTPLACE_SDK_NET_TLS_SDK__ -#include +#include #include namespace hotplace { diff --git a/sdk/net/tls/tls.cpp b/sdk/net/tls/tls.cpp index f92d3baa..ecb928f0 100644 --- a/sdk/net/tls/tls.cpp +++ b/sdk/net/tls/tls.cpp @@ -8,7 +8,7 @@ * Date Name Description */ -#include +#include #include #include #include diff --git a/sdk/net/tls/tls.hpp b/sdk/net/tls/tls.hpp index 9f43c1a8..1687c95e 100644 --- a/sdk/net/tls/tls.hpp +++ b/sdk/net/tls/tls.hpp @@ -11,7 +11,7 @@ #ifndef __HOTPLACE_SDK_NET_TLS_TLS__ #define __HOTPLACE_SDK_NET_TLS_TLS__ -#include +#include #include #include diff --git a/sdk/net/tls/tls_server.cpp b/sdk/net/tls/tls_server.cpp index ead5fa77..f293c439 100644 --- a/sdk/net/tls/tls_server.cpp +++ b/sdk/net/tls/tls_server.cpp @@ -8,7 +8,7 @@ * Date Name Description */ -#include +#include #include namespace hotplace { diff --git a/sdk/net/tls/x509.cpp b/sdk/net/tls/x509.cpp index 083c3d0f..435afb1d 100644 --- a/sdk/net/tls/x509.cpp +++ b/sdk/net/tls/x509.cpp @@ -8,10 +8,9 @@ * Date Name Description */ -#include -#include -#include -#include +#include +#include +#include #include namespace hotplace { diff --git a/sdk/net/tls/x509.hpp b/sdk/net/tls/x509.hpp index f47f7d8c..1cc823cd 100644 --- a/sdk/net/tls/x509.hpp +++ b/sdk/net/tls/x509.hpp @@ -11,7 +11,7 @@ #ifndef __HOTPLACE_SDK_NET_TLS_X509__ #define __HOTPLACE_SDK_NET_TLS_X509__ -#include +#include namespace hotplace { using namespace io; diff --git a/test/cose/sample.cpp b/test/cose/sample.cpp index 5934dc63..98338017 100644 --- a/test/cose/sample.cpp +++ b/test/cose/sample.cpp @@ -22,13 +22,13 @@ using namespace hotplace::crypto; test_case _test_case; typedef struct _OPTION { - bool debug; + bool verbose; bool dump_keys; bool skip_cbor_basic; bool skip_validate; bool skip_gen; - _OPTION() : debug(false), dump_keys(false), skip_cbor_basic(false), skip_validate(false), skip_gen(false) { + _OPTION() : verbose(false), dump_keys(false), skip_cbor_basic(false), skip_validate(false), skip_gen(false) { // do nothing } } OPTION; @@ -56,7 +56,7 @@ return_t dump_test_data(const char* text, binary_t const& cbor) { basic_stream bs; OPTION& option = _cmdline->value(); - if (option.debug) { + if (option.verbose) { dump_memory(cbor, &bs, 32, 4); if (text) { @@ -101,7 +101,7 @@ return_t test_cose_example(cose_context_t* cose_handle, crypto_key* cose_keys, c binary_t bin; publisher.publish(root, &bin); - if (option.debug) { + if (option.verbose) { // cbor_object* to diagnostic basic_stream diagnostic; // publisher.publish(root, &diagnostic); @@ -214,7 +214,7 @@ return_t test_cose_example(cose_context_t* cose_handle, crypto_key* cose_keys, c binary_t decrypted; bool result = false; - if (option.debug) { + if (option.verbose) { cose.set(cose_handle, cose_flag_t::cose_flag_allow_debug); } @@ -229,7 +229,7 @@ return_t test_cose_example(cose_context_t* cose_handle, crypto_key* cose_keys, c case cbor_tag_t::cose_tag_encrypt0: ret = cose.decrypt(cose_handle, cose_keys, bin, decrypted, result); if (errorcode_t::success == ret) { - if (option.debug) { + if (option.verbose) { basic_stream bs; dump_memory(decrypted, &bs, 16, 4); printf("%s\n", bs.c_str()); @@ -292,7 +292,7 @@ void test_cbor_file(const char* expect_file, const char* text) { reader.publish(handle, &root); reader.close(handle); - if (option.debug) { + if (option.verbose) { dump_test_data("diagnostic", bs_diagnostic); dump_test_data("cbor", bin_cbor); } @@ -958,7 +958,7 @@ void test_cbor_key(const char* file, const char* text) { ret = cwk.write(&key, cbor_written); _test_case.test(ret, __FUNCTION__, "step.write %s", text ? text : ""); - if (option.debug) { + if (option.verbose) { test_case_notimecheck notimecheck(_test_case); basic_stream bs; @@ -1036,16 +1036,16 @@ void test_jose_from_cwk() { size_t size = 0; basic_stream json; jwk.write(&privkey, &json, 1); - if (option.debug) { + if (option.verbose) { printf("JWK from CBOR key\n%s\n", json.c_str()); } basic_stream pem; jwk.write_pem(&pubkey, &pem); - if (option.debug) { + if (option.verbose) { printf("PEM (public)\n%s\n", pem.c_str()); } jwk.write_pem(&privkey, &pem); - if (option.debug) { + if (option.verbose) { printf("PEM (private)\n%s\n", pem.c_str()); } @@ -1073,7 +1073,7 @@ void test_jose_from_cwk() { algs.push_back(cose_alg_t::cose_es512); ret = cose.sign(handle, &privkey, algs, convert(input), signature); _test_case.test(ret, __FUNCTION__, "sign"); - if (option.debug) { + if (option.verbose) { test_case_notimecheck notimecheck(_test_case); dump_memory(signature, &bs); @@ -1252,7 +1252,7 @@ void test_github_example() { reader.publish(reader_handle, &diagnostic); reader.publish(reader_handle, &bin_cbor); reader.close(reader_handle); - if (option.debug) { + if (option.verbose) { dump_memory(bin_cbor, &bs, 16, 2); printf("cbor\n%s\n", bs.c_str()); printf("diagnostic\n %s\n", diagnostic.c_str()); @@ -1285,7 +1285,7 @@ void test_github_example() { printf("\e[35m>%s %s\n%s\n\e[0m", b, f, bs.c_str()); \ } - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); dumps("AAD", vector->enc.aad_hex); @@ -1346,7 +1346,7 @@ void test_github_example() { binary_t output; ret = cose.process(handle, mapped_key, cbor, output); - if (option.debug) { + if (option.verbose) { uint32 flags = 0; uint32 debug_flags = 0; cose.get(handle, flags, debug_flags); @@ -1405,18 +1405,18 @@ void test_sign(crypto_key* key, std::list& algs, binary_t const& inp binary_t cbor; binary_t dummy; cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.sign(handle, key, algs, input, cbor); - if (option.debug) { + if (option.verbose) { printf("%s\n", base16_encode(cbor).c_str()); } cose.close(handle); _test_case.test(ret, __FUNCTION__, "sign %s", text); cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.process(handle, key, cbor, dummy); @@ -1434,18 +1434,18 @@ void test_encrypt(crypto_key* key, std::list& algs, binary_t const& binary_t cbor; binary_t dummy; cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.encrypt(handle, key, algs, input, cbor); - if (option.debug) { + if (option.verbose) { printf("%s\n", base16_encode(cbor).c_str()); } cose.close(handle); _test_case.test(ret, __FUNCTION__, "encrypt %s", text); cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.process(handle, key, cbor, dummy); @@ -1463,18 +1463,18 @@ void test_mac(crypto_key* key, std::list& algs, binary_t const& inpu binary_t cbor; binary_t dummy; cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.mac(handle, key, algs, input, cbor); - if (option.debug) { + if (option.verbose) { printf("%s\n", base16_encode(cbor).c_str()); } cose.close(handle); _test_case.test(ret, __FUNCTION__, "mac %s", text); cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.process(handle, key, cbor, dummy); @@ -1565,7 +1565,7 @@ void test_cose_encrypt(crypto_key* key, cose_alg_t alg, cose_alg_t keyalg, binar OPTION& option = _cmdline->value(); cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } @@ -1577,7 +1577,7 @@ void test_cose_encrypt(crypto_key* key, cose_alg_t alg, cose_alg_t keyalg, binar recipient.get_protected().add(cose_key_t::cose_alg, keyalg); // fill others and compose - ret = cose.encrypt2(handle, key, input, cbor); + ret = cose.encrypt(handle, key, input, cbor); } cose.close(handle); @@ -1594,7 +1594,7 @@ void test_cose_sign(crypto_key* key, cose_alg_t alg, cose_alg_t keyalg, binary_t OPTION& option = _cmdline->value(); cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } @@ -1603,7 +1603,7 @@ void test_cose_sign(crypto_key* key, cose_alg_t alg, cose_alg_t keyalg, binary_t body.get_protected().add(cose_key_t::cose_alg, alg); // fill others and compose - ret = cose.encrypt2(handle, key, input, cbor); + ret = cose.encrypt(handle, key, input, cbor); cose.close(handle); @@ -1619,7 +1619,7 @@ void test_cose_mac(crypto_key* key, cose_alg_t alg, cose_alg_t keyalg, binary_t OPTION& option = _cmdline->value(); cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } @@ -1631,7 +1631,7 @@ void test_cose_mac(crypto_key* key, cose_alg_t alg, cose_alg_t keyalg, binary_t recipient.get_protected().add(cose_key_t::cose_alg, keyalg); // fill others and compose - ret = cose.encrypt2(handle, key, input, cbor); + ret = cose.encrypt(handle, key, input, cbor); } cose.close(handle); @@ -1727,7 +1727,7 @@ void test_cwt_rfc8392() { binary_t output; cose.open(&handle); - if (option.debug) { + if (option.verbose) { cose.set(handle, cose_flag_t::cose_flag_allow_debug); } ret = cose.verify(handle, &key, base16_decode(cwt_signed), result); @@ -1749,7 +1749,7 @@ int main(int argc, char** argv) { #endif _cmdline.make_share(new cmdline_t