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/utils.c b/utils.c
index 4b27d77..9869453 100644
--- a/utils.c
+++ b/utils.c
@@ -180,6 +180,21 @@
}
+bool is_passpoint_r2_or_newer(enum sigma_program prog)
+{
+ return prog == PROGRAM_HS2_R2 ||
+ prog == PROGRAM_HS2_R3 ||
+ prog == PROGRAM_HS2_R4;
+}
+
+
+bool is_passpoint(enum sigma_program prog)
+{
+ return prog == PROGRAM_HS2 ||
+ is_passpoint_r2_or_newer(prog);
+}
+
+
static int parse_hex(char c)
{
if (c >= '0' && c <= '9')