Skip to content

Commit

Permalink
Add missing header file in kexgexc.c and remove it from kexgex.c
Browse files Browse the repository at this point in the history
Also change definition of FIPS_mode() to the one done in the OpenSSL 3.x
packages of Fedora/RHEL/CentOS/...

Fixes gridcf#207
  • Loading branch information
fscheiner committed Feb 1, 2023
1 parent 200cb06 commit 4afc931
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions gsi_openssh/source/fips_mode_replacement.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
* limitations under the License.
*/

#ifndef FIPS_MODE_REPLACEMENT_H
#define FIPS_MODE_REPLACEMENT_H

#if OPENSSL_VERSION_NUMBER >= 0x30000000L
/*
* OpenSSL version 3.0 and up no longer has FIPS_mode().
* Making a replacement function is not feasible since FIPS would need to be
* initialized differently in any case.
* See https://www.openssl.org/docs/manmaster/man7/fips_module.html for details
* OpenSSL versions 3.0 and up no longer have FIPS_mode(). To support both
* OpenSSL 3.x and older versions for other OSes, we use the replacement
* function as shipped by Fedora/RHEL/CentOS in their OpenSSL 3.x packages.
*/
# define FIPS_mode() 0
#endif
# ifndef FIPS_mode
# define FIPS_mode() EVP_default_properties_is_fips_enabled(NULL)
# endif /* FIPS_mode */
#endif /* openssl */

#endif /* FIPS_MODE_REPLACEMENT_H */
1 change: 0 additions & 1 deletion gsi_openssh/source/kexgex.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <signal.h>

#include "openbsd-compat/openssl-compat.h"
#include "fips_mode_replacement.h"

#include "sshkey.h"
#include "cipher.h"
Expand Down
1 change: 1 addition & 0 deletions gsi_openssh/source/kexgexc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <signal.h>

#include "openbsd-compat/openssl-compat.h"
#include "fips_mode_replacement.h"

#include "sshkey.h"
#include "cipher.h"
Expand Down

0 comments on commit 4afc931

Please sign in to comment.