aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-09-07 13:46:52 +0200
committerHans Nilsson <[email protected]>2018-09-13 12:07:52 +0200
commit882fa794883e6dbc0e56f22645cd3aec21920c53 (patch)
treefb4a26b8b84bd1553a37c9c7597bf3e4bf26a516 /lib/crypto
parentcb654518a4fa58fa65f46e1386ff91c6375f6f5a (diff)
downloadotp-882fa794883e6dbc0e56f22645cd3aec21920c53.tar.gz
otp-882fa794883e6dbc0e56f22645cd3aec21920c53.tar.bz2
otp-882fa794883e6dbc0e56f22645cd3aec21920c53.zip
crypto: Add missing documentation for enable_fips_mode/1
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/doc/src/crypto.xml21
-rw-r--r--lib/crypto/src/crypto.erl4
2 files changed, 22 insertions, 3 deletions
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml
index 9d436847ac..d5f5009297 100644
--- a/lib/crypto/doc/src/crypto.xml
+++ b/lib/crypto/doc/src/crypto.xml
@@ -642,7 +642,11 @@
crypto and the underlying libcrypto library. If crypto was built
with FIPS support this can be either <c>enabled</c> (when
running in FIPS mode) or <c>not_enabled</c>. For other builds
- this value is always <c>not_supported</c>.</p>
+ this value is always <c>not_supported</c>.
+ </p>
+ <p>See <seealso marker="#enable_fips_mode-1">enable_fips_mode/1</seealso> about how to enable
+ FIPS mode.
+ </p>
<warning>
<p>In FIPS mode all non-FIPS compliant algorithms are
disabled and raise exception <c>error:notsup</c>. Check
@@ -654,6 +658,21 @@
</func>
<func>
+ <name name="enable_fips_mode" arity="1"/>
+ <fsummary>Change FIPS mode.</fsummary>
+ <desc>
+ <p>Enables (<c>Enable = true</c>) or disables (<c>Enable = false</c>) FIPS mode. Returns <c>true</c> if
+ the operation was successful or <c>false</c> otherwise.
+ </p>
+ <p>Note that to enable FIPS mode succesfully, OTP must be built with the configure option <c>--enable-fips</c>,
+ and the underlying libcrypto must also support FIPS.
+ </p>
+ <p>See also <seealso marker="#info_fips-0">info_fips/0</seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
<name name="info_lib" arity="0"/>
<fsummary>Provides information about the libraries used by crypto.</fsummary>
<desc>
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index a841f0f168..c64586897e 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -346,8 +346,8 @@ info_lib() -> ?nif_stub.
info_fips() -> ?nif_stub.
--spec enable_fips_mode(boolean()) -> boolean().
-
+-spec enable_fips_mode(Enable) -> Result when Enable :: boolean(),
+ Result :: boolean().
enable_fips_mode(_) -> ?nif_stub.
%%%================================================================