From ab4c767099f263a7cd4109bcdca80ee74210a769 Mon Sep 17 00:00:00 2001
From: Matthew Newton <matthew-git@newtoncomputing.co.uk>
Date: Wed, 10 Apr 2019 10:11:23 +0100
Subject: [PATCH] fix incorrectly named variable

Patch from:
https://github.com/FreeRADIUS/freeradius-server/commit/ab4c767099f263a7cd4109bcdca80ee74210a769

Integrated-by: Chen Liu <chen.liu@windriver.com>
---
 src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c b/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
index 848ca20..c54f08c 100644
--- a/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
+++ b/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
@@ -387,7 +387,7 @@ int process_peer_commit (pwd_session_t *session, uint8_t *in, size_t in_len, BN_
 	}
 
 	/* validate received element */
-	if (!EC_POINT_is_on_curve(session->group, session->peer_element, bn_ctx) ||
+	if (!EC_POINT_is_on_curve(session->group, session->peer_element, bnctx) ||
 	    EC_POINT_is_at_infinity(session->group, session->peer_element)) {
 		ERROR("Peer's element is not a point on the elliptic curve");
 		goto finish;
@@ -408,7 +408,7 @@ int process_peer_commit (pwd_session_t *session, uint8_t *in, size_t in_len, BN_
 
 	/* detect reflection attacks */
 	if (BN_cmp(session->peer_scalar, session->my_scalar) == 0 ||
-	    EC_POINT_cmp(session->group, session->peer_element, session->my_element, bn_ctx) == 0) {
+	    EC_POINT_cmp(session->group, session->peer_element, session->my_element, bnctx) == 0) {
 		ERROR("Reflection attack detected");
 		goto finish;
 	}
-- 
1.8.3.1

