mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 06:52:40 +00:00
See ChangeLog
Monotone-Parent: 747fe8c2134a990c1cdf3b494c2b7776021cb736 Monotone-Revision: 3c4baa92c5634d4da061da739a9b544d04c44586 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2012-05-31T13:24:32
This commit is contained in:
1 parent
18ffca1924
commit
08230b33bb
12 files changed
+1092
-118
No files matched your search
@@ -40,6 +40,7 @@
|
||||
#import "LDAPSourceSchema.h"
|
||||
#import "NSArray+Utilities.h"
|
||||
#import "NSString+Utilities.h"
|
||||
#import "NSString+Crypto.h"
|
||||
#import "SOGoDomainDefaults.h"
|
||||
#import "SOGoSystemDefaults.h"
|
||||
|
||||
@@ -581,26 +582,13 @@ andMultipleBookingsField: (NSString *) newMultipleBookingsField
|
||||
*/
|
||||
- (NSString *) _encryptPassword: (NSString *) plainPassword
|
||||
{
|
||||
if ([_userPasswordAlgorithm caseInsensitiveCompare: @"none"] == NSOrderedSame)
|
||||
{
|
||||
return plainPassword;
|
||||
}
|
||||
else if ([_userPasswordAlgorithm caseInsensitiveCompare: @"crypt"] == NSOrderedSame)
|
||||
{
|
||||
return [NSString stringWithFormat: @"{CRYPT}%@", [plainPassword asCryptStringUsingSalt: [plainPassword asMD5String]]];
|
||||
}
|
||||
else if ([_userPasswordAlgorithm caseInsensitiveCompare: @"md5"] == NSOrderedSame)
|
||||
{
|
||||
return [NSString stringWithFormat: @"{MD5}%@", [plainPassword asMD5String]];
|
||||
}
|
||||
else if ([_userPasswordAlgorithm caseInsensitiveCompare: @"sha"] == NSOrderedSame)
|
||||
{
|
||||
return [NSString stringWithFormat: @"{SHA}%@", [plainPassword asSHA1String]];
|
||||
}
|
||||
|
||||
[self errorWithFormat: @"Unsupported user-password algorithm: %@", _userPasswordAlgorithm];
|
||||
|
||||
return plainPassword;
|
||||
NSString *pass;
|
||||
pass = [plainPassword asCryptedPassUsingScheme: _userPasswordAlgorithm];
|
||||
|
||||
if (pass == nil)
|
||||
[self errorWithFormat: @"Unsupported user-password algorithm: %@", _userPasswordAlgorithm];
|
||||
|
||||
return [NSString stringWithFormat: @"{%@}%@", _userPasswordAlgorithm, pass];
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user