Use helper functions for checking Passpoint release
Avoid copying checks against PROGRAM_HS2* values by using helper
functions for this.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
diff --git a/server.c b/server.c
index be8d4e1..0d2da05 100644
--- a/server.c
+++ b/server.c
@@ -325,8 +325,7 @@
}
prog = sigma_program_to_enum(var);
- if (prog != PROGRAM_HS2_R2 && prog != PROGRAM_HS2_R3 &&
- prog != PROGRAM_HS2_R4) {
+ if (!is_passpoint_r2_or_newer(prog)) {
send_resp(dut, conn, SIGMA_ERROR,
"errorCode,Unsupported program");
return STATUS_SENT;
@@ -885,8 +884,7 @@
}
prog = sigma_program_to_enum(var);
- if (prog != PROGRAM_HS2_R2 && prog != PROGRAM_HS2_R3 &&
- prog != PROGRAM_HS2_R4) {
+ if (!is_passpoint_r2_or_newer(prog)) {
send_resp(dut, conn, SIGMA_ERROR,
"errorCode,Unsupported program");
return STATUS_SENT;
@@ -1014,8 +1012,7 @@
}
prog = sigma_program_to_enum(var);
- if (prog != PROGRAM_HS2_R2 && prog != PROGRAM_HS2_R3 &&
- prog != PROGRAM_HS2_R4) {
+ if (!is_passpoint_r2_or_newer(prog)) {
send_resp(dut, conn, SIGMA_ERROR,
"errorCode,Unsupported program");
return STATUS_SENT;