Differences From Artifact [c3592e505e]:
- File
src/XMPPConnection.m
— part of check-in
[cd21ff1157]
at
2018-11-05 22:30:18
on branch trunk
— Kill #ifdef HAVE_CONFIG_H
There no longer is an Xcode project for which it is needed. (user: js, size: 31896) [annotate] [blame] [check-ins using]
To Artifact [7227381b06]:
- File src/XMPPConnection.m — part of check-in [f09ee1db55] at 2018-11-11 12:17:03 on branch trunk — Add support for anonymous authentication (user: js, size: 32452) [annotate] [blame] [check-ins using]
︙ | |||
34 35 36 37 38 39 40 41 42 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | + - - - - - - + + + + + + - - + + + | #import <ObjOpenSSL/SSLSocket.h> #import <ObjOpenSSL/SSLInvalidCertificateException.h> #import <ObjOpenSSL/X509Certificate.h> #import <ObjFW/OFInvalidArgumentException.h> #import "XMPPConnection.h" #import "XMPPANONYMOUSAuth.h" #import "XMPPCallback.h" #import "XMPPEXTERNALAuth.h" |
︙ | |||
95 96 97 98 99 100 101 102 103 104 105 106 107 108 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | + | - (OFString *)xmpp_IDNAToASCII: (OFString *)domain; - (XMPPMulticastDelegate *)xmpp_delegates; @end @implementation XMPPConnection @synthesize username = _username, resource = _resource, server = _server; @synthesize domain = _domain, password = _password, JID = _JID, port = _port; @synthesize usesAnonymousAuthentication = _usesAnonymousAuthentication; @synthesize language = _language, privateKeyFile = _privateKeyFile; @synthesize certificateFile = _certificateFile, socket = _socket; @synthesize encryptionRequired = _encryptionRequired, encrypted = _encrypted; @synthesize supportsRosterVersioning = _supportsRosterVersioning; @synthesize supportsStreamManagement = _supportsStreamManagement; + (instancetype)connection |
︙ | |||
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 | 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 | + + + + + + + + + + + + | if ([element elementForName: @"sm" namespace: XMPP_NS_SM] != nil) _supportsStreamManagement = true; if (mechs != nil) { for (OFXMLElement *mech in [mechs children]) [mechanisms addObject: [mech stringValue]]; if (_usesAnonymousAuthentication) { if (![mechanisms containsObject: @"ANONYMOUS"]) @throw [XMPPAuthFailedException exceptionWithConnection: self reason: @"No supported " @"auth mechanism"]; _authModule = [[XMPPANONYMOUSAuth alloc] init]; [self xmpp_sendAuth: @"ANONYMOUS"]; return; } if (_privateKeyFile != nil && _certificateFile != nil && [mechanisms containsObject: @"EXTERNAL"]) { _authModule = [[XMPPEXTERNALAuth alloc] init]; [self xmpp_sendAuth: @"EXTERNAL"]; return; } |
︙ | |||
1047 1048 1049 1050 1051 1052 1053 | 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 | + + + - + | _authModule = [[XMPPPLAINAuth alloc] initWithAuthcid: _username password: _password]; [self xmpp_sendAuth: @"PLAIN"]; return; } @throw [XMPPAuthFailedException exceptionWithConnection: self reason: @"No supported auth mechanism"]; |
︙ | |||
1071 1072 1073 1074 1075 1076 1077 | 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 | - + | OFXMLElement *authTag; OFData *initialMessage = [_authModule initialMessage]; authTag = [OFXMLElement elementWithName: @"auth" namespace: XMPP_NS_SASL]; [authTag addAttributeWithName: @"mechanism" stringValue: authName]; |
︙ |