617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
|
if ([[element name] isEqual: @"challenge"]) {
OFXMLElement *responseTag;
OFDataArray *challenge = [OFDataArray
dataArrayWithBase64EncodedString: [element stringValue]];
OFDataArray *response = [authModule
continueWithData: challenge];
responseTag = [OFXMLElement elementWithName: @"response"
namespace: XMPP_NS_SASL];
if (response) {
if ([response count] == 0)
[responseTag addChild: [OFXMLElement
elementWithCharacters: @"="]];
else
[responseTag addChild: [OFXMLElement
elementWithCharacters: [response
stringByBase64Encoding]]];
}
[self sendStanza: responseTag];
return;
}
if ([[element name] isEqual: @"success"]) {
|
|
|
|
<
|
<
|
|
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
|
if ([[element name] isEqual: @"challenge"]) {
OFXMLElement *responseTag;
OFDataArray *challenge = [OFDataArray
dataArrayWithBase64EncodedString: [element stringValue]];
OFDataArray *response = [authModule
continueWithData: challenge];
responseTag = [OFXMLElement elementWithName: @"response"
namespace: XMPP_NS_SASL];
if (response) {
if ([response count] == 0)
[responseTag setStringValue: @"="];
else
[responseTag setStringValue:
[response stringByBase64Encoding]];
}
[self sendStanza: responseTag];
return;
}
if ([[element name] isEqual: @"success"]) {
|
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
|
authTag = [OFXMLElement elementWithName: @"auth"
namespace: XMPP_NS_SASL];
[authTag addAttributeWithName: @"mechanism"
stringValue: authName];
if (initialMessage) {
if ([initialMessage count] == 0)
[authTag addChild: [OFXMLElement
elementWithCharacters: @"="]];
else
[authTag addChild: [OFXMLElement elementWithCharacters:
[initialMessage stringByBase64Encoding]]];
}
[self sendStanza: authTag];
}
- (void)XMPP_sendResourceBind
{
|
|
<
|
|
|
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
|
authTag = [OFXMLElement elementWithName: @"auth"
namespace: XMPP_NS_SASL];
[authTag addAttributeWithName: @"mechanism"
stringValue: authName];
if (initialMessage) {
if ([initialMessage count] == 0)
[authTag setStringValue: @"="];
else
[authTag setStringValue:
[initialMessage stringByBase64Encoding]];
}
[self sendStanza: authTag];
}
- (void)XMPP_sendResourceBind
{
|