ObjXMPP  Check-in [a59df3b671]

Overview
Comment:Escape SCRAM usernames (authzid and authcid)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a59df3b671fe01575ac3a0159aa6ee2062614d977b338c9881833552b705cf9d
User & Date: florob@babelmonkeys.de on 2011-02-24 18:51:53
Other Links: manifest | tags
Context
2011-02-24
21:44
Rename XMPPAuthenticator functions check-in: 6b83d2b4d4 user: florob@babelmonkeys.de tags: trunk
18:51
Escape SCRAM usernames (authzid and authcid) check-in: a59df3b671 user: florob@babelmonkeys.de tags: trunk
2011-02-21
03:09
Add SCRAM-SHA-1 support check-in: 6a3b0a9988 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPSCRAMAuth.m from [662da97f8a] to [709f3138f4].

83
84
85
86
87
88
89






































90
91
92
93
94
95
96
	[GS2Header release];
	[clientFirstMessageBare release];
	[serverSignature release];
	[cNonce release];

	[super dealloc];
}







































- (OFString *)_genNonce
{
	OFMutableString *nonce = [OFMutableString string];
	uint32_t res, i;
	for (i = 0; i < 64; i++) {
		while((res = fake_arc4random_uniform(0x5e) + 0x21) == 0x2C);







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
	[GS2Header release];
	[clientFirstMessageBare release];
	[serverSignature release];
	[cNonce release];

	[super dealloc];
}

- (void)setAuthzid: (OFString*)authzid_
{
	OFString *old = authzid;

	if (authzid_) {
		OFMutableString *new = [[OFMutableString alloc]
		    initWithString: authzid_];
		[new replaceOccurrencesOfString: @"="
				     withString: @"=3D"];
		[new replaceOccurrencesOfString: @","
				     withString: @"=2C"];
		authzid = [new copy];
		[new release];
	} else
		authzid = nil;

	[old release];
}

- (void)setAuthcid: (OFString*)authcid_
{
	OFString *old = authcid;

	if (authcid_) {
		OFMutableString *new = [[OFMutableString alloc]
		    initWithString: authcid_];
		[new replaceOccurrencesOfString: @"="
				     withString: @"=3D"];
		[new replaceOccurrencesOfString: @","
				     withString: @"=2C"];
		authcid = [new copy];
		[new release];
	} else
		authcid = nil;

	[old release];
}

- (OFString *)_genNonce
{
	OFMutableString *nonce = [OFMutableString string];
	uint32_t res, i;
	for (i = 0; i < 64; i++) {
		while((res = fake_arc4random_uniform(0x5e) + 0x21) == 0x2C);