@@ -47,7 +47,7 @@ bool checkBasicAuthentication(const char * hash, const char * username, const ch
47
47
delete[] toencode;
48
48
return false ;
49
49
}
50
- sprintf (toencode, " %s:%s" , username, password);
50
+ sprintf_P (toencode, PSTR ( " %s:%s" ) , username, password);
51
51
if (base64_encode_chars (toencode, toencodeLen, encoded) > 0 && memcmp (hash, encoded, encodedLen) == 0 ){
52
52
delete[] toencode;
53
53
delete[] encoded;
@@ -121,14 +121,14 @@ String generateDigestHash(const char * username, const char * password, const ch
121
121
}
122
122
123
123
String requestDigestAuthentication (const char * realm){
124
- String header = " realm=\" " ;
124
+ String header = F ( " realm=\" " ) ;
125
125
if (realm == NULL )
126
- header.concat (" asyncesp" );
126
+ header.concat (F ( " asyncesp" ) );
127
127
else
128
128
header.concat (realm);
129
- header.concat ( " \" , qop=\" auth\" , nonce=\" " );
129
+ header.concat (F ( " \" , qop=\" auth\" , nonce=\" " ) );
130
130
header.concat (genRandomMD5 ());
131
- header.concat (" \" , opaque=\" " );
131
+ header.concat (F ( " \" , opaque=\" " ) );
132
132
header.concat (genRandomMD5 ());
133
133
header.concat (" \" " );
134
134
return header;
@@ -174,42 +174,42 @@ bool checkDigestAuthentication(const char * header, const char * method, const c
174
174
avLine = avLine.substring (1 , avLine.length () - 1 );
175
175
}
176
176
177
- if (varName.equals (" username" )){
177
+ if (varName.equals (F ( " username" ) )){
178
178
if (!avLine.equals (username)){
179
179
// os_printf("AUTH FAIL: username\n");
180
180
return false ;
181
181
}
182
182
myUsername = avLine;
183
- } else if (varName.equals (" realm" )){
183
+ } else if (varName.equals (F ( " realm" ) )){
184
184
if (realm != NULL && !avLine.equals (realm)){
185
185
// os_printf("AUTH FAIL: realm\n");
186
186
return false ;
187
187
}
188
188
myRealm = avLine;
189
- } else if (varName.equals (" nonce" )){
189
+ } else if (varName.equals (F ( " nonce" ) )){
190
190
if (nonce != NULL && !avLine.equals (nonce)){
191
191
// os_printf("AUTH FAIL: nonce\n");
192
192
return false ;
193
193
}
194
194
myNonce = avLine;
195
- } else if (varName.equals (" opaque" )){
195
+ } else if (varName.equals (F ( " opaque" ) )){
196
196
if (opaque != NULL && !avLine.equals (opaque)){
197
197
// os_printf("AUTH FAIL: opaque\n");
198
198
return false ;
199
199
}
200
- } else if (varName.equals (" uri" )){
200
+ } else if (varName.equals (F ( " uri" ) )){
201
201
if (uri != NULL && !avLine.equals (uri)){
202
202
// os_printf("AUTH FAIL: uri\n");
203
203
return false ;
204
204
}
205
205
myUri = avLine;
206
- } else if (varName.equals (" response" )){
206
+ } else if (varName.equals (F ( " response" ) )){
207
207
myResponse = avLine;
208
- } else if (varName.equals (" qop" )){
208
+ } else if (varName.equals (F ( " qop" ) )){
209
209
myQop = avLine;
210
- } else if (varName.equals (" nc" )){
210
+ } else if (varName.equals (F ( " nc" ) )){
211
211
myNc = avLine;
212
- } else if (varName.equals (" cnonce" )){
212
+ } else if (varName.equals (F ( " cnonce" ) )){
213
213
myCnonce = avLine;
214
214
}
215
215
} while (nextBreak > 0 );
0 commit comments