git: 26ede19e221a - stable/13 - libradius: fix no SSL build

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 13 Dec 2021 00:28:07 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=26ede19e221a38c1c651298fa4de92209fc1d36f

commit 26ede19e221a38c1c651298fa4de92209fc1d36f
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-06-02 18:31:00 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-12-12 22:17:00 +0000

    libradius: fix no SSL build
    
    int alen is only used with SSL.
    
    (cherry picked from commit 48b11217bf7e605e1c386e316cd6e935aceb4927)
    
    libradius: fix WITHOUT_OPENSSL build
    
    int alen is used only with SSL.
    
    Reported by:    Michael Dexter, Build Option Survey
    MFC after:      3 days
    Fixes:          8d5c7813061d ("libradius: Fix input validation bugs")
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit a901f2af587f9cb068e2fca6b62f324bdde471d8)
---
 lib/libradius/radlib.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c
index 4d21887c4ee2..dd65eda285cb 100644
--- a/lib/libradius/radlib.c
+++ b/lib/libradius/radlib.c
@@ -187,8 +187,10 @@ is_valid_response(struct rad_handle *h, int srv,
 	MD5_CTX ctx;
 	unsigned char md5[MD5_DIGEST_LENGTH];
 	const struct rad_server *srvp;
-	int alen, len;
+
+	int len;
 #ifdef WITH_SSL
+	int alen;
 	HMAC_CTX *hctx;
 	u_char resp[MSGSIZE], md[EVP_MAX_MD_SIZE];
 	u_int md_len;
@@ -284,8 +286,9 @@ is_valid_request(struct rad_handle *h)
 	MD5_CTX ctx;
 	unsigned char md5[MD5_DIGEST_LENGTH];
 	const struct rad_server *srvp;
-	int alen, len;
+	int len;
 #ifdef WITH_SSL
+	int alen;
 	HMAC_CTX *hctx;
 	u_char resp[MSGSIZE], md[EVP_MAX_MD_SIZE];
 	u_int md_len;