ObjXMPP  Diff

Differences From Artifact [c67e112e64]:

To Artifact [de7aa34d22]:


24
25
26
27
28
29
30
31

32
33
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
62
63
64
65

66
67
68



69
70
71
72
73
74
75
24
25
26
27
28
29
30

31
32
33
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
62
63
64
65
66
67
68
69

70



71
72
73
74
75
76
77
78
79
80







-
+







-
-
+
+





+



+


+



+


+









-
+
-
-
-
+
+
+







#import "XMPPExceptions.h"

@implementation XMPPPLAINAuth
+ PLAINAuthWithAuthcid: (OFString*)authcid
	      password: (OFString*)password
{
	return [[[self alloc] initWithAuthcid: authcid
				    password: password] autorelease];
				     password: password] autorelease];
}

+ PLAINAuthWithAuthzid: (OFString*)authzid
	       authcid: (OFString*)authcid
	      password: (OFString*)password
{
	return [[[self alloc] initWithAuthzid: authzid
				     authcid: authcid
				    password: password] autorelease];
				      authcid: authcid
				     password: password] autorelease];
}

- (OFDataArray*)clientFirstMessage
{
	OFDataArray *message = [OFDataArray dataArrayWithItemSize: 1];

	/* authzid */
	if (authzid)
		[message addItem: authzid];

	/* separator */
	[message addItem: ""];

	/* authcid */
	[message addNItems: [authcid cStringLength]
		fromCArray: [authcid cString]];

	/* separator */
	[message addItem: ""];

	/* passwd */
	[message addNItems: [password cStringLength]
		fromCArray: [password cString]];

	return message;
}

- (OFDataArray*)calculateResponseWithChallenge: (OFDataArray*)challenge
{
	@throw [XMPPAuthFailedException
	@throw [XMPPAuthFailedException newWithClass: isa
	    newWithClass: isa
	      connection: nil
		  reason: @"Received a challenge during PLAIN auth"];
					  connection: nil
					      reason: @"Received a challenge "
						      @"during PLAIN auth"];
}

- (void)parseServerFinalMessage: (OFDataArray*)message
{
	return;
}
@end