feat(core): Added AES-128-CBC password scheme for SQL authentication.

This allows SOGo to use Plesk's database as an authentication source.
This commit is contained in:
Ludovic Marcotte
2020-01-06 15:47:47 -05:00
parent 4216f9e726
commit f0980a9cbd
12 changed files with 853 additions and 31 deletions
+7 -4
View File
@@ -1,7 +1,7 @@
/* NSData+Crypto.h - this file is part of SOGo
*
* Copyright (C) 2012 Nicolas Höft
* Copyright (C) 2012-2016 Inverse inc.
* Copyright (C) 2012-2020 Inverse inc.
*
* Author: Nicolas Höft
* Inverse inc.
@@ -32,7 +32,8 @@
@interface NSData (SOGoCryptoExtension)
- (NSData *) asCryptedPassUsingScheme: (NSString *) passwordScheme
withSalt: (NSData *) theSalt;
withSalt: (NSData *) theSalt
keyPath: (NSString *) theKeyPath;
- (NSData *) asLM;
- (NSData *) asMD4;
@@ -46,6 +47,8 @@
- (NSData *) asSSHA512UsingSalt: (NSData *) theSalt;
- (NSData *) asSHA256CryptUsingSalt: (NSData *) theSalt;
- (NSData *) asSHA512CryptUsingSalt: (NSData *) theSalt;
- (NSData *) asSymAES128CBCUsingIV: (NSString *) theIV
keyPath: (NSString *) theKeyPath;
- (NSData *) asCramMD5;
- (NSData *) asCryptUsingSalt: (NSData *) theSalt;
@@ -57,8 +60,8 @@
withBase64: (BOOL) doBase64;
+ (NSData *) generateSaltForLength: (unsigned int) theLength;
+ (NSString *) encodeDataAsHexString: (NSData* ) theData;
+ (NSData *) decodeDataFromHexString: (NSString* ) theString;
+ (NSString *) encodeDataAsHexString: (NSData *) theData;
+ (NSData *) decodeDataFromHexString: (NSString *) theString;
@end