wlan: Don't start sap when key length is more than 63 char

According to WPA2, PSK is 32 bytes and 64 Hex characters.
The PSK is 32 bytes (256 bits), often displayed as 64 hex characters.
SAP should not turn on if PSK length is set more than 63 char.

Fix this by not allowing sap start when key length is
more than 63 char.

CRs-Fixed: 1108432
Change-Id: I52d95aa10af87bbe95a2a214e46a45c6909df8f2
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 7233c3a..e4abb85 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -788,7 +788,7 @@
 }
 
 #ifdef SAP_AUTH_OFFLOAD
-void hdd_set_sap_auth_offload(hdd_adapter_t *pHostapdAdapter,
+bool hdd_set_sap_auth_offload(hdd_adapter_t *pHostapdAdapter,
         bool enabled)
 {
     hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pHostapdAdapter);
@@ -812,7 +812,7 @@
             hddLog(VOS_TRACE_LEVEL_ERROR,
                     "%s: invalid key length(%d) of WPA security!", __func__,
                     sap_offload_info.key_len);
-            return;
+            return false;
         }
     }
     if (sap_offload_info.key_len)
@@ -826,12 +826,12 @@
     {
         hddLog(VOS_TRACE_LEVEL_ERROR,
                 "%s: sme_set_sap_auth_offload fail!", __func__);
-        return;
+        return false;
     }
 
     hddLog(VOS_TRACE_LEVEL_INFO_HIGH,
             "%s: sme_set_sap_auth_offload successfully!", __func__);
-    return;
+    return true;
 }
 #endif
 
@@ -4910,7 +4910,14 @@
 
 #ifdef SAP_AUTH_OFFLOAD
     if (pHddCtx->cfg_ini->enable_sap_auth_offload)
-        hdd_set_sap_auth_offload(pAdapter, TRUE);
+    {
+        if (!hdd_set_sap_auth_offload(pAdapter, TRUE))
+        {
+            VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+             FL("SAP AUTH OFFLOAD is not enabled successfully, Don't start SAP"));
+            return VOS_STATUS_E_FAILURE;
+        }
+    }
 #endif
 
     // Allocate the Wireless Extensions state structure