[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcrypt-devel
Subject:    [PATCH 1/3] Change remaining users of _gcry_fips_mode to use fips_mode
From:       Jussi Kivilinna <jussi.kivilinna () iki ! fi>
Date:       2018-10-27 15:41:57
Message-ID: 154065491741.14250.10262018668761581153.stgit () localhost ! localdomain
[Download RAW message or body]

* src/fips.c (_gcry_fips_mode): Remove.
(_gcry_enforced_fips_mode, _gcry_inactivate_fips_mode)
(_gcry_is_fips_mode_inactive): Use fips_mode.
* src/g10lib.h (_gcry_fips_mode): Remove.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
---
 0 files changed

diff --git a/src/fips.c b/src/fips.c
index 2b3a0af4b..36358bfa5 100644
--- a/src/fips.c
+++ b/src/fips.c
@@ -255,25 +255,11 @@ unlock_fsm (void)
 }
 
 
-/* This function returns true if fips mode is enabled.  This is
-   independent of the fips required finite state machine and only used
-   to enable fips specific code.  Please use the fips_mode macro
-   instead of calling this function directly. */
-int
-_gcry_fips_mode (void)
-{
-  /* No locking is required because we have the requirement that this
-     variable is only initialized once with no other threads
-     existing.  */
-  return !_gcry_no_fips_mode_required;
-}
-
-
 /* Return a flag telling whether we are in the enforced fips mode.  */
 int
 _gcry_enforced_fips_mode (void)
 {
-  if (!_gcry_fips_mode ())
+  if (!fips_mode ())
     return 0;
   return enforced_fips_mode;
 }
@@ -292,7 +278,7 @@ _gcry_set_enforced_fips_mode (void)
 void
 _gcry_inactivate_fips_mode (const char *text)
 {
-  gcry_assert (_gcry_fips_mode ());
+  gcry_assert (fips_mode ());
 
   if (_gcry_enforced_fips_mode () )
     {
@@ -323,7 +309,7 @@ _gcry_is_fips_mode_inactive (void)
 {
   int flag;
 
-  if (!_gcry_fips_mode ())
+  if (!fips_mode ())
     return 0;
   lock_fsm ();
   flag = inactive_fips_mode;
diff --git a/src/g10lib.h b/src/g10lib.h
index c1f84ee3b..c64cbcf2a 100644
--- a/src/g10lib.h
+++ b/src/g10lib.h
@@ -427,8 +427,6 @@ extern int _gcry_no_fips_mode_required;
 
 void _gcry_initialize_fips_mode (int force);
 
-int _gcry_fips_mode (void);
-
 /* This macro returns true if fips mode is enabled.  This is
    independent of the fips required finite state machine and only used
    to enable fips specific code.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic