diff options
author | Hans Nilsson <[email protected]> | 2019-02-25 16:37:45 +0100 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2019-02-25 16:37:45 +0100 |
commit | b0902f536779b00c2d73763cda42f1cf931cf156 (patch) | |
tree | 0ee60461e2507598ce747d9d9039c9c451bb015c /lib/crypto | |
parent | 7e21a18877374cfaef1fe839a5cd78599eb2d9d6 (diff) | |
download | otp-b0902f536779b00c2d73763cda42f1cf931cf156.tar.gz otp-b0902f536779b00c2d73763cda42f1cf931cf156.tar.bz2 otp-b0902f536779b00c2d73763cda42f1cf931cf156.zip |
crypto: Fix bad return code for eddsa if FIPS_SUPPORT
Diffstat (limited to 'lib/crypto')
-rw-r--r-- | lib/crypto/c_src/crypto.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index df607732bf..8e398014d0 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -177,7 +177,8 @@ && !defined(HAS_LIBRESSL) \ && defined(HAVE_EC) # define HAVE_ED_CURVE_DH -# if OPENSSL_VERSION_NUMBER >= (PACKED_OPENSSL_VERSION_PLAIN(1,1,1)) +# if OPENSSL_VERSION_NUMBER >= (PACKED_OPENSSL_VERSION_PLAIN(1,1,1)) \ + && !defined(FIPS_SUPPORT) # define HAVE_EDDSA # endif #endif @@ -4357,8 +4358,11 @@ static int get_pkey_digest_type(ErlNifEnv *env, ERL_NIF_TERM algorithm, ERL_NIF_ *md = NULL; if (type == atom_none && algorithm == atom_rsa) return PKEY_OK; + if (algorithm == atom_eddsa) #ifdef HAVE_EDDSA - if (algorithm == atom_eddsa) return PKEY_OK; + return PKEY_OK; +#else + return PKEY_NOTSUP; #endif digp = get_digest_type(type); if (!digp) return PKEY_BADARG; |