aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/crypto.c
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2017-12-01 14:50:04 +0100
committerHans Nilsson <[email protected]>2017-12-01 14:50:04 +0100
commitcba4dc777a3b870985d0a925c7b4e827468a4bb2 (patch)
tree54bdae2dd0f751d87682391f1973ceb0c2b56774 /lib/crypto/c_src/crypto.c
parentf4f1feb082cda50cf73d2156f87d663619ad6864 (diff)
parente3a55e0e3d9772b89bcad88e88d914ac2477d2e5 (diff)
downloadotp-cba4dc777a3b870985d0a925c7b4e827468a4bb2.tar.gz
otp-cba4dc777a3b870985d0a925c7b4e827468a4bb2.tar.bz2
otp-cba4dc777a3b870985d0a925c7b4e827468a4bb2.zip
Merge branch 'hans/crypto/fix_wrong_error_return_privkey_to_pubkey' into maint
* hans/crypto/fix_wrong_error_return_privkey_to_pubkey: crypto: engine_SUITE update crypto: fix pubkey_to_privkey
Diffstat (limited to 'lib/crypto/c_src/crypto.c')
-rw-r--r--lib/crypto/c_src/crypto.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index ca6917d56e..3914a48679 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -4825,9 +4825,10 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI
} else if (argv[0] == atom_ecdsa) {
#if defined(HAVE_EC)
- EC_KEY *ec = EVP_PKEY_get1_EC_KEY(pkey);
- if (ec) {
- /* Example of result:
+ /* not yet implemented
+ EC_KEY *ec = EVP_PKEY_get1_EC_KEY(pkey);
+ if (ec) {
+ / * Example of result:
{
Curve = {Field, Prime, Point, Order, CoFactor} =
{
@@ -4841,7 +4842,7 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI
CoFactor = <<1>>
},
Key = <<151,...,62>>
- }
+ }
or
{
Curve =
@@ -4852,16 +4853,13 @@ static ERL_NIF_TERM privkey_to_pubkey_nif(ErlNifEnv* env, int argc, const ERL_NI
},
Key
}
- */
+ * /
EVP_PKEY_free(pkey);
- return atom_notsup;
- }
-#else
- EVP_PKEY_free(pkey);
- return atom_notsup;
+ return enif_make_list_from_array(env, ..., ...);
+ */
#endif
}
-
+
if (pkey) EVP_PKEY_free(pkey);
return enif_make_badarg(env);
}