@@ -47,7 +47,7 @@ bool checkBasicAuthentication(const char * hash, const char * username, const ch
4747 delete[] toencode;
4848 return false ;
4949 }
50- sprintf (toencode, " %s:%s" , username, password);
50+ sprintf_P (toencode, PSTR ( " %s:%s" ) , username, password);
5151 if (base64_encode_chars (toencode, toencodeLen, encoded) > 0 && memcmp (hash, encoded, encodedLen) == 0 ){
5252 delete[] toencode;
5353 delete[] encoded;
@@ -121,14 +121,14 @@ String generateDigestHash(const char * username, const char * password, const ch
121121}
122122
123123String requestDigestAuthentication (const char * realm){
124- String header = " realm=\" " ;
124+ String header = F ( " realm=\" " ) ;
125125 if (realm == NULL )
126- header.concat (" asyncesp" );
126+ header.concat (F ( " asyncesp" ) );
127127 else
128128 header.concat (realm);
129- header.concat ( " \" , qop=\" auth\" , nonce=\" " );
129+ header.concat (F ( " \" , qop=\" auth\" , nonce=\" " ) );
130130 header.concat (genRandomMD5 ());
131- header.concat (" \" , opaque=\" " );
131+ header.concat (F ( " \" , opaque=\" " ) );
132132 header.concat (genRandomMD5 ());
133133 header.concat (" \" " );
134134 return header;
@@ -174,42 +174,42 @@ bool checkDigestAuthentication(const char * header, const char * method, const c
174174 avLine = avLine.substring (1 , avLine.length () - 1 );
175175 }
176176
177- if (varName.equals (" username" )){
177+ if (varName.equals (F ( " username" ) )){
178178 if (!avLine.equals (username)){
179179 // os_printf("AUTH FAIL: username\n");
180180 return false ;
181181 }
182182 myUsername = avLine;
183- } else if (varName.equals (" realm" )){
183+ } else if (varName.equals (F ( " realm" ) )){
184184 if (realm != NULL && !avLine.equals (realm)){
185185 // os_printf("AUTH FAIL: realm\n");
186186 return false ;
187187 }
188188 myRealm = avLine;
189- } else if (varName.equals (" nonce" )){
189+ } else if (varName.equals (F ( " nonce" ) )){
190190 if (nonce != NULL && !avLine.equals (nonce)){
191191 // os_printf("AUTH FAIL: nonce\n");
192192 return false ;
193193 }
194194 myNonce = avLine;
195- } else if (varName.equals (" opaque" )){
195+ } else if (varName.equals (F ( " opaque" ) )){
196196 if (opaque != NULL && !avLine.equals (opaque)){
197197 // os_printf("AUTH FAIL: opaque\n");
198198 return false ;
199199 }
200- } else if (varName.equals (" uri" )){
200+ } else if (varName.equals (F ( " uri" ) )){
201201 if (uri != NULL && !avLine.equals (uri)){
202202 // os_printf("AUTH FAIL: uri\n");
203203 return false ;
204204 }
205205 myUri = avLine;
206- } else if (varName.equals (" response" )){
206+ } else if (varName.equals (F ( " response" ) )){
207207 myResponse = avLine;
208- } else if (varName.equals (" qop" )){
208+ } else if (varName.equals (F ( " qop" ) )){
209209 myQop = avLine;
210- } else if (varName.equals (" nc" )){
210+ } else if (varName.equals (F ( " nc" ) )){
211211 myNc = avLine;
212- } else if (varName.equals (" cnonce" )){
212+ } else if (varName.equals (F ( " cnonce" ) )){
213213 myCnonce = avLine;
214214 }
215215 } while (nextBreak > 0 );
0 commit comments