Respectively do Nameprep/SASLPrep on domain name and password
This commit is contained in:
parent
12ec7d5f08
commit
0e200d99d7
1 changed files with 42 additions and 0 deletions
|
@ -66,6 +66,48 @@
|
||||||
[old release];
|
[old release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setServer: (OFString*)server_
|
||||||
|
{
|
||||||
|
OFString *old = server;
|
||||||
|
char *srv;
|
||||||
|
|
||||||
|
Stringprep_rc rc;
|
||||||
|
if ((rc = stringprep_profile([server_ cString], &srv, "Nameprep", 0))
|
||||||
|
!= STRINGPREP_OK) {
|
||||||
|
of_log(@"Nameprep failed: %s", stringprep_strerror(rc));
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@try {
|
||||||
|
server = [[OFString alloc] initWithCString: srv];
|
||||||
|
} @finally {
|
||||||
|
free(srv);
|
||||||
|
}
|
||||||
|
|
||||||
|
[old release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setPassword: (OFString*)password_
|
||||||
|
{
|
||||||
|
OFString *old = password;
|
||||||
|
char *pass;
|
||||||
|
|
||||||
|
Stringprep_rc rc;
|
||||||
|
if ((rc = stringprep_profile([password_ cString], &pass, "SASLprep", 0))
|
||||||
|
!= STRINGPREP_OK) {
|
||||||
|
of_log(@"SASLprep failed: %s", stringprep_strerror(rc));
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@try {
|
||||||
|
password = [[OFString alloc] initWithCString: pass];
|
||||||
|
} @finally {
|
||||||
|
free(pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
[old release];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)_startStream
|
- (void)_startStream
|
||||||
{
|
{
|
||||||
[sock writeFormat: @"<?xml version='1.0'?>\n"
|
[sock writeFormat: @"<?xml version='1.0'?>\n"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue