diff options
author | Jack Lloyd <[email protected]> | 2015-07-04 21:17:18 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-07-04 21:17:18 -0400 |
commit | 0eff1bbc141a4c8a481eee230a1b6230d151de0a (patch) | |
tree | 2e54ae7e7c5be73096107e1b7c2585ca4e1db39d /src/tests | |
parent | fee04efff8f4a89589d3bf65ba7d377f1b6b7c65 (diff) |
Misread which call MSVC was complaining about
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_c25519.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tests/test_c25519.cpp b/src/tests/test_c25519.cpp index 1e5854c35..d6f37451b 100644 --- a/src/tests/test_c25519.cpp +++ b/src/tests/test_c25519.cpp @@ -50,18 +50,20 @@ size_t c25519_roundtrip() Curve25519_PrivateKey a_priv_gen(rng); Curve25519_PrivateKey b_priv_gen(rng); + const std::string a_pass = "alice pass"; + const std::string b_pass = "bob pass"; + // Then serialize to encrypted storage const auto pbe_time = std::chrono::milliseconds(10); - const std::string a_priv_pem = PKCS8::PEM_encode(a_priv_gen, rng, "alice pass", pbe_time); - const std::string b_priv_pem = PKCS8::PEM_encode(b_priv_gen, rng, "bob pass", pbe_time); + const std::string a_priv_pem = PKCS8::PEM_encode(a_priv_gen, rng, a_pass, pbe_time); + const std::string b_priv_pem = PKCS8::PEM_encode(b_priv_gen, rng, b_pass, pbe_time); // Reload back into memory DataSource_Memory a_priv_ds(a_priv_pem); DataSource_Memory b_priv_ds(b_priv_pem); - std::function<std::string ()> a_pass_fn = []() { return "alice pass"; }; - std::unique_ptr<Private_Key> a_priv(PKCS8::load_key(a_priv_ds, rng, a_pass_fn)); - std::unique_ptr<Private_Key> b_priv(PKCS8::load_key(b_priv_ds, rng, "bob pass")); + std::unique_ptr<Private_Key> a_priv(PKCS8::load_key(a_priv_ds, rng, [a_pass]() { return a_pass; })); + std::unique_ptr<Private_Key> b_priv(PKCS8::load_key(b_priv_ds, rng, b_pass)); // Export public keys as PEM const std::string a_pub_pem = X509::PEM_encode(*a_priv); |