-
-
Notifications
You must be signed in to change notification settings - Fork 212
/
Copy path0095-Check-if-username-and-password-are-empty-strings.patch
34 lines (30 loc) · 1.56 KB
/
0095-Check-if-username-and-password-are-empty-strings.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 79760a8f3231088cb221edc5ddf703c66bcaecc5 Mon Sep 17 00:00:00 2001
From: giulcioffi <g.cioffi@arduino.cc>
Date: Wed, 14 Jul 2021 12:54:52 +0200
Subject: [PATCH 095/110] Check if username and password are empty strings
---
.../GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp
index 8f04e1274a..4aa7f188ea 100644
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp
@@ -116,7 +116,7 @@ bool GEMALTO_CINTERION_CellularContext::get_context()
nsapi_error_t GEMALTO_CINTERION_CellularContext::do_user_authentication()
{
// if user has defined user name and password we need to call CGAUTH before activating or modifying context
- if (_pwd && _uname) {
+ if ((strcmp(_pwd, "") != 0) && (strcmp(_uname, "") != 0)) {
if (!get_device()->get_property(AT_CellularDevice::PROPERTY_AT_CGAUTH)) {
return NSAPI_ERROR_UNSUPPORTED;
}
@@ -126,6 +126,8 @@ nsapi_error_t GEMALTO_CINTERION_CellularContext::do_user_authentication()
if (_at.get_last_error() != NSAPI_ERROR_OK) {
return NSAPI_ERROR_AUTH_FAILURE;
}
+ } else {
+ tr_info("Empty pwd and username fields: no need for authentication\n");
}
return NSAPI_ERROR_OK;
--
2.34.1