Differences From Artifact [abf53f803c]:
- File
src/XMPPConnection.m
— part of check-in
[0aab2fde67]
at
2011-09-18 19:33:19
on branch trunk
— Fix XMPPAuthenticator to support non-optimized message flow
While RFC6120 allows and encourages sending data with the success
message it is also legal to send the same data as a challenge and
await an empty response. This rework honors that fact. (user: florob@babelmonkeys.de, size: 23068) [annotate] [blame] [check-ins using]
To Artifact [2cc82e5d61]:
- File src/XMPPConnection.m — part of check-in [a6c65a6aa2] at 2011-09-22 23:38:03 on branch trunk — Adjust to recent ObjFW changes. (user: js, size: 23066) [annotate] [blame] [check-ins using]
︙ | |||
94 95 96 97 98 99 100 | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - - - - + + + + + | { OFString *old = username; char *node; Stringprep_rc rc; if ((rc = stringprep_profile([username_ UTF8String], &node, "SASLprep", 0)) != STRINGPREP_OK) |
︙ | |||
122 123 124 125 126 127 128 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | - - - - + + + + | OFString *old = resource; char *res; Stringprep_rc rc; if ((rc = stringprep_profile([resource_ UTF8String], &res, "Resourceprep", 0)) != STRINGPREP_OK) @throw [XMPPStringPrepFailedException |
︙ | |||
150 151 152 153 154 155 156 | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | - - - - + + + + | OFString *old = server; char *srv; Idna_rc rc; if ((rc = idna_to_ascii_8z([server_ UTF8String], &srv, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS) @throw [XMPPIDNATranslationFailedException |
︙ | |||
177 178 179 180 181 182 183 | 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | - - - - + + + + + | { OFString *old = domain; char *srv; Stringprep_rc rc; if ((rc = stringprep_profile([domain_ UTF8String], &srv, "Nameprep", 0)) != STRINGPREP_OK) |
︙ | |||
204 205 206 207 208 209 210 | 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - - - - + + + + + | { OFString *old = password; char *pass; Stringprep_rc rc; if ((rc = stringprep_profile([password_ UTF8String], &pass, "SASLprep", 0)) != STRINGPREP_OK) |
︙ | |||
240 241 242 243 244 245 246 | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | - - - - + + + + - - - | if (server) [sock connectToHost: server port: port]; else { if ((rc = idna_to_ascii_8z([domain UTF8String], &cDomainToASCII, IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS) @throw [XMPPIDNATranslationFailedException |
︙ | |||
565 566 567 568 569 570 571 | 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | - - - - + + + + | else condition = @"undefined"; reason = [[element elementForName: @"text" namespace: XMPP_NS_XMPP_STREAM] stringValue]; |
︙ | |||
603 604 605 606 607 608 609 | 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | - + | [self XMPP_startStream]; return; } if ([[element name] isEqual: @"failure"]) /* TODO: Find/create an exception to throw here */ |
︙ | |||
651 652 653 654 655 656 657 | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 | - - - + + + | return; } if ([[element name] isEqual: @"failure"]) { of_log(@"Auth failed!"); // FIXME: Do more parsing/handling @throw [XMPPAuthFailedException |
︙ | |||
726 727 728 729 730 731 732 | 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | - + | [OFXMLElement elementWithName: @"starttls" namespace: XMPP_NS_STARTTLS]]; return; } if (encryptionRequired && !encrypted) /* TODO: Find/create an exception to throw here */ |
︙ |