ObjXMPP  Check-in [8242aaa109]

Overview
Comment:Adjust to recent ObjFW changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8242aaa1091bcc788c6a29ea5f712054d3ca9da69a399a0e5030a5c25508802d
User & Date: js on 2011-08-04 16:59:01
Other Links: manifest | tags
Context
2011-09-09
01:42
Optimize HMAC implementation check-in: bfe0678566 user: florob@babelmonkeys.de tags: trunk
2011-08-04
16:59
Adjust to recent ObjFW changes. check-in: 8242aaa109 user: js tags: trunk
2011-06-16
19:00
Handle any failure to get SRV records like there are none. check-in: f0f53f4aa7 user: js tags: trunk
Changes

Modified src/XMPPJID.m from [5da0eb2fdc] to [a2663297e0].

54
55
56
57
58
59
60
61

62
63
64
65
66
67
68
69


70
71
72


73
74
75
76
77
78
79
54
55
56
57
58
59
60

61

62
63
64
65
66


67
68
69


70
71
72
73
74
75
76
77
78







-
+
-





-
-
+
+

-
-
+
+








	nodesep = [str indexOfFirstOccurrenceOfString: @"@"];
	resourcesep = [str indexOfFirstOccurrenceOfString: @"/"];

	if (nodesep == SIZE_MAX)
		[self setNode: nil];
	else
		[self setNode: [str substringFromIndex: 0
		[self setNode: [str substringWithRange: of_range(0, nodesep)]];
					       toIndex: nodesep]];

	if (resourcesep == SIZE_MAX) {
		[self setResource: nil];
		resourcesep = [str length];
	} else
		[self setResource: [str substringFromIndex: resourcesep + 1
						 toIndex: [str length]]];
		[self setResource: [str substringWithRange:
		    of_range(resourcesep + 1, [str length] - resourcesep - 1)]];

	[self setDomain: [str substringFromIndex: nodesep + 1
					 toIndex: resourcesep]];
	[self setDomain: [str substringWithRange:
	    of_range(nodesep + 1, resourcesep - nodesep - 1)]];

	return self;
}

- (void)dealloc
{
	[node release];

Modified src/XMPPSCRAMAuth.m from [11a4e71066] to [3fc8922722].

180
181
182
183
184
185
186
187
188


189
190
191
192
193
194
195
180
181
182
183
184
185
186


187
188
189
190
191
192
193
194
195







-
-
+
+







	OFString *chal = [OFString stringWithCString: [challenge cArray]
					      length: [challenge count] *
						      [challenge itemSize]];

	enumerator =
	    [[chal componentsSeparatedByString: @","] objectEnumerator];
	while ((comp = [enumerator nextObject]) != nil) {
		OFString *entry = [comp substringFromIndex: 2
						   toIndex: [comp length]];
		OFString *entry = [comp substringWithRange:
		    of_range(2, [comp length] - 2)];

		if ([comp hasPrefix: @"r="]) {
			if (![entry hasPrefix: cNonce])
				@throw [XMPPAuthFailedException
				    newWithClass: isa
				      connection: nil
					  reason: @"Received wrong nonce"];
329
330
331
332
333
334
335
336
337


338
339
340
341
342
343
344
329
330
331
332
333
334
335


336
337
338
339
340
341
342
343
344







-
-
+
+








- (void)parseServerFinalMessage: (OFDataArray*)message
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFString *mess = [OFString stringWithCString: [message cArray]
					      length: [message count] *
						      [message itemSize]];
	OFString *value = [mess substringFromIndex: 2
					   toIndex: [mess length]];
	OFString *value = [mess substringWithRange:
	    of_range(2, [mess length] - 2)];

	if ([mess hasPrefix: @"v="]) {
		if (![value isEqual: [serverSignature stringByBase64Encoding]])
			@throw [XMPPAuthFailedException
			    newWithClass: isa
			      connection: nil
				  reason: @"Received wrong ServerSignature"];