File 2271-crypto-Rename-NIF.patch of Package erlang

From 16f8c3978fc4615dc694ceb3515384b0c98195ff Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Thu, 2 Apr 2020 09:00:40 +0200
Subject: [PATCH 1/2] crypto: Rename NIF

---
 lib/crypto/c_src/crypto.c | 2 +-
 lib/crypto/c_src/fips.c   | 2 +-
 lib/crypto/c_src/fips.h   | 2 +-
 lib/crypto/src/crypto.erl | 5 ++++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index c7e5290b3b..f740b19a94 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -61,7 +61,7 @@ static int library_initialized = 0;
 static ErlNifFunc nif_funcs[] = {
     {"info_lib", 0, info_lib, 0},
     {"info_fips", 0, info_fips, 0},
-    {"enable_fips_mode", 1, enable_fips_mode, 0},
+    {"enable_fips_mode_nif", 1, enable_fips_mode_nif, 0},
     {"hash_algorithms", 0, hash_algorithms, 0},
     {"pubkey_algorithms", 0, pubkey_algorithms, 0},
     {"cipher_algorithms", 0, cipher_algorithms, 0},
diff --git a/lib/crypto/c_src/fips.c b/lib/crypto/c_src/fips.c
index b2d892d00b..072aade7b9 100644
--- a/lib/crypto/c_src/fips.c
+++ b/lib/crypto/c_src/fips.c
@@ -29,7 +29,7 @@ ERL_NIF_TERM info_fips(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
 #endif
 }
 
-ERL_NIF_TERM enable_fips_mode(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+ERL_NIF_TERM enable_fips_mode_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
 {/* (Boolean) */
     if (argv[0] == atom_true) {
 #ifdef FIPS_SUPPORT
diff --git a/lib/crypto/c_src/fips.h b/lib/crypto/c_src/fips.h
index 9a436bd202..293176a581 100644
--- a/lib/crypto/c_src/fips.h
+++ b/lib/crypto/c_src/fips.h
@@ -24,6 +24,6 @@
 #include "common.h"
 
 ERL_NIF_TERM info_fips(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
-ERL_NIF_TERM enable_fips_mode(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM enable_fips_mode_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
 
 #endif /* E_FIPS_H__ */
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 1e88333f83..34f59300a6 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -714,7 +714,10 @@ info_fips() -> ?nif_stub.
 
 -spec enable_fips_mode(Enable) -> Result when Enable :: boolean(),
                                               Result :: boolean().
-enable_fips_mode(_) -> ?nif_stub.
+enable_fips_mode(Enable) ->
+    enable_fips_mode_nif(Enable).
+
+enable_fips_mode_nif(Enable) -> ?nif_stub.
 
 %%%================================================================
 %%%
-- 
2.16.4

openSUSE Build Service is sponsored by