aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-02-25 16:37:45 +0100
committerHans Nilsson <[email protected]>2019-02-25 16:37:45 +0100
commitb0902f536779b00c2d73763cda42f1cf931cf156 (patch)
tree0ee60461e2507598ce747d9d9039c9c451bb015c /lib
parent7e21a18877374cfaef1fe839a5cd78599eb2d9d6 (diff)
downloadotp-b0902f536779b00c2d73763cda42f1cf931cf156.tar.gz
otp-b0902f536779b00c2d73763cda42f1cf931cf156.tar.bz2
otp-b0902f536779b00c2d73763cda42f1cf931cf156.zip
crypto: Fix bad return code for eddsa if FIPS_SUPPORT
Diffstat (limited to 'lib')
-rw-r--r--lib/crypto/c_src/crypto.c8
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;