Skip to content

Commit

Permalink
#33 - Removed code duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
PerMalmberg committed Jun 14, 2019
1 parent e37aa40 commit ba5c07e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/smooth/core/network/MbedTLSContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ namespace smooth::core::network
{
log_mbedtls_error(tag, "mbedtls_ssl_config_defaults", res);
}
else
{
mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);
}
}

return res;
Expand All @@ -96,11 +100,6 @@ namespace smooth::core::network
mbedtls_ssl_conf_ca_chain(&conf, &ca_cert, nullptr);
}
}

if (res == 0)
{
mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);
}
}

return res == 0;
Expand All @@ -115,7 +114,6 @@ namespace smooth::core::network

if (res == 0)
{
mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);
res = load_certificate(server_certificate, server_cert);

if (res == 0)
Expand Down

0 comments on commit ba5c07e

Please sign in to comment.