diff --git a/src/cntlr_tlv.c b/src/cntlr_tlv.c
index 2e8565e53c0c68b6d113592fc66cc3fefd149a6b..974a47d9330941ac6e876eabe7efc67d7a0a942f 100644
--- a/src/cntlr_tlv.c
+++ b/src/cntlr_tlv.c
@@ -57,31 +57,31 @@ uint16_t wifi_sec_to_auth_types(enum wifi_security sec)
 {
 	uint16_t auth_type = 0;
 
-	if (sec >= WIFI_SECURITY_WPA) {
-		if (sec == WIFI_SECURITY_WPA2) {
+	if (sec >= BIT(WIFI_SECURITY_WPA)) {
+		if (sec == BIT(WIFI_SECURITY_WPA2)) {
 			auth_type = WPS_AUTH_WPA;
-		} else if (sec == WIFI_SECURITY_WPA) {
+		} else if (sec == BIT(WIFI_SECURITY_WPA)) {
 			auth_type = WPS_AUTH_WPA;
-		} else if ((sec & WIFI_SECURITY_WPA) && (sec & WIFI_SECURITY_WPA2)) {
+		} else if ((sec & BIT(WIFI_SECURITY_WPA)) && (sec & BIT(WIFI_SECURITY_WPA2))) {
 			auth_type |= WPS_AUTH_WPA;
 			auth_type |= WPS_AUTH_WPA2;
 		}
-	} else if (sec >= WIFI_SECURITY_WPAPSK) {
-		if (sec == WIFI_SECURITY_WPA3PSK) {
+	} else if (sec >= BIT(WIFI_SECURITY_WPAPSK)) {
+		if (sec == BIT(WIFI_SECURITY_WPA3PSK)) {
 			auth_type = WPS_AUTH_SAE;
-		} else if (sec == WIFI_SECURITY_WPA3PSK_T) {
+		} else if (sec == BIT(WIFI_SECURITY_WPA3PSK_T)) {
 			auth_type = WPS_AUTH_WPA3_T;
-		} else if ((sec & WIFI_SECURITY_WPA3PSK) && (sec & WIFI_SECURITY_WPA3PSK_T)) {
+		} else if ((sec & BIT(WIFI_SECURITY_WPA3PSK)) && (sec & BIT(WIFI_SECURITY_WPA3PSK_T))) {
 			auth_type = WPS_AUTH_WPA3_T;
-		} else if (sec == WIFI_SECURITY_WPA2PSK) {
+		} else if (sec == BIT(WIFI_SECURITY_WPA2PSK)) {
 			auth_type = WPS_AUTH_WPA2PSK;
-		} else if (sec == WIFI_SECURITY_WPAPSK) {
+		} else if (sec == BIT(WIFI_SECURITY_WPAPSK)) {
 			auth_type = WPS_AUTH_WPAPSK;
-		} else if ((sec & WIFI_SECURITY_WPAPSK) && (sec & WIFI_SECURITY_WPA2PSK)) {
+		} else if ((sec & BIT(WIFI_SECURITY_WPAPSK)) && (sec & BIT(WIFI_SECURITY_WPA2PSK))) {
 			auth_type |= WPS_AUTH_WPAPSK;
 			auth_type |= WPS_AUTH_WPA2PSK;
 		}
-	} else if (sec == WIFI_SECURITY_NONE)
+	} else if (sec == BIT(WIFI_SECURITY_NONE))
 		auth_type = WPS_AUTH_OPEN;
 	//TODO: ciphers (if any)
 
diff --git a/src/config.c b/src/config.c
index e218a3cc5f3de16889d7b0d884ff21db22a405bf..cd7585400230cc1e9b8a5c0daa1699c65c697e38 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1033,28 +1033,28 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 		const char *sec = tb[CRED_SEC]->v.string;
 
 		if (!strncmp(sec, "sae-mixed", 9)) {
-			cred->sec |= WIFI_SECURITY_WPA3PSK;
-			cred->sec |= WIFI_SECURITY_WPA3PSK_T;
+			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK);
+			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK_T);
 		} else if (!strncmp(sec, "sae", 3)) {
-			cred->sec |= WIFI_SECURITY_WPA3PSK;
+			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK);
 		} else if (!strncmp(sec, "psk-mixed", 9)) {
-			cred->sec |= WIFI_SECURITY_WPAPSK;
-			cred->sec |= WIFI_SECURITY_WPA2PSK;
+			cred->sec |= BIT(WIFI_SECURITY_WPAPSK);
+			cred->sec |= BIT(WIFI_SECURITY_WPA2PSK);
 		} else if (!strncmp(sec, "psk2", 4)) {
-			cred->sec |= WIFI_SECURITY_WPA2PSK;
+			cred->sec |= BIT(WIFI_SECURITY_WPA2PSK);
 		} else if (!strncmp(sec, "psk", 3)) {
-			cred->sec |= WIFI_SECURITY_WPAPSK;
+			cred->sec |= BIT(WIFI_SECURITY_WPAPSK);
 		} else if (!strncmp(sec, "wpa-mixed", 9)) {
-			cred->sec |= WIFI_SECURITY_WPA;
-			cred->sec |= WIFI_SECURITY_WPA2;
+			cred->sec |= BIT(WIFI_SECURITY_WPA);
+			cred->sec |= BIT(WIFI_SECURITY_WPA2);
 		} else if (!strncmp(sec, "wpa2", 4)) {
-			cred->sec |= WIFI_SECURITY_WPA2;
+			cred->sec |= BIT(WIFI_SECURITY_WPA2);
 		} else if (!strncmp(sec, "wpa", 3)) {
-			cred->sec |= WIFI_SECURITY_WPA;
+			cred->sec |= BIT(WIFI_SECURITY_WPA);
 		} else if (!strncmp(sec, "none", 4)) {
-			cred->sec |= WIFI_SECURITY_NONE;
+			cred->sec |= BIT(WIFI_SECURITY_NONE);
 		} else if (!strncmp(sec, "open", 4)) {
-			cred->sec |= WIFI_SECURITY_NONE;
+			cred->sec |= BIT(WIFI_SECURITY_NONE);
 		} else {
 			free(cred);
 			return -1;
@@ -1093,9 +1093,9 @@ static int cntlr_config_get_credentials(struct controller_config *c,
 	}
 
 	if (use_default_security) {
-		cred->sec |= WIFI_SECURITY_WPA3PSK;
+		cred->sec |= BIT(WIFI_SECURITY_WPA3PSK);
 		if (!!(cred->multi_ap & 2))
-			cred->sec |= WIFI_SECURITY_WPA3PSK_T;
+			cred->sec |= BIT(WIFI_SECURITY_WPA3PSK_T);
 	}
 
 	if (tb[CRED_D_BSTA]) {