Skip to content

Commit f7d4135

Browse files
authored
Fix build with OpenSSL < 3.0 (#5)
- replace OPENSSL_VERSION_MAJOR by OPENSSL_VERSIO_NUMBER
1 parent 414571b commit f7d4135

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fips.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package openssl
1717
/*
1818
#include <openssl/ssl.h>
1919
20-
#if OPENSSL_VERSION_MAJOR == 3
20+
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
2121
int FIPS_mode_set(int ONOFF) {
2222
return 0;
2323
}
@@ -35,7 +35,7 @@ func FIPSModeSet(mode bool) error {
3535
runtime.LockOSThread()
3636
defer runtime.UnlockOSThread()
3737

38-
if C.OPENSSL_VERSION_MAJOR == 3 {
38+
if C.OPENSSL_VERSION_NUMBER >= 0x30000000 {
3939
return errors.New("FIPS_mode_set() has been deleted from OpenSSL 3.0")
4040
}
4141

hostname.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package openssl
1717
/*
1818
#include <openssl/ssl.h>
1919
#include <openssl/conf.h>
20-
#if OPENSSL_VERSION_MAJOR == 3
20+
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
2121
#include <openssl/x509v3.h>
2222
typedef const char x509char;
2323
#else

0 commit comments

Comments
 (0)