File tree 3 files changed +29
-13
lines changed
3 files changed +29
-13
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ set(VCPKG_BUILD_TYPE release)
103
103
# Internal libraries
104
104
add_subdirectory (lib)
105
105
106
+ # External libraries
107
+ find_package (nlohmann_json REQUIRED)
108
+
106
109
# Third-Party libraries in tree
107
110
add_subdirectory (third_party)
108
111
@@ -118,7 +121,11 @@ file(GLOB_RECURSE LIB_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src
118
121
119
122
add_library (${LIB_NAME} ${LIB_HEADERS} ${LIB_SOURCES} )
120
123
add_dependencies (${LIB_NAME} bytes tls_syntax hpke)
121
- target_link_libraries (${LIB_NAME} bytes tls_syntax hpke)
124
+ target_link_libraries (${LIB_NAME}
125
+ PRIVATE
126
+ nlohmann_json::nlohmann_json
127
+ PUBLIC
128
+ bytes tls_syntax hpke)
122
129
target_include_directories (${LIB_NAME}
123
130
PUBLIC
124
131
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include >
Original file line number Diff line number Diff line change 3
3
TEST_CASE (" BoringSSL Define" )
4
4
{
5
5
#if defined(__has_include)
6
- #if __has_include(<openssl/is_boringssl.h>)
7
- #if defined(WITH_BORINGSSL)
8
- REQUIRE (WITH_BORINGSSL);
9
- #else
10
- FAIL (" Expect #WITH_BORINGSSL set when compiling with BoringSSL" );
11
- #endif
12
- #else
13
- SKIP (" Only applicable to BoringSSL" );
14
- #endif
6
+ #if __has_include(<openssl/is_boringssl.h>)
7
+ #if defined(WITH_BORINGSSL)
8
+ REQUIRE (WITH_BORINGSSL);
15
9
#else
16
- SKIP (" Cannot ensure BoringSSL without __has_include()" );
10
+ FAIL (" Expect #WITH_BORINGSSL set when compiling with BoringSSL" );
11
+ #endif
12
+ #else
13
+ SKIP (" Only applicable to BoringSSL" );
14
+ #endif
15
+ #else
16
+ SKIP (" Cannot ensure BoringSSL without __has_include()" );
17
17
#endif
18
18
}
Original file line number Diff line number Diff line change 2
2
3
3
#include < algorithm>
4
4
#include < array>
5
+ #include < cstddef>
5
6
#include < cstdint>
6
7
#include < limits>
7
8
#include < map>
14
15
15
16
namespace MLS_NAMESPACE ::tls {
16
17
18
+ using std::ptrdiff_t ;
19
+ using std::size_t ;
20
+ using std::uint16_t ;
21
+ using std::uint32_t ;
22
+ using std::uint64_t ;
23
+ using std::uint8_t ;
24
+
17
25
// For indicating no min or max in vector definitions
18
26
const size_t none = std::numeric_limits<size_t >::max();
19
27
@@ -288,8 +296,9 @@ operator>>(istream& str, std::vector<T>& vec)
288
296
// NB: Remember that we store the vector in reverse order
289
297
// NB: This requires that T be default-constructible
290
298
istream r;
299
+ const auto size_diff = static_cast <ptrdiff_t >(size);
291
300
r._buffer =
292
- std::vector<uint8_t >{ str._buffer .end () - size , str._buffer .end () };
301
+ std::vector<uint8_t >{ str._buffer .end () - size_diff , str._buffer .end () };
293
302
294
303
vec.clear ();
295
304
while (r._buffer .size () > 0 ) {
@@ -298,7 +307,7 @@ operator>>(istream& str, std::vector<T>& vec)
298
307
}
299
308
300
309
// Truncate the primary buffer
301
- str._buffer .erase (str._buffer .end () - size , str._buffer .end ());
310
+ str._buffer .erase (str._buffer .end () - size_diff , str._buffer .end ());
302
311
303
312
return str;
304
313
}
You can’t perform that action at this time.
0 commit comments