git: 4e67a8cc1c3d - stable/12 - wpa: Fix WITHOUT_OPENSSL build

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Mon, 22 Nov 2021 18:20:09 UTC
The branch stable/12 has been updated by cy:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e67a8cc1c3dcb2cd27c6dc8c254d62a5ef0d509

commit 4e67a8cc1c3dcb2cd27c6dc8c254d62a5ef0d509
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-11-09 22:52:44 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-11-22 18:19:32 +0000

    wpa: Fix WITHOUT_OPENSSL build
    
    PR:             259517
    Reported by:    emaste, FreeBSD Build Option Survey
                    https://callfortesting.org/results/bos-2021-11-04/
    Fixes:          c1d255d3ffdbe447de3ab875bf4e7d7accc5bfc5
    
    (cherry picked from commit ba5de3c2b3b84fd547ddcc0e678a013e5df87db1)
---
 usr.sbin/wpa/Makefile.inc            | 5 ++++-
 usr.sbin/wpa/src/tls/Makefile        | 9 +++++----
 usr.sbin/wpa/wpa_supplicant/Makefile | 5 ++++-
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc
index e9a2053c6095..71ec3f8510d1 100644
--- a/usr.sbin/wpa/Makefile.inc
+++ b/usr.sbin/wpa/Makefile.inc
@@ -54,7 +54,6 @@ CFLAGS+=-DCONFIG_TDLS
 CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF
 CFLAGS+=-DCONFIG_TLS=openssl
 CFLAGS+=-DCONFIG_MATCH_IFACE
-CFLAGS+=-DCONFIG_PASN
 CFLAGS+=-DCONFIG_PTKSA_CACHE
 CFLAGS+=-DEAP_SERVER
 CFLAGS+=-DEAP_SERVER_GTC
@@ -89,6 +88,10 @@ NEED_AES_ENCBLOCK=y
 NEED_AES_OMAC1=y
 .endif
 
+.if ${MK_OPENSSL} != "no"
+CFLAGS+=-DCONFIG_PASN
+.endif
+
 .if !empty(CFLAGS:M*-DEAP_AKA)
 NEED_SIM_COMMON=y
 NEED_AES_CBC=y
diff --git a/usr.sbin/wpa/src/tls/Makefile b/usr.sbin/wpa/src/tls/Makefile
index e5fdf96444d6..fbb57b9c4c10 100644
--- a/usr.sbin/wpa/src/tls/Makefile
+++ b/usr.sbin/wpa/src/tls/Makefile
@@ -29,13 +29,14 @@ SRCS+=	asn1.c \
 	tlsv1_server_read.c \
 	tlsv1_server_write.c \
 	x509v3.c
-.endif
-.endif
 
 CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \
-	-DCONFIG_CRYPTO_INTERNAL \
-	-DCONFIG_TLSV11 \
+	-DCONFIG_CRYPTO_INTERNAL
+.else
+CFLAGS+=-DCONFIG_TLSV11 \
 	-DCONFIG_TLSV12
+.endif
+.endif
 
 # We are only interested in includes at this point. Not libraries.
 LIBADD=
diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile
index e71b491ebe8b..bd31338243ff 100644
--- a/usr.sbin/wpa/wpa_supplicant/Makefile
+++ b/usr.sbin/wpa/wpa_supplicant/Makefile
@@ -26,7 +26,6 @@ SRCS=	bss.c \
 	notify.c \
 	op_classes.c \
 	offchannel.c \
-	pasn_supplicant.c \
 	robust_av.c \
 	rrm.c \
 	scan.c \
@@ -36,6 +35,10 @@ SRCS=	bss.c \
 	wpa_supplicant.c \
 	wpas_glue.c
 
+.if ${MK_OPENSSL} != "no"
+SRCS+=	pasn_supplicant.c
+.endif
+
 MAN=	wpa_supplicant.8 wpa_supplicant.conf.5
 
 .if ${MK_EXAMPLES} != "no"