Skip to content

Commit b095ed4

Browse files
committed
Merge pull request #41 from evoskuil/master
Update certificate handling.
2 parents 1a0ba7b + c2e2cae commit b095ed4

File tree

14 files changed

+68
-72
lines changed

14 files changed

+68
-72
lines changed

builds/msvc/build/buildbase.bat

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ IF NOT EXIST %environment% GOTO no_tools
1111

1212
ECHO Building: %solution%
1313

14-
CALL %environment% x86 > nul
15-
ECHO Platform=x86
16-
17-
ECHO Configuration=StaticDebug
18-
msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% > %log%
19-
IF errorlevel 1 GOTO error
20-
ECHO Configuration=StaticRelease
21-
msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% >> %log%
22-
IF errorlevel 1 GOTO error
23-
2414
CALL %environment% x86_amd64 > nul
2515
ECHO Platform=x64
2616

builds/msvc/vs2013/bitcoin-server/bitcoin-server.vcxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@
119119
<Import Project="..\..\..\..\..\..\nuget\boost_program_options-vc120.1.56.0.0\build\native\boost_program_options-vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\boost_program_options-vc120.1.56.0.0\build\native\boost_program_options-vc120.targets')" />
120120
<Import Project="..\..\..\..\..\..\nuget\boost_regex-vc120.1.56.0.0\build\native\boost_regex-vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\boost_regex-vc120.1.56.0.0\build\native\boost_regex-vc120.targets')" />
121121
<Import Project="..\..\..\..\..\..\nuget\boost_system-vc120.1.56.0.0\build\native\boost_system-vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\boost_system-vc120.1.56.0.0\build\native\boost_system-vc120.targets')" />
122-
<Import Project="..\..\..\..\..\..\nuget\czmq_vc120.2.2.0.8\build\native\czmq_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\czmq_vc120.2.2.0.8\build\native\czmq_vc120.targets')" />
123-
<Import Project="..\..\..\..\..\..\nuget\czmqpp_vc120.1.0.0.10\build\native\czmqpp_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\czmqpp_vc120.1.0.0.10\build\native\czmqpp_vc120.targets')" />
122+
<Import Project="..\..\..\..\..\..\nuget\czmq_vc120.3.0.1.0\build\native\czmq_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\czmq_vc120.3.0.1.0\build\native\czmq_vc120.targets')" />
123+
<Import Project="..\..\..\..\..\..\nuget\czmqpp_vc120.1.1.0.0\build\native\czmqpp_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\czmqpp_vc120.1.1.0.0\build\native\czmqpp_vc120.targets')" />
124124
<Import Project="..\..\..\..\..\..\nuget\libsodium_vc120.1.0.0.0\build\native\libsodium_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\libsodium_vc120.1.0.0.0\build\native\libsodium_vc120.targets')" />
125-
<Import Project="..\..\..\..\..\..\nuget\libzmq_vc120.4.1.0.7\build\native\libzmq_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\libzmq_vc120.4.1.0.7\build\native\libzmq_vc120.targets')" />
125+
<Import Project="..\..\..\..\..\..\nuget\libzmq_vc120.4.2.0.0\build\native\libzmq_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\libzmq_vc120.4.2.0.0\build\native\libzmq_vc120.targets')" />
126126
<Import Project="..\..\..\..\..\..\nuget\secp256k1_vc120.0.1.0.4\build\native\secp256k1_vc120.targets" Condition="Exists('..\..\..\..\..\..\nuget\secp256k1_vc120.0.1.0.4\build\native\secp256k1_vc120.targets')" />
127127
</ImportGroup>
128128
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@@ -136,9 +136,9 @@
136136
<Error Condition="!Exists('..\..\..\..\..\..\nuget\boost_regex-vc120.1.56.0.0\build\native\boost_regex-vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\boost_regex-vc120.1.56.0.0\build\native\boost_regex-vc120.targets'))" />
137137
<Error Condition="!Exists('..\..\..\..\..\..\nuget\boost_system-vc120.1.56.0.0\build\native\boost_system-vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\boost_system-vc120.1.56.0.0\build\native\boost_system-vc120.targets'))" />
138138
<Error Condition="!Exists('..\..\..\..\..\..\nuget\libsodium_vc120.1.0.0.0\build\native\libsodium_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\libsodium_vc120.1.0.0.0\build\native\libsodium_vc120.targets'))" />
139-
<Error Condition="!Exists('..\..\..\..\..\..\nuget\libzmq_vc120.4.1.0.7\build\native\libzmq_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\libzmq_vc120.4.1.0.7\build\native\libzmq_vc120.targets'))" />
140-
<Error Condition="!Exists('..\..\..\..\..\..\nuget\czmq_vc120.2.2.0.8\build\native\czmq_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\czmq_vc120.2.2.0.8\build\native\czmq_vc120.targets'))" />
141-
<Error Condition="!Exists('..\..\..\..\..\..\nuget\czmqpp_vc120.1.0.0.10\build\native\czmqpp_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\czmqpp_vc120.1.0.0.10\build\native\czmqpp_vc120.targets'))" />
139+
<Error Condition="!Exists('..\..\..\..\..\..\nuget\libzmq_vc120.4.2.0.0\build\native\libzmq_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\libzmq_vc120.4.2.0.0\build\native\libzmq_vc120.targets'))" />
140+
<Error Condition="!Exists('..\..\..\..\..\..\nuget\czmq_vc120.3.0.1.0\build\native\czmq_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\czmq_vc120.3.0.1.0\build\native\czmq_vc120.targets'))" />
141+
<Error Condition="!Exists('..\..\..\..\..\..\nuget\czmqpp_vc120.1.1.0.0\build\native\czmqpp_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\czmqpp_vc120.1.1.0.0\build\native\czmqpp_vc120.targets'))" />
142142
<Error Condition="!Exists('..\..\..\..\..\..\nuget\secp256k1_vc120.0.1.0.4\build\native\secp256k1_vc120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\..\..\nuget\secp256k1_vc120.0.1.0.4\build\native\secp256k1_vc120.targets'))" />
143143
</Target>
144144
</Project>

builds/msvc/vs2013/bitcoin-server/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<package id="boost_program_options-vc120" version="1.56.0.0" targetFramework="Native" />
77
<package id="boost_regex-vc120" version="1.56.0.0" targetFramework="Native" />
88
<package id="boost_system-vc120" version="1.56.0.0" targetFramework="Native" />
9-
<package id="czmq_vc120" version="2.2.0.8" targetFramework="Native" />
10-
<package id="czmqpp_vc120" version="1.0.0.10" targetFramework="Native" />
9+
<package id="czmq_vc120" version="3.0.1.0" targetFramework="Native" />
10+
<package id="czmqpp_vc120" version="1.1.0.0" targetFramework="Native" />
1111
<package id="libsodium_vc120" version="1.0.0.0" targetFramework="Native" />
12-
<package id="libzmq_vc120" version="4.1.0.7" targetFramework="Native" />
12+
<package id="libzmq_vc120" version="4.2.0.0" targetFramework="Native" />
1313
<package id="secp256k1_vc120" version="0.1.0.4" targetFramework="Native" />
1414
</packages>

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ AS_IF([test x$bash_completion_dir = xyes],
128128
# The chained zmq dependency doesn't set a minimum version for sodium.
129129
PKG_CHECK_MODULES([sodium], [libsodium >= 1.0.0])
130130

131-
# Require czmq++ of at least version 0.4.1 and output ${czmq___CFLAGS} and ${czmq___LIBS}.
131+
# Require czmq++ of at least version 1.1.0 and output ${czmq___CFLAGS} and ${czmq___LIBS}.
132132
#------------------------------------------------------------------------------
133-
PKG_CHECK_MODULES([czmq__], [libczmq++ >= 0.4.1])
133+
PKG_CHECK_MODULES([czmq__], [libczmq++ >= 1.1.0])
134134

135135
# Require bitcoin-node of at least version 2.0.0 and output ${bitcoin_node_CFLAGS} and ${bitcoin_node_LIBS}.
136136
#------------------------------------------------------------------------------

data/server.cfg

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ publisher_enabled = false
1717
tx_pool_capacity = 2000
1818

1919
[logging]
20-
# The error log file path, defaults to 'error.log'.
21-
error_file = error.log
2220
# The debug log file path, defaults to 'debug.log'.
2321
debug_file = debug.log
22+
# The error log file path, defaults to 'error.log'.
23+
error_file = error.log
2424
# Write service requests to the log, impacts performance, defaults to false.
2525
log_requests = false
2626

@@ -35,15 +35,15 @@ block_publish = tcp://*:9093
3535
tx_publish = tcp://*:9094
3636

3737
[identity]
38-
# The path to the server's certificate, not used by default.
39-
#certificate_file =
40-
# The client certificates directory, allows anonymous clients if not set.
41-
#client_certs_path =
38+
# The path to the ZPL-encoded server private certificate file.
39+
# cert_file =
40+
# The directory for ZPL-encoded client public certificate files, allows anonymous clients if not set.
41+
# client_certs_path =
4242
# Allowed client IP address, all clients allowed if none set, multiple entries allowed.
43-
#client = 127.0.0.1
44-
#client =
43+
# client = 127.0.0.1
44+
# client =
4545
# Node to augment peer discovery, formatted as host:port, multiple entries allowed.
46-
#peer = obelisk.airbitz.co:8333
47-
#peer =
46+
# peer = obelisk.airbitz.co:8333
47+
# peer =
4848
# The server name, must be unique if specified.
49-
#unique_name =
49+
# unique_name =

libbitcoin-server.pc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ URL: https://github.com/libbitcoin/libbitcoin-server
1616
Version: @PACKAGE_VERSION@
1717

1818
# Our dependencies that publish package configuration.
19-
Requires: libsodium >= 1.0.0 libczmq++ >= 0.4.1 libbitcoin-node >= 2.0.0
19+
Requires: libsodium >= 1.0.0 libczmq++ >= 1.1.0 libbitcoin-node >= 2.0.0
2020

2121
# Our own include directory and any other compiler flags we require.
2222
Cflags: -I${includedir} -std=c++11

src/message.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bool incoming_message::recv(czmqpp::socket& socket)
4343
++it;
4444
// [ ID ]
4545
const data_chunk& raw_id = *it;
46-
if (raw_id.size() != 4)
46+
if (raw_id.size() != sizeof(uint32_t))
4747
return false;
4848
id_ = from_little_endian_unsafe<uint32_t>(raw_id.begin());
4949
++it;
@@ -105,7 +105,7 @@ void outgoing_message::send(czmqpp::socket& socket) const
105105
append_str(message, command_);
106106
// [ ID ]
107107
data_chunk raw_id = to_data_chunk(to_little_endian(id_));
108-
BITCOIN_ASSERT(raw_id.size() == 4);
108+
BITCOIN_ASSERT(raw_id.size() == sizeof(id_));
109109
message.append(raw_id);
110110
// [ DATA ]
111111
message.append(data_);

src/node_impl.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ bool node_impl::start(settings_type& config)
148148
void node_impl::start_session()
149149
{
150150
// Start session
151-
auto session_started = [this](const std::error_code& ec)
151+
const auto session_started = [this](const std::error_code& ec)
152152
{
153153
if (ec)
154154
wait_and_retry_start(ec);
@@ -170,14 +170,13 @@ bool node_impl::stop()
170170
{
171171
// Stop session
172172
std::promise<std::error_code> ec_session;
173-
auto session_stopped =
174-
[&](const std::error_code& ec)
173+
const auto session_stopped = [&ec_session](const std::error_code& ec)
175174
{
176175
ec_session.set_value(ec);
177176
};
178177
session_.stop(session_stopped);
179178
// Query the error_code and wait for startup completion.
180-
std::error_code ec = ec_session.get_future().get();
179+
const auto ec = ec_session.get_future().get();
181180
if (ec)
182181
log_error(LOG_NODE) << "Problem stopping session: " << ec.message();
183182

@@ -248,13 +247,13 @@ void node_impl::recv_transaction(const std::error_code& ec,
248247
log_warning(LOG_NODE) << "recv_transaction: " << ec.message();
249248
return;
250249
}
251-
auto handle_deindex = [](const std::error_code& ec)
250+
const auto handle_deindex = [](const std::error_code& ec)
252251
{
253252
if (ec)
254253
log_error(LOG_NODE) << "Deindex error: " << ec.message();
255254
};
256255
// Called when the transaction becomes confirmed in a block.
257-
auto handle_confirm = [this, tx, handle_deindex](
256+
const auto handle_confirm = [this, tx, handle_deindex](
258257
const std::error_code& ec)
259258
{
260259
log_debug(LOG_NODE) << "Confirm transaction: " << ec.message()
@@ -282,15 +281,15 @@ void node_impl::handle_mempool_store(
282281
<< encode_hash(hash_transaction(tx)) << ": " << ec.message();
283282
return;
284283
}
285-
auto handle_index = [](const std::error_code& ec)
284+
const auto handle_index = [](const std::error_code& ec)
286285
{
287286
if (ec)
288287
log_error(LOG_NODE) << "Index error: " << ec.message();
289288
};
290289
indexer_.index(tx, handle_index);
291290
log_info(LOG_NODE) << "Accepted transaction: "
292291
<< encode_hash(hash_transaction(tx));
293-
for (auto notify: notify_txs_)
292+
for (const auto notify: notify_txs_)
294293
notify(tx);
295294
}
296295

@@ -306,7 +305,7 @@ void node_impl::reorganize(const std::error_code& /* ec */,
306305
{
307306
size_t height = fork_point + i + 1;
308307
const block_type& blk = *new_blocks[i];
309-
for (auto notify: notify_blocks_)
308+
for (const auto notify: notify_blocks_)
310309
notify(height, blk);
311310
}
312311
chain_.subscribe_reorganize(

src/publisher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void publisher::send_blk(uint32_t height, const block_type& blk)
7272
{
7373
// Serialize the height.
7474
data_chunk raw_height = to_data_chunk(to_little_endian(height));
75-
BITCOIN_ASSERT(raw_height.size() == 4);
75+
BITCOIN_ASSERT(raw_height.size() == sizeof(uint32_t));
7676
// Serialize the 80 byte header.
7777
data_chunk raw_blk_header(bc::satoshi_raw_size(blk.header));
7878
DEBUG_ONLY(auto it =) satoshi_save(blk.header, raw_blk_header.begin());

src/settings.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,19 @@ const options_description config_type::load_settings()
199199
"The error log file path, defaults to 'error.log'."
200200
)
201201
(
202-
"general.blockchain_path",
203-
value<path>(&settings.blockchain_path)->default_value("blockchain"),
204-
"The blockchain directory, defaults to 'blockchain'."
205-
)
206-
(
207-
"identity.certificate",
208-
value<path>(&settings.certificate_file),
209-
"The path to the server's certificate, not used by default."
202+
"identity.cert_file",
203+
value<path>(&settings.cert_file),
204+
"The path to the ZPL-encoded server private certificate file."
210205
)
211206
(
212207
"identity.client_certs_path",
213208
value<path>(&settings.client_certs_path),
214-
"The client certificates directory, allows anonymous clients if not set."
209+
"The directory for ZPL-encoded client public certificate files, allows anonymous clients if not set."
210+
)
211+
(
212+
"general.blockchain_path",
213+
value<path>(&settings.blockchain_path)->default_value("blockchain"),
214+
"The blockchain directory, defaults to 'blockchain'."
215215
)
216216
(
217217
"identity.client",

0 commit comments

Comments
 (0)