diff options
author | Hans Nilsson <[email protected]> | 2017-12-01 14:50:17 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2017-12-01 14:50:17 +0100 |
commit | 16937d18834798ab77e0f2aaa302a3ef384639ae (patch) | |
tree | 9fd36e6b9cfc963c02d1356ddc6c7f719cb58242 /lib/crypto/c_src | |
parent | eb065a0daadfcdc2bd0bc124ebb81175010b1b39 (diff) | |
parent | cba4dc777a3b870985d0a925c7b4e827468a4bb2 (diff) | |
download | otp-16937d18834798ab77e0f2aaa302a3ef384639ae.tar.gz otp-16937d18834798ab77e0f2aaa302a3ef384639ae.tar.bz2 otp-16937d18834798ab77e0f2aaa302a3ef384639ae.zip |
Merge branch 'maint'
* maint:
crypto: engine_SUITE update
crypto: fix pubkey_to_privkey
Diffstat (limited to 'lib/crypto/c_src')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 20 |
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); } |