зеркало из https://github.com/microsoft/CCF.git
Always sign member commands (#229)
This commit is contained in:
Родитель
430829f598
Коммит
bb43c3482b
|
@ -278,8 +278,9 @@ int main(int argc, char** argv)
|
|||
->required(true)
|
||||
->check(CLI::ExistingFile);
|
||||
|
||||
bool sign = false;
|
||||
app.add_flag("--sign", sign, "Send client-signed transactions");
|
||||
bool force_unsigned = false;
|
||||
app.add_flag(
|
||||
"--force-unsigned", force_unsigned, "Force sending the request unsigned");
|
||||
|
||||
auto add_member = app.add_subcommand("add_member", "Add a new member");
|
||||
string member_cert_file;
|
||||
|
@ -377,10 +378,10 @@ int main(int argc, char** argv)
|
|||
auto tls_cert = make_shared<tls::Cert>(
|
||||
members_sni, make_shared<tls::CA>(ca), raw_cert, raw_key, nullb);
|
||||
|
||||
unique_ptr<RpcTlsClient> tls_connection = sign ?
|
||||
unique_ptr<RpcTlsClient> tls_connection = force_unsigned ?
|
||||
make_unique<RpcTlsClient>(host, port, members_sni, nullptr, tls_cert) :
|
||||
make_unique<SigRpcTlsClient>(
|
||||
raw_key, host, port, members_sni, nullptr, tls_cert) :
|
||||
make_unique<RpcTlsClient>(host, port, members_sni, nullptr, tls_cert);
|
||||
raw_key, host, port, members_sni, nullptr, tls_cert);
|
||||
|
||||
try
|
||||
{
|
||||
|
|
|
@ -118,7 +118,6 @@ def run(args):
|
|||
"--port={}".format(primary.tls_port),
|
||||
"--id=0",
|
||||
"--ca=networkcert.pem",
|
||||
"--sign",
|
||||
)
|
||||
j_result = json.loads(result.stdout)
|
||||
assert not j_result["result"]
|
||||
|
@ -134,6 +133,7 @@ def run(args):
|
|||
"--port={}".format(primary.tls_port),
|
||||
"--id=0",
|
||||
"--ca=networkcert.pem",
|
||||
"--force-unsigned",
|
||||
)
|
||||
j_result = json.loads(result.stdout)
|
||||
assert j_result["error"]["code"] == infra.jsonrpc.ErrorCode.RPC_NOT_SIGNED.value
|
||||
|
@ -148,7 +148,6 @@ def run(args):
|
|||
"--port={}".format(primary.tls_port),
|
||||
"--id=0",
|
||||
"--ca=networkcert.pem",
|
||||
"--sign",
|
||||
)
|
||||
j_result = json.loads(result.stdout)
|
||||
assert j_result["result"]
|
||||
|
|
Загрузка…
Ссылка в новой задаче