Overview
Comment: | Add support for anonymous authentication |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f09ee1db55d16f888b1ae73f70cf664e |
User & Date: | js on 2018-11-11 12:17:03 |
Other Links: | manifest | tags |
Context
2018-11-11
| ||
15:30 | Do not set presence type to available check-in: f2793cf7cb user: js tags: trunk | |
12:17 | Add support for anonymous authentication check-in: f09ee1db55 user: js tags: trunk | |
2018-11-05
| ||
22:30 | Kill #ifdef HAVE_CONFIG_H check-in: cd21ff1157 user: js tags: trunk | |
Changes
Modified src/Makefile from [aecd29812e] to [6e0c6cc9a7].
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | + - + | include ../extra.mk SHARED_LIB = ${OBJXMPP_SHARED_LIB} STATIC_LIB = ${OBJXMPP_STATIC_LIB} FRAMEWORK = ${OBJXMPP_FRAMEWORK} LIB_MAJOR = 0 LIB_MINOR = 0 SRCS = XMPPANONYMOUSAuth.m \ |
︙ |
Added src/XMPPANONYMOUSAuth.h version [865fdd1521].
Added src/XMPPANONYMOUSAuth.m version [a9888d3e04].
Modified src/XMPPConnection.h from [9de35f3a6c] to [4fbe933481].
︙ | |||
143 144 145 146 147 148 149 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | + - - - - - + + + + + + - - + + - + - - - + - - + - + - + - + - + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + | */ @interface XMPPConnection: OFObject <OFXMLParserDelegate, OFXMLElementBuilderDelegate> { OF_KINDOF(OFTCPSocket *) _socket; OFXMLParser *_parser, *_oldParser; OFXMLElementBuilder *_elementBuilder, *_oldElementBuilder; OFString *_Nullable _username, *_Nullable _password, *_Nullable _server; |
︙ |
Modified src/XMPPConnection.m from [c3592e505e] to [7227381b06].
︙ | |||
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]; |
︙ |