diff --git a/MTAes.h b/MTAes.h new file mode 100644 index 0000000000..6663a3493b --- /dev/null +++ b/MTAes.h @@ -0,0 +1,11 @@ +#import + +void MyAesIgeEncrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv); +void MyAesIgeDecrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv); + +@interface MTAesCtr : NSObject + +- (instancetype)initWithKey:(const void *)key keyLength:(int)keyLength iv:(const void *)iv; +- (void)encryptIn:(const unsigned char *)in out:(unsigned char *)out len:(size_t)len; + +@end diff --git a/MTAes.m b/MTAes.m new file mode 100644 index 0000000000..53a08cd8e1 --- /dev/null +++ b/MTAes.m @@ -0,0 +1,288 @@ +#import "MTAes.h" + +#import + +# define AES_MAXNR 14 +# define AES_BLOCK_SIZE 16 + +#define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long)) +typedef struct { + unsigned long data[N_WORDS]; +} aes_block_t; + +/* XXX: probably some better way to do this */ +#if defined(__i386__) || defined(__x86_64__) +# define UNALIGNED_MEMOPS_ARE_FAST 1 +#else +# define UNALIGNED_MEMOPS_ARE_FAST 0 +#endif + +#if UNALIGNED_MEMOPS_ARE_FAST +# define load_block(d, s) (d) = *(const aes_block_t *)(s) +# define store_block(d, s) *(aes_block_t *)(d) = (s) +#else +# define load_block(d, s) memcpy((d).data, (s), AES_BLOCK_SIZE) +# define store_block(d, s) memcpy((d), (s).data, AES_BLOCK_SIZE) +#endif + +void MyAesIgeEncrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv) { + int len; + size_t n; + void const *inB; + void *outB; + + unsigned char aesIv[AES_BLOCK_SIZE]; + memcpy(aesIv, iv, AES_BLOCK_SIZE); + unsigned char ccIv[AES_BLOCK_SIZE]; + memcpy(ccIv, iv + AES_BLOCK_SIZE, AES_BLOCK_SIZE); + + assert(((size_t)inBytes | (size_t)outBytes | (size_t)aesIv | (size_t)ccIv) % sizeof(long) == + 0); + + void *tmpInBytes = malloc(length); + len = length / AES_BLOCK_SIZE; + inB = inBytes; + outB = tmpInBytes; + + aes_block_t *inp = (aes_block_t *)inB; + aes_block_t *outp = (aes_block_t *)outB; + for (n = 0; n < N_WORDS; ++n) { + outp->data[n] = inp->data[n]; + } + + --len; + inB += AES_BLOCK_SIZE; + outB += AES_BLOCK_SIZE; + void const *inBCC = inBytes; + + aes_block_t const *iv3p = (aes_block_t *)ccIv; + + if (len > 0) { + while (len) { + aes_block_t *inp = (aes_block_t *)inB; + aes_block_t *outp = (aes_block_t *)outB; + + for (n = 0; n < N_WORDS; ++n) { + outp->data[n] = inp->data[n] ^ iv3p->data[n]; + } + + iv3p = inBCC; + --len; + inBCC += AES_BLOCK_SIZE; + inB += AES_BLOCK_SIZE; + outB += AES_BLOCK_SIZE; + } + } + + size_t realOutLength = 0; + CCCryptorStatus result = CCCrypt(kCCEncrypt, kCCAlgorithmAES128, 0, key, keyLength, aesIv, tmpInBytes, length, outBytes, length, &realOutLength); + free(tmpInBytes); + + assert(result == kCCSuccess); + + len = length / AES_BLOCK_SIZE; + + aes_block_t const *ivp = inB; + aes_block_t *iv2p = (aes_block_t *)ccIv; + + inB = inBytes; + outB = outBytes; + + while (len) { + aes_block_t *inp = (aes_block_t *)inB; + aes_block_t *outp = (aes_block_t *)outB; + + for (n = 0; n < N_WORDS; ++n) { + outp->data[n] ^= iv2p->data[n]; + } + ivp = outp; + iv2p = inp; + --len; + inB += AES_BLOCK_SIZE; + outB += AES_BLOCK_SIZE; + } + + memcpy(iv, ivp->data, AES_BLOCK_SIZE); + memcpy(iv + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE); +} + +void MyAesIgeDecrypt(const void *inBytes, int length, void *outBytes, const void *key, int keyLength, void *iv) { + unsigned char aesIv[AES_BLOCK_SIZE]; + memcpy(aesIv, iv, AES_BLOCK_SIZE); + unsigned char ccIv[AES_BLOCK_SIZE]; + memcpy(ccIv, iv + AES_BLOCK_SIZE, AES_BLOCK_SIZE); + + assert(((size_t)inBytes | (size_t)outBytes | (size_t)aesIv | (size_t)ccIv) % sizeof(long) == + 0); + + CCCryptorRef decryptor = NULL; + CCCryptorCreate(kCCDecrypt, kCCAlgorithmAES128, kCCOptionECBMode, key, keyLength, nil, &decryptor); + if (decryptor != NULL) { + int len; + size_t n; + + len = length / AES_BLOCK_SIZE; + + aes_block_t *ivp = (aes_block_t *)(aesIv); + aes_block_t *iv2p = (aes_block_t *)(ccIv); + + while (len) { + aes_block_t tmp; + aes_block_t *inp = (aes_block_t *)inBytes; + aes_block_t *outp = (aes_block_t *)outBytes; + + for (n = 0; n < N_WORDS; ++n) + tmp.data[n] = inp->data[n] ^ iv2p->data[n]; + + size_t dataOutMoved = 0; + CCCryptorStatus result = CCCryptorUpdate(decryptor, &tmp, AES_BLOCK_SIZE, outBytes, AES_BLOCK_SIZE, &dataOutMoved); + assert(result == kCCSuccess); + assert(dataOutMoved == AES_BLOCK_SIZE); + + for (n = 0; n < N_WORDS; ++n) + outp->data[n] ^= ivp->data[n]; + + ivp = inp; + iv2p = outp; + + inBytes += AES_BLOCK_SIZE; + outBytes += AES_BLOCK_SIZE; + + --len; + } + + memcpy(iv, ivp->data, AES_BLOCK_SIZE); + memcpy(iv + AES_BLOCK_SIZE, iv2p->data, AES_BLOCK_SIZE); + + CCCryptorRelease(decryptor); + } +} + +static void ctr128_inc(unsigned char *counter) +{ + uint32_t n = 16, c = 1; + + do { + --n; + c += counter[n]; + counter[n] = (uint8_t)c; + c >>= 8; + } while (n); +} + +static void ctr128_inc_aligned(unsigned char *counter) +{ + size_t *data, c, d, n; + const union { + long one; + char little; + } is_endian = { + 1 + }; + + if (is_endian.little || ((size_t)counter % sizeof(size_t)) != 0) { + ctr128_inc(counter); + return; + } + + data = (size_t *)counter; + c = 1; + n = 16 / sizeof(size_t); + do { + --n; + d = data[n] += c; + /* did addition carry? */ + c = ((d - c) ^ d) >> (sizeof(size_t) * 8 - 1); + } while (n); +} + + +@interface MTAesCtr () { + CCCryptorRef _cryptor; + + unsigned char _ivec[16]; + unsigned int _num; + unsigned char _ecount[16]; +} + +@end + +@implementation MTAesCtr + +- (instancetype)initWithKey:(const void *)key keyLength:(int)keyLength iv:(const void *)iv { + self = [super init]; + if (self != nil) { + _num = 0; + memset(_ecount, 0, 16); + memcpy(_ivec, iv, 16); + + CCCryptorCreate(kCCEncrypt, kCCAlgorithmAES128, kCCOptionECBMode, key, keyLength, nil, &_cryptor); + } + return self; +} + +- (void)dealloc { + if (_cryptor) { + CCCryptorRelease(_cryptor); + } +} + +- (void)encryptIn:(const unsigned char *)in out:(unsigned char *)out len:(size_t)len { + unsigned int n; + size_t l = 0; + + assert(in && out); + assert(_num < 16); + + n = _num; + + if (16 % sizeof(size_t) == 0) { /* always true actually */ + do { + while (n && len) { + *(out++) = *(in++) ^ _ecount[n]; + --len; + n = (n + 1) % 16; + } + + while (len >= 16) { + size_t dataOutMoved; + CCCryptorUpdate(_cryptor, _ivec, 16, _ecount, 16, &dataOutMoved); + ctr128_inc_aligned(_ivec); + for (n = 0; n < 16; n += sizeof(size_t)) + *(size_t *)(out + n) = + *(size_t *)(in + n) ^ *(size_t *)(_ecount + n); + len -= 16; + out += 16; + in += 16; + n = 0; + } + if (len) { + size_t dataOutMoved; + CCCryptorUpdate(_cryptor, _ivec, 16, _ecount, 16, &dataOutMoved); + ctr128_inc_aligned(_ivec); + while (len--) { + out[n] = in[n] ^ _ecount[n]; + ++n; + } + } + _num = n; + return; + } while (0); + } + /* the rest would be commonly eliminated by x86* compiler */ + + while (l < len) { + if (n == 0) { + size_t dataOutMoved; + CCCryptorUpdate(_cryptor, _ivec, 16, _ecount, 16, &dataOutMoved); + ctr128_inc(_ivec); + } + out[l] = in[l] ^ _ecount[n]; + ++l; + n = (n + 1) % 16; + } + + _num = n; +} + +@end diff --git a/MTAtomic.h b/MTAtomic.h new file mode 100644 index 0000000000..e25689ae0a --- /dev/null +++ b/MTAtomic.h @@ -0,0 +1,11 @@ +#import + +@interface MTAtomic : NSObject + +- (instancetype)initWithValue:(id)value; +- (id)swap:(id)newValue; +- (id)value; +- (id)modify:(id (^)(id))f; +- (id)with:(id (^)(id))f; + +@end diff --git a/MTAtomic.m b/MTAtomic.m new file mode 100644 index 0000000000..58ad159e18 --- /dev/null +++ b/MTAtomic.m @@ -0,0 +1,64 @@ +#import "MTAtomic.h" + +#import + +@interface MTAtomic () +{ + volatile OSSpinLock _lock; + id _value; +} + +@end + +@implementation MTAtomic + +- (instancetype)initWithValue:(id)value +{ + self = [super init]; + if (self != nil) + { + _value = value; + } + return self; +} + +- (id)swap:(id)newValue +{ + id previousValue = nil; + OSSpinLockLock(&_lock); + previousValue = _value; + _value = newValue; + OSSpinLockUnlock(&_lock); + return previousValue; +} + +- (id)value +{ + id previousValue = nil; + OSSpinLockLock(&_lock); + previousValue = _value; + OSSpinLockUnlock(&_lock); + + return previousValue; +} + +- (id)modify:(id (^)(id))f +{ + id newValue = nil; + OSSpinLockLock(&_lock); + newValue = f(_value); + _value = newValue; + OSSpinLockUnlock(&_lock); + return newValue; +} + +- (id)with:(id (^)(id))f +{ + id result = nil; + OSSpinLockLock(&_lock); + result = f(_value); + OSSpinLockUnlock(&_lock); + return result; +} + +@end diff --git a/MTDiscoverConnectionSignals.h b/MTDiscoverConnectionSignals.h index 01a02ed7bd..62c4d62227 100644 --- a/MTDiscoverConnectionSignals.h +++ b/MTDiscoverConnectionSignals.h @@ -1,10 +1,10 @@ #import -#import -#import +#import "MTSignal.h" +#import "MTContext.h" @interface MTDiscoverConnectionSignals : NSObject -+ (SSignal *)discoverSchemeWithContext:(MTContext *)context addressList:(NSArray *)addressList media:(bool)media; ++ (MTSignal *)discoverSchemeWithContext:(MTContext *)context addressList:(NSArray *)addressList media:(bool)media; @end diff --git a/MTDiscoverConnectionSignals.m b/MTDiscoverConnectionSignals.m index a5500e7b22..e1b5e16c29 100644 --- a/MTDiscoverConnectionSignals.m +++ b/MTDiscoverConnectionSignals.m @@ -5,6 +5,9 @@ #import "MTTransportScheme.h" #import "MTTcpTransport.h" #import "MTHttpTransport.h" +#import "MTLogging.h" +#import "MTQueue.h" +#import "MTDatacenterAddress.h" #import #import @@ -63,9 +66,9 @@ typedef struct { return success == 1; } -+ (SSignal *)tcpConnectionWithContext:(MTContext *)context datacenterId:(NSUInteger)datacenterId address:(MTDatacenterAddress *)address; ++ (MTSignal *)tcpConnectionWithContext:(MTContext *)context datacenterId:(NSUInteger)datacenterId address:(MTDatacenterAddress *)address; { - return [[SSignal alloc] initWithGenerator:^id(SSubscriber *subscriber) + return [[MTSignal alloc] initWithGenerator:^id(MTSubscriber *subscriber) { MTPayloadData payloadData; NSData *data = [self payloadData:&payloadData]; @@ -111,16 +114,16 @@ typedef struct { } [connection start]; - return [[SBlockDisposable alloc] initWithBlock:^ + return [[MTBlockDisposable alloc] initWithBlock:^ { [connection stop]; }]; }]; } -+ (SSignal *)httpConnectionWithAddress:(MTDatacenterAddress *)address ++ (MTSignal *)httpConnectionWithAddress:(MTDatacenterAddress *)address { - return [[SSignal alloc] initWithGenerator:^id(SSubscriber *subscriber) + return [[MTSignal alloc] initWithGenerator:^id(MTSubscriber *subscriber) { MTPayloadData payloadData; NSData *data = [self payloadData:&payloadData]; @@ -144,7 +147,7 @@ typedef struct { } MTHttpWorker *httpWorker = [[MTHttpWorker alloc] initWithDelegate:delegate address:address payloadData:data performsLongPolling:false]; - return [[SBlockDisposable alloc] initWithBlock:^ + return [[MTBlockDisposable alloc] initWithBlock:^ { [delegate description]; // keep reference [httpWorker stop]; @@ -152,7 +155,7 @@ typedef struct { }]; } -+ (SSignal *)discoverSchemeWithContext:(MTContext *)context addressList:(NSArray *)addressList media:(bool)media ++ (MTSignal *)discoverSchemeWithContext:(MTContext *)context addressList:(NSArray *)addressList media:(bool)media { NSMutableArray *bestAddressList = [[NSMutableArray alloc] init]; @@ -176,52 +179,52 @@ typedef struct { if ([self isIpv6:address.ip]) { - SSignal *signal = [[[[self tcpConnectionWithContext:context datacenterId:0 address:address] then:[SSignal single:tcpTransportScheme]] timeout:5.0 onQueue:[SQueue concurrentDefaultQueue] orSignal:[SSignal fail:nil]] catch:^SSignal *(__unused id error) + MTSignal *signal = [[[[self tcpConnectionWithContext:context datacenterId:0 address:address] then:[MTSignal single:tcpTransportScheme]] timeout:5.0 onQueue:[MTQueue concurrentDefaultQueue] orSignal:[MTSignal fail:nil]] catch:^MTSignal *(__unused id error) { - return [SSignal complete]; + return [MTSignal complete]; }]; [bestTcp6Signals addObject:signal]; } else { - SSignal *tcpConnectionWithTimeout = [[[self tcpConnectionWithContext:context datacenterId:0 address:address] then:[SSignal single:tcpTransportScheme]] timeout:5.0 onQueue:[SQueue concurrentDefaultQueue] orSignal:[SSignal fail:nil]]; - SSignal *signal = [tcpConnectionWithTimeout catch:^SSignal *(__unused id error) + MTSignal *tcpConnectionWithTimeout = [[[self tcpConnectionWithContext:context datacenterId:0 address:address] then:[MTSignal single:tcpTransportScheme]] timeout:5.0 onQueue:[MTQueue concurrentDefaultQueue] orSignal:[MTSignal fail:nil]]; + MTSignal *signal = [tcpConnectionWithTimeout catch:^MTSignal *(__unused id error) { - return [SSignal complete]; + return [MTSignal complete]; }]; [bestTcp4Signals addObject:signal]; } if (!address.restrictToTcp) { - SSignal *signal = [[[[self httpConnectionWithAddress:address] then:[SSignal single:httpTransportScheme]] timeout:5.0 onQueue:[SQueue concurrentDefaultQueue] orSignal:[SSignal fail:nil]] catch:^SSignal *(__unused id error) + MTSignal *signal = [[[[self httpConnectionWithAddress:address] then:[MTSignal single:httpTransportScheme]] timeout:5.0 onQueue:[MTQueue concurrentDefaultQueue] orSignal:[MTSignal fail:nil]] catch:^MTSignal *(__unused id error) { - return [SSignal complete]; + return [MTSignal complete]; }]; [bestHttpSignals addObject:signal]; } } - SSignal *repeatDelaySignal = [[SSignal complete] delay:1.0 onQueue:[SQueue concurrentDefaultQueue]]; - SSignal *optimalDelaySignal = [[SSignal complete] delay:30.0 onQueue:[SQueue concurrentDefaultQueue]]; + MTSignal *repeatDelaySignal = [[MTSignal complete] delay:1.0 onQueue:[MTQueue concurrentDefaultQueue]]; + MTSignal *optimalDelaySignal = [[MTSignal complete] delay:30.0 onQueue:[MTQueue concurrentDefaultQueue]]; - SSignal *firstTcp4Match = [[[[SSignal mergeSignals:bestTcp4Signals] then:repeatDelaySignal] restart] take:1]; - SSignal *firstTcp6Match = [[[[SSignal mergeSignals:bestTcp6Signals] then:repeatDelaySignal] restart] take:1]; - SSignal *firstHttpMatch = [[[[SSignal mergeSignals:bestHttpSignals] then:repeatDelaySignal] restart] take:1]; + MTSignal *firstTcp4Match = [[[[MTSignal mergeSignals:bestTcp4Signals] then:repeatDelaySignal] restart] take:1]; + MTSignal *firstTcp6Match = [[[[MTSignal mergeSignals:bestTcp6Signals] then:repeatDelaySignal] restart] take:1]; + MTSignal *firstHttpMatch = [[[[MTSignal mergeSignals:bestHttpSignals] then:repeatDelaySignal] restart] take:1]; - SSignal *optimalTcp4Match = [[[[SSignal mergeSignals:bestTcp4Signals] then:optimalDelaySignal] restart] take:1]; - SSignal *optimalTcp6Match = [[[[SSignal mergeSignals:bestTcp6Signals] then:optimalDelaySignal] restart] take:1]; + MTSignal *optimalTcp4Match = [[[[MTSignal mergeSignals:bestTcp4Signals] then:optimalDelaySignal] restart] take:1]; + MTSignal *optimalTcp6Match = [[[[MTSignal mergeSignals:bestTcp6Signals] then:optimalDelaySignal] restart] take:1]; - SSignal *anySignal = [[SSignal mergeSignals:@[firstTcp4Match, firstTcp6Match, firstHttpMatch]] take:1]; - SSignal *optimalSignal = [[SSignal mergeSignals:@[optimalTcp4Match, optimalTcp6Match]] take:1]; + MTSignal *anySignal = [[MTSignal mergeSignals:@[firstTcp4Match, firstTcp6Match, firstHttpMatch]] take:1]; + MTSignal *optimalSignal = [[MTSignal mergeSignals:@[optimalTcp4Match, optimalTcp6Match]] take:1]; - SSignal *signal = [anySignal mapToSignal:^SSignal *(MTTransportScheme *scheme) + MTSignal *signal = [anySignal mapToSignal:^MTSignal *(MTTransportScheme *scheme) { if (![scheme isOptimal]) { - return [[SSignal single:scheme] then:[optimalSignal delay:5.0 onQueue:[SQueue concurrentDefaultQueue]]]; + return [[MTSignal single:scheme] then:[optimalSignal delay:5.0 onQueue:[MTQueue concurrentDefaultQueue]]]; } else - return [SSignal single:scheme]; + return [MTSignal single:scheme]; }]; return signal; diff --git a/MTDisposable.h b/MTDisposable.h new file mode 100644 index 0000000000..07d9f91940 --- /dev/null +++ b/MTDisposable.h @@ -0,0 +1,26 @@ +#import + +@protocol MTDisposable + +- (void)dispose; + +@end + +@interface MTBlockDisposable : NSObject + +- (instancetype)initWithBlock:(void (^)())block; + +@end + +@interface MTMetaDisposable : NSObject + +- (void)setDisposable:(id)disposable; + +@end + +@interface MTDisposableSet : NSObject + +- (void)add:(id)disposable; +- (void)remove:(id)disposable; + +@end diff --git a/MTDisposable.m b/MTDisposable.m new file mode 100644 index 0000000000..356b419a1e --- /dev/null +++ b/MTDisposable.m @@ -0,0 +1,198 @@ +#import "MTDisposable.h" + +#import +#import + +@interface MTBlockDisposable () +{ + void *_block; +} + +@end + +@implementation MTBlockDisposable + +- (instancetype)initWithBlock:(void (^)())block +{ + self = [super init]; + if (self != nil) + { + _block = (__bridge_retained void *)[block copy]; + } + return self; +} + +- (void)dealloc +{ + void *block = _block; + if (block != NULL) + { + if (OSAtomicCompareAndSwapPtr(block, 0, &_block)) + { + if (block != nil) + { + __strong id strongBlock = (__bridge_transfer id)block; + strongBlock = nil; + } + } + } +} + +- (void)dispose +{ + void *block = _block; + if (block != NULL) + { + if (OSAtomicCompareAndSwapPtr(block, 0, &_block)) + { + if (block != nil) + { + __strong id strongBlock = (__bridge_transfer id)block; + ((dispatch_block_t)strongBlock)(); + strongBlock = nil; + } + } + } +} + +@end + +@interface MTMetaDisposable () +{ + OSSpinLock _lock; + bool _disposed; + id _disposable; +} + +@end + +@implementation MTMetaDisposable + +- (void)setDisposable:(id)disposable +{ + id previousDisposable = nil; + bool dispose = false; + + OSSpinLockLock(&_lock); + dispose = _disposed; + if (!dispose) + { + previousDisposable = _disposable; + _disposable = disposable; + } + OSSpinLockUnlock(&_lock); + + if (previousDisposable != nil) + [previousDisposable dispose]; + + if (dispose) + [disposable dispose]; +} + +- (void)dispose +{ + id disposable = nil; + + OSSpinLockLock(&_lock); + if (!_disposed) + { + disposable = _disposable; + _disposed = true; + } + OSSpinLockUnlock(&_lock); + + if (disposable != nil) + [disposable dispose]; +} + +@end + +@interface MTDisposableSet () +{ + OSSpinLock _lock; + bool _disposed; + id _singleDisposable; + NSArray *_multipleDisposables; +} + +@end + +@implementation MTDisposableSet + +- (void)add:(id)disposable +{ + if (disposable == nil) + return; + + bool dispose = false; + + OSSpinLockLock(&_lock); + dispose = _disposed; + if (!dispose) + { + if (_multipleDisposables != nil) + { + NSMutableArray *multipleDisposables = [[NSMutableArray alloc] initWithArray:_multipleDisposables]; + [multipleDisposables addObject:disposable]; + _multipleDisposables = multipleDisposables; + } + else if (_singleDisposable != nil) + { + NSMutableArray *multipleDisposables = [[NSMutableArray alloc] initWithObjects:_singleDisposable, disposable, nil]; + _multipleDisposables = multipleDisposables; + _singleDisposable = nil; + } + else + { + _singleDisposable = disposable; + } + } + OSSpinLockUnlock(&_lock); + + if (dispose) + [disposable dispose]; +} + +- (void)remove:(id)disposable { + OSSpinLockLock(&_lock); + if (_multipleDisposables != nil) + { + NSMutableArray *multipleDisposables = [[NSMutableArray alloc] initWithArray:_multipleDisposables]; + [multipleDisposables removeObject:disposable]; + _multipleDisposables = multipleDisposables; + } + else if (_singleDisposable == disposable) + { + _singleDisposable = nil; + } + OSSpinLockUnlock(&_lock); +} + +- (void)dispose +{ + id singleDisposable = nil; + NSArray *multipleDisposables = nil; + + OSSpinLockLock(&_lock); + if (!_disposed) + { + _disposed = true; + singleDisposable = _singleDisposable; + multipleDisposables = _multipleDisposables; + _singleDisposable = nil; + _multipleDisposables = nil; + } + OSSpinLockUnlock(&_lock); + + if (singleDisposable != nil) + [singleDisposable dispose]; + if (multipleDisposables != nil) + { + for (id disposable in multipleDisposables) + { + [disposable dispose]; + } + } +} + +@end diff --git a/MTProtoKit/Info.plist b/MTProtoKit/Info.plist index f6228f96e7..d3de8eefb6 100644 --- a/MTProtoKit/Info.plist +++ b/MTProtoKit/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.telegram.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/MTProtoKit/MTApiEnvironment.m b/MTProtoKit/MTApiEnvironment.m index fe2fce6a42..1999e7fbd2 100644 --- a/MTProtoKit/MTApiEnvironment.m +++ b/MTProtoKit/MTApiEnvironment.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTApiEnvironment.h" #if TARGET_OS_IPHONE # import @@ -256,8 +256,7 @@ typedef enum { // Simulator thanks Jordan Breeding if ([platform hasSuffix:@"86"] || [platform isEqual:@"x86_64"]) { - BOOL smallerScreen = [[UIScreen mainScreen] bounds].size.width < 768; - return smallerScreen ? UIDeviceSimulatoriPhone : UIDeviceSimulatoriPad; + return UIDeviceSimulatoriPhone; } #else return UIDeviceOSX; diff --git a/MTProtoKit/MTContext.m b/MTProtoKit/MTContext.m index 294ba52ee8..ef7c602f23 100644 --- a/MTProtoKit/MTContext.m +++ b/MTProtoKit/MTContext.m @@ -6,28 +6,29 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTContext.h" #import -#import -#import -#import -#import +#import "MTLogging.h" +#import "MTTimer.h" +#import "MTQueue.h" +#import "MTKeychain.h" -#import -#import -#import -#import +#import "MTDatacenterAddressSet.h" +#import "MTDatacenterAddress.h" +#import "MTDatacenterAuthInfo.h" +#import "MTDatacenterSaltInfo.h" +#import "MTSessionInfo.h" -#import -#import -#import +#import "MTDiscoverDatacenterAddressAction.h" +#import "MTDatacenterAuthAction.h" +#import "MTDatacenterTransferAuthAction.h" -#import -#import +#import "MTTransportScheme.h" +#import "MTTcpTransport.h" -#import +#import "MTApiEnvironment.h" #import @@ -63,7 +64,6 @@ NSMutableArray *_changeListeners; NSMutableDictionary *_discoverDatacenterAddressActions; - NSMutableDictionary *_discoverDatacenterTransportSchemeActions; NSMutableDictionary *_datacenterAuthActions; NSMutableDictionary *_datacenterTransferAuthActions; @@ -121,7 +121,6 @@ _changeListeners = [[NSMutableArray alloc] init]; _discoverDatacenterAddressActions = [[NSMutableDictionary alloc] init]; - _discoverDatacenterTransportSchemeActions = [[NSMutableDictionary alloc] init]; _datacenterAuthActions = [[NSMutableDictionary alloc] init]; _datacenterTransferAuthActions = [[NSMutableDictionary alloc] init]; @@ -159,9 +158,6 @@ NSDictionary *discoverDatacenterAddressActions = _discoverDatacenterAddressActions; _discoverDatacenterAddressActions = nil; - NSDictionary *discoverDatacenterTransportSchemeActions = _discoverDatacenterTransportSchemeActions; - _discoverDatacenterTransportSchemeActions = nil; - NSDictionary *datacenterTransferAuthActions = _datacenterTransferAuthActions; _datacenterTransferAuthActions = nil; @@ -758,7 +754,7 @@ { if (_transportSchemeDisposableByDatacenterId == nil) _transportSchemeDisposableByDatacenterId = [[NSMutableDictionary alloc] init]; - id disposable = _transportSchemeDisposableByDatacenterId[@(datacenterId)]; + id disposable = _transportSchemeDisposableByDatacenterId[@(datacenterId)]; if (disposable == nil) { __weak MTContext *weakSelf = self; @@ -813,7 +809,7 @@ { if (_transportSchemeDisposableByDatacenterId == nil) _transportSchemeDisposableByDatacenterId = [[NSMutableDictionary alloc] init]; - id disposable = _transportSchemeDisposableByDatacenterId[@(datacenterId)]; + id disposable = _transportSchemeDisposableByDatacenterId[@(datacenterId)]; [disposable dispose]; [_transportSchemeDisposableByDatacenterId removeObjectForKey:@(datacenterId)]; } diff --git a/MTProtoKit/MTDatacenterAddress.m b/MTProtoKit/MTDatacenterAddress.m index 4a11ab751e..03eb91a7de 100644 --- a/MTProtoKit/MTDatacenterAddress.m +++ b/MTProtoKit/MTDatacenterAddress.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDatacenterAddress.h" #import #import diff --git a/MTProtoKit/MTDatacenterAddressSet.h b/MTProtoKit/MTDatacenterAddressSet.h index 9eea4963eb..987e5ca93a 100644 --- a/MTProtoKit/MTDatacenterAddressSet.h +++ b/MTProtoKit/MTDatacenterAddressSet.h @@ -6,7 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import + +@class MTDatacenterAddress; @interface MTDatacenterAddressSet : NSObject diff --git a/MTProtoKit/MTDatacenterAddressSet.m b/MTProtoKit/MTDatacenterAddressSet.m index 868a08438b..b29137772b 100644 --- a/MTProtoKit/MTDatacenterAddressSet.m +++ b/MTProtoKit/MTDatacenterAddressSet.m @@ -6,7 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDatacenterAddressSet.h" + +#import "MTDatacenterAddress.h" @implementation MTDatacenterAddressSet diff --git a/MTProtoKit/MTDatacenterAuthAction.m b/MTProtoKit/MTDatacenterAuthAction.m index fbb6ce3583..76949f339e 100644 --- a/MTProtoKit/MTDatacenterAuthAction.m +++ b/MTProtoKit/MTDatacenterAuthAction.m @@ -6,14 +6,14 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDatacenterAuthAction.h" -#import -#import -#import -#import +#import "MTContext.h" +#import "MTProto.h" +#import "MTRequest.h" +#import "MTDatacenterSaltInfo.h" -#import +#import "MTDatacenterAuthMessageService.h" @interface MTDatacenterAuthAction () { diff --git a/MTProtoKit/MTDatacenterAuthInfo.m b/MTProtoKit/MTDatacenterAuthInfo.m index a6dcbd3eb9..42c904ca29 100644 --- a/MTProtoKit/MTDatacenterAuthInfo.m +++ b/MTProtoKit/MTDatacenterAuthInfo.m @@ -6,9 +6,8 @@ * Copyright Peter Iakovlev, 2013. */ -#import - -#import +#import "MTDatacenterAuthInfo.h" +#import "MTDatacenterSaltInfo.h" @implementation MTDatacenterAuthInfo diff --git a/MTProtoKit/MTDatacenterAuthMessageService.h b/MTProtoKit/MTDatacenterAuthMessageService.h index 452504e391..f738f0182b 100644 --- a/MTProtoKit/MTDatacenterAuthMessageService.h +++ b/MTProtoKit/MTDatacenterAuthMessageService.h @@ -6,7 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @class MTContext; @class MTDatacenterAuthMessageService; diff --git a/MTProtoKit/MTDatacenterAuthMessageService.m b/MTProtoKit/MTDatacenterAuthMessageService.m index a590accc22..a079efebf2 100644 --- a/MTProtoKit/MTDatacenterAuthMessageService.m +++ b/MTProtoKit/MTDatacenterAuthMessageService.m @@ -6,27 +6,27 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDatacenterAuthMessageService.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "MTLogging.h" +#import "MTContext.h" +#import "MTProto.h" +#import "MTSerialization.h" +#import "MTSessionInfo.h" +#import "MTIncomingMessage.h" +#import "MTOutgoingMessage.h" +#import "MTMessageTransaction.h" +#import "MTPreparedMessage.h" +#import "MTDatacenterAuthInfo.h" +#import "MTDatacenterSaltInfo.h" +#import "MTBuffer.h" +#import "MTEncryption.h" -#import -#import -#import -#import -#import +#import "MTInternalMessageParser.h" +#import "MTServerDhInnerDataMessage.h" +#import "MTResPqMessage.h" +#import "MTServerDhParamsMessage.h" +#import "MTSetClientDhParamsResponseMessage.h" static NSDictionary *selectPublicKey(NSArray *fingerprints) { @@ -178,7 +178,7 @@ typedef enum { if (_nonce == nil) { uint8_t nonceBytes[16]; - SecRandomCopyBytes(kSecRandomDefault, 16, nonceBytes); + __unused int result = SecRandomCopyBytes(kSecRandomDefault, 16, nonceBytes); _nonce = [[NSData alloc] initWithBytes:nonceBytes length:16]; } @@ -308,7 +308,7 @@ typedef enum { _dhPublicKeyFingerprint = [[publicKey objectForKey:@"fingerprint"] longLongValue]; uint8_t nonceBytes[32]; - SecRandomCopyBytes(kSecRandomDefault, 32, nonceBytes); + __unused int result = SecRandomCopyBytes(kSecRandomDefault, 32, nonceBytes); _newNonce = [[NSData alloc] initWithBytes:nonceBytes length:32]; MTBuffer *innerDataBuffer = [[MTBuffer alloc] init]; @@ -500,7 +500,7 @@ typedef enum { } uint8_t bBytes[256]; - SecRandomCopyBytes(kSecRandomDefault, 256, bBytes); + __unused int result = SecRandomCopyBytes(kSecRandomDefault, 256, bBytes); NSData *b = [[NSData alloc] initWithBytes:bBytes length:256]; int32_t tmpG = innerDataG; diff --git a/MTProtoKit/MTDatacenterSaltInfo.m b/MTProtoKit/MTDatacenterSaltInfo.m index 8a3d24d745..fd0225b93e 100644 --- a/MTProtoKit/MTDatacenterSaltInfo.m +++ b/MTProtoKit/MTDatacenterSaltInfo.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDatacenterSaltInfo.h" @implementation MTDatacenterSaltInfo diff --git a/MTProtoKit/MTDatacenterTransferAuthAction.m b/MTProtoKit/MTDatacenterTransferAuthAction.m index 86758057e7..a313a19ce6 100644 --- a/MTProtoKit/MTDatacenterTransferAuthAction.m +++ b/MTProtoKit/MTDatacenterTransferAuthAction.m @@ -6,14 +6,14 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDatacenterTransferAuthAction.h" -#import -#import -#import -#import -#import -#import +#import "MTContext.h" +#import "MTSerialization.h" +#import "MTProto.h" +#import "MTRequestMessageService.h" +#import "MTRequest.h" +#import "MTBuffer.h" @interface MTDatacenterTransferAuthAction () { diff --git a/MTProtoKit/MTDiscoverDatacenterAddressAction.h b/MTProtoKit/MTDiscoverDatacenterAddressAction.h index 3eb7ae244b..58352d78a4 100644 --- a/MTProtoKit/MTDiscoverDatacenterAddressAction.h +++ b/MTProtoKit/MTDiscoverDatacenterAddressAction.h @@ -24,4 +24,4 @@ - (void)execute:(MTContext *)context datacenterId:(NSInteger)datacenterId; - (void)cancel; -@end \ No newline at end of file +@end diff --git a/MTProtoKit/MTDiscoverDatacenterAddressAction.m b/MTProtoKit/MTDiscoverDatacenterAddressAction.m index 791b9295dd..9015d1690c 100644 --- a/MTProtoKit/MTDiscoverDatacenterAddressAction.m +++ b/MTProtoKit/MTDiscoverDatacenterAddressAction.m @@ -6,14 +6,14 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDiscoverDatacenterAddressAction.h" -#import -#import -#import -#import -#import -#import +#import "MTContext.h" +#import "MTSerialization.h" +#import "MTProto.h" +#import "MTDatacenterAddressSet.h" +#import "MTRequestMessageService.h" +#import "MTRequest.h" @interface MTDiscoverDatacenterAddressAction () { diff --git a/MTProtoKit/MTDropResponseContext.m b/MTProtoKit/MTDropResponseContext.m index af460f08d5..13799be45a 100644 --- a/MTProtoKit/MTDropResponseContext.m +++ b/MTProtoKit/MTDropResponseContext.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTDropResponseContext.h" @implementation MTDropResponseContext diff --git a/MTProtoKit/MTEncryption.h b/MTProtoKit/MTEncryption.h index 6316d0b6fa..503664a4ed 100644 --- a/MTProtoKit/MTEncryption.h +++ b/MTProtoKit/MTEncryption.h @@ -24,7 +24,6 @@ int32_t MTMurMurHash32(const void *bytes, int length); void MTAesEncryptInplace(NSMutableData *data, NSData *key, NSData *iv); void MTAesEncryptInplaceAndModifyIv(NSMutableData *data, NSData *key, NSMutableData *iv); -void MTAesDecryptInplace(NSMutableData *data, NSData *key, NSData *iv); void MTAesDecryptInplaceAndModifyIv(NSMutableData *data, NSData *key, NSMutableData *iv); NSData *MTAesEncrypt(NSData *data, NSData *key, NSData *iv); NSData *MTAesDecrypt(NSData *data, NSData *key, NSData *iv); diff --git a/MTProtoKit/MTEncryption.m b/MTProtoKit/MTEncryption.m index 54468de6ee..eeafaed55b 100644 --- a/MTProtoKit/MTEncryption.m +++ b/MTProtoKit/MTEncryption.m @@ -6,23 +6,19 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTEncryption.h" -#import -#import +#import "MTLogging.h" +#import "MTKeychain.h" #import #import #include -#include -#include -#include -#include #include -#include -#include -#include + +#import "MTAes.h" +#import "MTRsa.h" NSData *MTSha1(NSData *data) { @@ -166,38 +162,39 @@ int32_t MTMurMurHash32(const void *bytes, int length) void MTAesEncryptInplace(NSMutableData *data, NSData *key, NSData *iv) { - AES_KEY aesKey; - AES_set_encrypt_key(key.bytes, 256, &aesKey); - unsigned char aesIv[AES_BLOCK_SIZE * 2]; + unsigned char aesIv[16 * 2]; memcpy(aesIv, iv.bytes, iv.length); - AES_ige_encrypt(data.bytes, (void *)data.bytes, data.length, &aesKey, aesIv, true); + void *outData = malloc(data.length); + MyAesIgeEncrypt(data.bytes, (int)data.length, outData, key.bytes, (int)key.length, aesIv); + memcpy(data.mutableBytes, outData, data.length); + free(outData); } void MTAesEncryptInplaceAndModifyIv(NSMutableData *data, NSData *key, NSMutableData *iv) { - AES_KEY aesKey; - AES_set_encrypt_key(key.bytes, 256, &aesKey); - - AES_ige_encrypt(data.bytes, (void *)data.bytes, data.length, &aesKey, iv.mutableBytes, true); -} - -void MTAesDecryptInplace(NSMutableData *data, NSData *key, NSData *iv) -{ - AES_KEY aesKey; - AES_set_decrypt_key(key.bytes, 256, &aesKey); - unsigned char aesIv[AES_BLOCK_SIZE * 2]; + unsigned char aesIv[16 * 2]; memcpy(aesIv, iv.bytes, iv.length); - AES_ige_encrypt(data.bytes, (void *)data.bytes, data.length, &aesKey, aesIv, false); + void *outData = malloc(data.length); + MyAesIgeEncrypt(data.bytes, (int)data.length, outData, key.bytes, (int)key.length, aesIv); + memcpy(data.mutableBytes, outData, data.length); + free(outData); + + memcpy(iv.mutableBytes, aesIv, 16 * 2); } void MTAesDecryptInplaceAndModifyIv(NSMutableData *data, NSData *key, NSMutableData *iv) { - AES_KEY aesKey; - AES_set_decrypt_key(key.bytes, 256, &aesKey); + unsigned char aesIv[16 * 2]; + memcpy(aesIv, iv.bytes, iv.length); - AES_ige_encrypt(data.bytes, (void *)data.bytes, data.length, &aesKey, iv.mutableBytes, false); + void *outData = malloc(data.length); + MyAesIgeDecrypt(data.bytes, (int)data.length, outData, key.bytes, (int)key.length, aesIv); + memcpy(data.mutableBytes, outData, data.length); + free(outData); + + memcpy(iv.mutableBytes, aesIv, 16 * 2); } NSData *MTAesEncrypt(NSData *data, NSData *key, NSData *iv) @@ -209,15 +206,13 @@ NSData *MTAesEncrypt(NSData *data, NSData *key, NSData *iv) } return nil; } - AES_KEY aesKey; - AES_set_encrypt_key(key.bytes, 256, &aesKey); - unsigned char aesIv[AES_BLOCK_SIZE * 2]; + + unsigned char aesIv[16 * 2]; memcpy(aesIv, iv.bytes, iv.length); - uint8_t *resultBytes = malloc(data.length); - AES_ige_encrypt(data.bytes, resultBytes, data.length, &aesKey, aesIv, true); - - return [[NSData alloc] initWithBytesNoCopy:resultBytes length:data.length freeWhenDone:true]; + void *outData = malloc(data.length); + MyAesIgeEncrypt(data.bytes, (int)data.length, outData, key.bytes, (int)key.length, aesIv); + return [[NSData alloc] initWithBytesNoCopy:outData length:data.length freeWhenDone:true]; } NSData *MTAesDecrypt(NSData *data, NSData *key, NSData *iv) @@ -229,43 +224,24 @@ NSData *MTAesDecrypt(NSData *data, NSData *key, NSData *iv) } return nil; } - AES_KEY aesKey; - AES_set_decrypt_key(key.bytes, 256, &aesKey); - unsigned char aesIv[AES_BLOCK_SIZE * 2]; + + NSMutableData *resultData = [[NSMutableData alloc] initWithLength:data.length]; + + unsigned char aesIv[16 * 2]; memcpy(aesIv, iv.bytes, iv.length); + MyAesIgeDecrypt(data.bytes, (int)data.length, resultData.mutableBytes, key.bytes, (int)key.length, aesIv); - uint8_t *resultBytes = malloc(data.length); - AES_ige_encrypt(data.bytes, resultBytes, data.length, &aesKey, aesIv, false); - - return [[NSData alloc] initWithBytesNoCopy:resultBytes length:data.length freeWhenDone:true]; + return resultData; } NSData *MTRsaEncrypt(NSString *publicKey, NSData *data) { - BIO *keyBio = BIO_new(BIO_s_mem()); - const char *keyData = [publicKey UTF8String]; - BIO_write(keyBio, keyData, (int)publicKey.length); - RSA *rsaKey = PEM_read_bio_RSAPublicKey(keyBio, NULL, NULL, NULL); - BIO_free(keyBio); - - BN_CTX *ctx = BN_CTX_new(); - BIGNUM *a = BN_bin2bn(data.bytes, (int)data.length, NULL); - BIGNUM *r = BN_new(); - - BN_mod_exp(r, a, rsaKey->e, rsaKey->n, ctx); - - unsigned char *res = malloc((size_t)BN_num_bytes(r)); - int resLen = BN_bn2bin(r, res); - - BN_CTX_free(ctx); - BN_free(a); - BN_free(r); - - RSA_free(rsaKey); - - NSData *result = [[NSData alloc] initWithBytesNoCopy:res length:(NSUInteger)resLen freeWhenDone:true]; - - return result; + NSMutableData *updatedData = [[NSMutableData alloc] initWithData:data]; + while (updatedData.length < 256) { + uint8_t zero = 0; + [updatedData replaceBytesInRange:NSMakeRange(0, 0) withBytes:&zero length:1]; + } + return [MTRsa encryptData:updatedData publicKey:publicKey]; } NSData *MTExp(NSData *base, NSData *exp, NSData *modulus) diff --git a/MTProtoKit/MTFileBasedKeychain.h b/MTProtoKit/MTFileBasedKeychain.h index e4f36cd021..49c361d927 100644 --- a/MTProtoKit/MTFileBasedKeychain.h +++ b/MTProtoKit/MTFileBasedKeychain.h @@ -1,6 +1,10 @@ #import -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @interface MTFileBasedKeychain : NSObject diff --git a/MTProtoKit/MTFileBasedKeychain.m b/MTProtoKit/MTFileBasedKeychain.m index 0470529468..24fe2c7f68 100644 --- a/MTProtoKit/MTFileBasedKeychain.m +++ b/MTProtoKit/MTFileBasedKeychain.m @@ -1,6 +1,6 @@ #import "MTFileBasedKeychain.h" -#import +#import "MTLogging.h" #import @@ -10,7 +10,7 @@ #define TG_SYNCHRONIZED_END(lock) pthread_mutex_unlock(&_TG_SYNCHRONIZED_##lock); #import -#import +#import "MTEncryption.h" static TG_SYNCHRONIZED_DEFINE(_keychains) = PTHREAD_MUTEX_INITIALIZER; static NSMutableDictionary *keychains() @@ -136,10 +136,11 @@ static NSMutableDictionary *keychains() { uint8_t buf[32]; - SecRandomCopyBytes(kSecRandomDefault, 32, buf); + int result = 0; + result = SecRandomCopyBytes(kSecRandomDefault, 32, buf); _aesKey = [[NSData alloc] initWithBytes:buf length:32]; - SecRandomCopyBytes(kSecRandomDefault, 32, buf); + result = SecRandomCopyBytes(kSecRandomDefault, 32, buf); _aesIv = [[NSData alloc] initWithBytes:buf length:32]; } @@ -222,10 +223,16 @@ static NSMutableDictionary *keychains() if (data.length == 4 + paddedLength || data.length == 4 + paddedLength + 4) { - NSMutableData *decryptedData = [[NSMutableData alloc] init]; - [decryptedData appendData:[data subdataWithRange:NSMakeRange(4, paddedLength)]]; - if (_encrypted) - MTAesDecryptInplace(decryptedData, _aesKey, _aesIv); + NSMutableData *encryptedData = [[NSMutableData alloc] init]; + [encryptedData appendData:[data subdataWithRange:NSMakeRange(4, paddedLength)]]; + + NSMutableData *decryptedData = nil; + if (_encrypted) { + decryptedData = [[NSMutableData alloc] initWithData:MTAesDecrypt(encryptedData, _aesKey, _aesIv)]; + } else { + decryptedData = encryptedData; + } + [decryptedData setLength:length]; bool hashVerified = true; diff --git a/MTProtoKit/MTHttpTransport.h b/MTProtoKit/MTHttpTransport.h index 2ec6eb66de..dff7ba4659 100644 --- a/MTProtoKit/MTHttpTransport.h +++ b/MTProtoKit/MTHttpTransport.h @@ -6,7 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @interface MTHttpTransport : MTTransport diff --git a/MTProtoKit/MTHttpTransport.m b/MTProtoKit/MTHttpTransport.m index 5400e87b85..64417e7079 100644 --- a/MTProtoKit/MTHttpTransport.m +++ b/MTProtoKit/MTHttpTransport.m @@ -6,27 +6,29 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTHttpTransport.h" -#import -#import -#import +#import "MTLogging.h" +#import "MTQueue.h" +#import "MTTimer.h" -#import -#import +#import "MTDatacenterAddressSet.h" +#import "MTDatacenterAddress.h" -#import -#import -#import -#import -#import -#import +#import "MTSerialization.h" +#import "MTTransportTransaction.h" +#import "MTMessageTransaction.h" +#import "MTOutgoingMessage.h" +#import "MTIncomingMessage.h" +#import "MTPreparedMessage.h" -#import -#import +#import "MTHttpWorkerBehaviour.h" +#import "MTHttpWorker.h" -#import -#import +#import "MTBuffer.h" +#import "MTPongMessage.h" +#import "MTContext.h" +#import "MTDatacenterAuthInfo.h" @interface MTHttpTransport () { diff --git a/MTProtoKit/MTHttpWorker.m b/MTProtoKit/MTHttpWorker.m index 2e4e38c63d..8732083027 100644 --- a/MTProtoKit/MTHttpWorker.m +++ b/MTProtoKit/MTHttpWorker.m @@ -6,14 +6,14 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTHttpWorker.h" -#import -#import +#import "MTTimer.h" +#import "MTQueue.h" -#import +#import "MTDatacenterAddress.h" -#import +#import "MTInternalId.h" MTInternalIdClass(MTHttpWorker) diff --git a/MTProtoKit/MTHttpWorkerBehaviour.m b/MTProtoKit/MTHttpWorkerBehaviour.m index 6fedb05e3f..6d89f197c1 100644 --- a/MTProtoKit/MTHttpWorkerBehaviour.m +++ b/MTProtoKit/MTHttpWorkerBehaviour.m @@ -6,10 +6,10 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTHttpWorkerBehaviour.h" -#import -#import +#import "MTQueue.h" +#import "MTTimer.h" @interface MTHttpWorkerBehaviour () { diff --git a/MTProtoKit/MTIncomingMessage.m b/MTProtoKit/MTIncomingMessage.m index 4cd0b76611..76b4119ada 100644 --- a/MTProtoKit/MTIncomingMessage.m +++ b/MTProtoKit/MTIncomingMessage.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTIncomingMessage.h" @implementation MTIncomingMessage diff --git a/MTProtoKit/MTInputStream.m b/MTProtoKit/MTInputStream.m index 35eb3e0d30..d0f012a13d 100644 --- a/MTProtoKit/MTInputStream.m +++ b/MTProtoKit/MTInputStream.m @@ -7,8 +7,8 @@ */ #import -#import -#import +#import "MTLogging.h" +#import "MTInputStream.h" #if TARGET_OS_IPHONE # import diff --git a/MTProtoKit/MTInternalMessageParser.m b/MTProtoKit/MTInternalMessageParser.m index 2e42cc566f..e56944151f 100644 --- a/MTProtoKit/MTInternalMessageParser.m +++ b/MTProtoKit/MTInternalMessageParser.m @@ -1,28 +1,30 @@ #import "MTInternalMessageParser.h" -#import +#import "MTBufferReader.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "MTResPqMessage.h" +#import "MTRpcResultMessage.h" +#import "MTRpcError.h" +#import "MTDropRpcResultMessage.h" +#import "MTServerDhParamsMessage.h" +#import "MTServerDhInnerDataMessage.h" +#import "MTSetClientDhParamsResponseMessage.h" +#import "MTMsgsAckMessage.h" +#import "MTMsgsStateReqMessage.h" +#import "MtMsgsStateInfoMessage.h" +#import "MTMsgDetailedInfoMessage.h" +#import "MTMsgAllInfoMessage.h" +#import "MTMessage.h" +#import "MTMsgResendReqMessage.h" +#import "MTBadMsgNotificationMessage.h" +#import "MTPingMessage.h" +#import "MTPongMessage.h" +#import "MTNewSessionCreatedMessage.h" +#import "MTDestroySessionResponseMessage.h" +#import "MTMsgContainerMessage.h" +#import "MTFutureSaltsMessage.h" + +#import "MTLogging.h" #import diff --git a/MTProtoKit/MTKeychain.m b/MTProtoKit/MTKeychain.m index 99198352f2..f4bb53a83a 100644 --- a/MTProtoKit/MTKeychain.m +++ b/MTProtoKit/MTKeychain.m @@ -6,4 +6,4 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTKeychain.h" diff --git a/MTProtoKit/MTLogging.m b/MTProtoKit/MTLogging.m index 132b1c95f7..b1d330fc97 100644 --- a/MTProtoKit/MTLogging.m +++ b/MTProtoKit/MTLogging.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTLogging.h" static void (*loggingFunction)(NSString *, va_list args) = NULL; @@ -25,4 +25,4 @@ void MTLog(NSString *format, ...) { void MTLogSetLoggingFunction(void (*function)(NSString *, va_list args)) { loggingFunction = function; -} \ No newline at end of file +} diff --git a/MTProtoKit/MTMessageEncryptionKey.m b/MTProtoKit/MTMessageEncryptionKey.m index f5e31d4999..8fdb96d0ad 100644 --- a/MTProtoKit/MTMessageEncryptionKey.m +++ b/MTProtoKit/MTMessageEncryptionKey.m @@ -6,9 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTMessageEncryptionKey.h" -#import +#import "MTEncryption.h" @implementation MTMessageEncryptionKey diff --git a/MTProtoKit/MTMessageTransaction.m b/MTProtoKit/MTMessageTransaction.m index 9ac2387f9d..c07e050e86 100644 --- a/MTProtoKit/MTMessageTransaction.m +++ b/MTProtoKit/MTMessageTransaction.m @@ -6,9 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTMessageTransaction.h" -#import +#import "MTInternalId.h" MTInternalIdClass(MTMessageTransaction) diff --git a/MTProtoKit/MTNetworkAvailability.m b/MTProtoKit/MTNetworkAvailability.m index 055b68b959..0d92378baa 100644 --- a/MTProtoKit/MTNetworkAvailability.m +++ b/MTProtoKit/MTNetworkAvailability.m @@ -6,11 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTNetworkAvailability.h" -#import -#import -#import +#import "MTLogging.h" +#import "MTQueue.h" +#import "MTTimer.h" #import #import diff --git a/MTProtoKit/MTOutgoingMessage.m b/MTProtoKit/MTOutgoingMessage.m index e594d81e93..06245a3cac 100644 --- a/MTProtoKit/MTOutgoingMessage.m +++ b/MTProtoKit/MTOutgoingMessage.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTOutgoingMessage.h" @interface MTOutgoingMessageInternalId : NSObject { diff --git a/MTProtoKit/MTOutputStream.m b/MTProtoKit/MTOutputStream.m index 1bcce89231..b20bf59ec6 100644 --- a/MTProtoKit/MTOutputStream.m +++ b/MTProtoKit/MTOutputStream.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTOutputStream.h" #if TARGET_OS_IPHONE # import diff --git a/MTProtoKit/MTPreparedMessage.m b/MTProtoKit/MTPreparedMessage.m index 3a004c9c1c..9fedc1c0f6 100644 --- a/MTProtoKit/MTPreparedMessage.m +++ b/MTProtoKit/MTPreparedMessage.m @@ -6,9 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTPreparedMessage.h" -#import +#import "MTInternalId.h" MTInternalIdClass(MTPreparedMessage) diff --git a/MTProtoKit/MTProto.m b/MTProtoKit/MTProto.m index a85ec8f1ee..fff06f4ebe 100644 --- a/MTProtoKit/MTProto.m +++ b/MTProtoKit/MTProto.m @@ -6,50 +6,54 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTProto.h" #import -#import -#import -#import -#import +#import "MTLogging.h" +#import "MTQueue.h" +#import "MTOutputStream.h" +#import "MTInputStream.h" -#import -#import -#import -#import -#import -#import +#import "MTContext.h" -#import -#import -#import -#import +#import "MTDatacenterAddressSet.h" +#import "MTTransportScheme.h" +#import "MTDatacenterAuthInfo.h" +#import "MTSessionInfo.h" +#import "MTDatacenterSaltInfo.h" +#import "MTTimeFixContext.h" -#import -#import -#import -#import +#import "MTMessageService.h" +#import "MTMessageTransaction.h" +#import "MTTimeSyncMessageService.h" +#import "MTResendMessageService.h" -#import -#import +#import "MTIncomingMessage.h" +#import "MTOutgoingMessage.h" +#import "MTPreparedMessage.h" +#import "MTMessageEncryptionKey.h" -#import -#import +#import "MTTransport.h" +#import "MTTransportTransaction.h" -#import -#import +#import "MTTcpTransport.h" +#import "MTHttpTransport.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "MTSerialization.h" +#import "MTEncryption.h" + +#import "MTBuffer.h" +#import "MTInternalMessageParser.h" +#import "MTMsgContainerMessage.h" +#import "MTMessage.h" +#import "MTBadMsgNotificationMessage.h" +#import "MTMsgsAckMessage.h" +#import "MTMsgDetailedInfoMessage.h" +#import "MTNewSessionCreatedMessage.h" +#import "MTPongMessage.h" + +#import "MTTime.h" #define MTProtoV2 1 @@ -1492,14 +1496,15 @@ static const NSUInteger MTMaxUnacknowledgedMessageCount = 64; MTMessageEncryptionKey *encryptionKey = [MTMessageEncryptionKey messageEncryptionKeyForAuthKey:_authInfo.authKey messageKey:messageKey toClient:true]; #endif - NSMutableData *messageData = [is readMutableData:(data.length - 24)]; - while (messageData.length % 16 != 0) - [messageData setLength:messageData.length - 1]; - if (messageData.length != 0) + NSMutableData *encryptedMessageData = [is readMutableData:(data.length - 24)]; + while (encryptedMessageData.length % 16 != 0) { + [encryptedMessageData setLength:encryptedMessageData.length - 1]; + } + if (encryptedMessageData.length != 0) { - MTAesDecryptInplace(messageData, encryptionKey.key, encryptionKey.iv); + NSData *decryptedData = MTAesDecrypt(encryptedMessageData, encryptionKey.key, encryptionKey.iv); - MTInputStream *messageIs = [[MTInputStream alloc] initWithData:messageData]; + MTInputStream *messageIs = [[MTInputStream alloc] initWithData:decryptedData]; [messageIs readInt64]; [messageIs readInt64]; diff --git a/MTProtoKit/MTProtoKit.h b/MTProtoKit/MTProtoKit.h index 5beb9f7a99..b443446fde 100644 --- a/MTProtoKit/MTProtoKit.h +++ b/MTProtoKit/MTProtoKit.h @@ -32,7 +32,6 @@ FOUNDATION_EXPORT const unsigned char MtProtoKitVersionString[]; #import #import #import -#import #import #import #import diff --git a/MTProtoKit/MTQueue.h b/MTProtoKit/MTQueue.h index ad0fd4be98..1010b03f0d 100644 --- a/MTProtoKit/MTQueue.h +++ b/MTProtoKit/MTQueue.h @@ -13,6 +13,7 @@ - (instancetype)initWithName:(const char *)name; + (MTQueue *)mainQueue; ++ (MTQueue *)concurrentDefaultQueue; - (dispatch_queue_t)nativeQueue; diff --git a/MTProtoKit/MTQueue.m b/MTProtoKit/MTQueue.m index 128c34a5f7..838e7af294 100644 --- a/MTProtoKit/MTQueue.m +++ b/MTProtoKit/MTQueue.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTQueue.h" @interface MTQueue () { @@ -54,6 +54,17 @@ return queue; } ++ (MTQueue *)concurrentDefaultQueue { + static MTQueue *queue = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^ + { + queue = [[MTQueue alloc] init]; + queue->_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + }); + return queue; +} + - (dispatch_queue_t)nativeQueue { return _queue; @@ -93,7 +104,7 @@ } else { - if (dispatch_get_specific(_name) == _name) + if (_name != NULL && dispatch_get_specific(_name) == _name) block(); else if (synchronous) dispatch_sync(_queue, block); diff --git a/MTProtoKit/MTRequest.h b/MTProtoKit/MTRequest.h index 74272b4a6d..1050efcebb 100644 --- a/MTProtoKit/MTRequest.h +++ b/MTProtoKit/MTRequest.h @@ -6,10 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ +#import + @class MTRequestContext; @class MTRequestErrorContext; - -#import +@class MTRpcError; @interface MTRequest : NSObject diff --git a/MTProtoKit/MTRequest.m b/MTProtoKit/MTRequest.m index 2e707d242c..34c23ca60f 100644 --- a/MTProtoKit/MTRequest.m +++ b/MTProtoKit/MTRequest.m @@ -6,7 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTRequest.h" + +#import "MTRpcError.h" @interface MTRequestInternalId : NSObject { diff --git a/MTProtoKit/MTRequestContext.m b/MTProtoKit/MTRequestContext.m index b258058a75..d713d52f8d 100644 --- a/MTProtoKit/MTRequestContext.m +++ b/MTProtoKit/MTRequestContext.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTRequestContext.h" @implementation MTRequestContext diff --git a/MTProtoKit/MTRequestErrorContext.h b/MTProtoKit/MTRequestErrorContext.h index 41758ee7ee..1ee405d3ff 100644 --- a/MTProtoKit/MTRequestErrorContext.h +++ b/MTProtoKit/MTRequestErrorContext.h @@ -7,11 +7,10 @@ */ #import -#import @interface MTRequestErrorContext : NSObject -@property (nonatomic) MTAbsoluteTime minimalExecuteTime; +@property (nonatomic) CFAbsoluteTime minimalExecuteTime; @property (nonatomic) NSUInteger internalServerErrorCount; @property (nonatomic) NSUInteger floodWaitSeconds; diff --git a/MTProtoKit/MTRequestMessageService.h b/MTProtoKit/MTRequestMessageService.h index 2ed016145d..1dec5d57e4 100644 --- a/MTProtoKit/MTRequestMessageService.h +++ b/MTProtoKit/MTRequestMessageService.h @@ -6,7 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @class MTContext; @class MTRequest; diff --git a/MTProtoKit/MTRequestMessageService.m b/MTProtoKit/MTRequestMessageService.m index fc711b6630..517d84ffc8 100644 --- a/MTProtoKit/MTRequestMessageService.m +++ b/MTProtoKit/MTRequestMessageService.m @@ -6,31 +6,31 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTRequestMessageService.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "MTLogging.h" +#import "MTTime.h" +#import "MTTimer.h" +#import "MTContext.h" +#import "MTSerialization.h" +#import "MTProto.h" +#import "MTQueue.h" +#import "MTMessageTransaction.h" +#import "MTIncomingMessage.h" +#import "MTOutgoingMessage.h" +#import "MTPreparedMessage.h" +#import "MTRequest.h" +#import "MTRequestContext.h" +#import "MTRequestErrorContext.h" +#import "MTDropResponseContext.h" +#import "MTApiEnvironment.h" +#import "MTDatacenterAuthInfo.h" +#import "MTBuffer.h" -#import -#import -#import -#import +#import "MTInternalMessageParser.h" +#import "MTRpcResultMessage.h" +#import "MTRpcError.h" +#import "MTDropRpcResultMessage.h" @interface MTRequestMessageService () { @@ -196,9 +196,9 @@ { [_queue dispatchOnQueue:^ { - MTAbsoluteTime currentTime = MTAbsoluteSystemTime(); + CFAbsoluteTime currentTime = MTAbsoluteSystemTime(); - MTAbsoluteTime minWaitTime = DBL_MAX; + CFAbsoluteTime minWaitTime = DBL_MAX; bool needTimer = false; bool needTransaction = false; @@ -348,7 +348,7 @@ bool requestsWillInitializeApi = _apiEnvironment != nil && ![_apiEnvironment.apiInitializationHash isEqualToString:[_context authInfoForDatacenterWithId:mtProto.datacenterId].authKeyAttributes[@"apiInitializationHash"]]; - MTAbsoluteTime currentTime = MTAbsoluteSystemTime(); + CFAbsoluteTime currentTime = MTAbsoluteSystemTime(); for (MTRequest *request in _requests) { @@ -625,13 +625,13 @@ if (request.shouldContinueExecutionWithErrorContext(request.errorContext)) { restartRequest = true; - request.errorContext.minimalExecuteTime = MAX(request.errorContext.minimalExecuteTime, MTAbsoluteSystemTime() + (MTAbsoluteTime)errorWaitTime); + request.errorContext.minimalExecuteTime = MAX(request.errorContext.minimalExecuteTime, MTAbsoluteSystemTime() + (CFAbsoluteTime)errorWaitTime); } } else { restartRequest = true; - request.errorContext.minimalExecuteTime = MAX(request.errorContext.minimalExecuteTime, MTAbsoluteSystemTime() + (MTAbsoluteTime)errorWaitTime); + request.errorContext.minimalExecuteTime = MAX(request.errorContext.minimalExecuteTime, MTAbsoluteSystemTime() + (CFAbsoluteTime)errorWaitTime); } } } diff --git a/MTProtoKit/MTResendMessageService.h b/MTProtoKit/MTResendMessageService.h index 2b91afd158..8ddf0c3270 100644 --- a/MTProtoKit/MTResendMessageService.h +++ b/MTProtoKit/MTResendMessageService.h @@ -6,7 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @class MTResendMessageService; diff --git a/MTProtoKit/MTResendMessageService.m b/MTProtoKit/MTResendMessageService.m index 414675036e..8a146e2602 100644 --- a/MTProtoKit/MTResendMessageService.m +++ b/MTProtoKit/MTResendMessageService.m @@ -7,18 +7,18 @@ */ #import -#import -#import +#import "MTLogging.h" +#import "MTResendMessageService.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "MTProto.h" +#import "MTContext.h" +#import "MTSerialization.h" +#import "MTMessageTransaction.h" +#import "MTOutgoingMessage.h" +#import "MTPreparedMessage.h" +#import "MTIncomingMessage.h" +#import "MTBuffer.h" +#import "MTMsgsStateInfoMessage.h" @interface MTResendMessageService () { diff --git a/MTProtoKit/MTSerialization.h b/MTProtoKit/MTSerialization.h index 65eda95662..1edba393d2 100644 --- a/MTProtoKit/MTSerialization.h +++ b/MTProtoKit/MTSerialization.h @@ -8,8 +8,8 @@ #import -#import -#import +#import +#import typedef MTExportedAuthorizationData *(^MTExportAuthorizationResponseParser)(NSData *); typedef MTDatacenterAddressListData *(^MTRequestDatacenterAddressListParser)(NSData *); diff --git a/MTProtoKit/MTSessionInfo.m b/MTProtoKit/MTSessionInfo.m index 070b167b2d..22ac33e945 100644 --- a/MTProtoKit/MTSessionInfo.m +++ b/MTProtoKit/MTSessionInfo.m @@ -6,10 +6,10 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTSessionInfo.h" -#import -#import +#import "MTLogging.h" +#import "MTContext.h" @interface MTScheduledMessageConfirmation : NSObject diff --git a/MTProtoKit/MTTcpConnection.h b/MTProtoKit/MTTcpConnection.h index e22f6a2981..f93544aac8 100644 --- a/MTProtoKit/MTTcpConnection.h +++ b/MTProtoKit/MTTcpConnection.h @@ -6,8 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import +@class MTDatacenterAddress; @class MTContext; @class MTQueue; @class MTTcpConnection; diff --git a/MTProtoKit/MTTcpConnection.m b/MTProtoKit/MTTcpConnection.m index 65a1e5fca8..cb0640e17e 100644 --- a/MTProtoKit/MTTcpConnection.m +++ b/MTProtoKit/MTTcpConnection.m @@ -6,21 +6,22 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTcpConnection.h" -#import -#import -#import +#import "MTLogging.h" +#import "MTQueue.h" +#import "MTTimer.h" #import "GCDAsyncSocket.h" #import -#import +#import "MTInternalId.h" -#import -#import +#import "MTContext.h" +#import "MTApiEnvironment.h" +#import "MTDatacenterAddress.h" -#import "aes.h" +#import "MTAes.h" MTInternalIdClass(MTTcpConnection) @@ -44,15 +45,8 @@ struct ctr_state { static void init_ctr(struct ctr_state *state, const unsigned char *iv) { - /* aes_ctr128_encrypt requires 'num' and 'ecount' set to zero on the - * first call. */ state->num = 0; memset(state->ecount, 0, 16); - - /* Initialise counter in 'ivec' to 0 */ - //memset(state->ivec + 8, 0, 8); - - /* Copy IV into 'ivec' */ memcpy(state->ivec, iv, 16); } @@ -75,11 +69,8 @@ static void init_ctr(struct ctr_state *state, const unsigned char *iv) bool _addedControlHeader; - AES_KEY _outgoingKey; - struct ctr_state _outgoingCtrState; - - AES_KEY _incomingKey; - struct ctr_state _incomingCtrState; + MTAesCtr *_outgoingAesCtr; + MTAesCtr *_incomingAesCtr; } @property (nonatomic) int64_t packetHeadDecodeToken; @@ -268,25 +259,17 @@ static void init_ctr(struct ctr_state *state, const unsigned char *iv) controlBytesReversed[i] = controlBytes[64 - 1 - i]; } - if (AES_set_encrypt_key(controlBytes + 8, 256, &_outgoingKey)) { - MTLog(@"AES_set_encrypt_key ctr failed"); - } - init_ctr(&_outgoingCtrState, controlBytes + 8 + 32); - - if (AES_set_encrypt_key(controlBytesReversed + 8, 256, &_incomingKey)) { - MTLog(@"AES_set_encrypt_key ctr failed"); - } - init_ctr(&_incomingCtrState, controlBytesReversed + 8 + 32); + _outgoingAesCtr = [[MTAesCtr alloc] initWithKey:controlBytes + 8 keyLength:32 iv:controlBytes + 8 + 32]; + _incomingAesCtr = [[MTAesCtr alloc] initWithKey:controlBytesReversed + 8 keyLength:32 iv:controlBytesReversed + 8 + 32]; uint8_t encryptedControlBytes[64]; - - AES_ctr128_encrypt(controlBytes, encryptedControlBytes, 64, &_outgoingKey, _outgoingCtrState.ivec, _outgoingCtrState.ecount, &_outgoingCtrState.num); + [_outgoingAesCtr encryptIn:controlBytes out:encryptedControlBytes len:64]; NSMutableData *outData = [[NSMutableData alloc] initWithLength:64 + packetData.length]; memcpy(outData.mutableBytes, controlBytes, 56); memcpy(outData.mutableBytes + 56, encryptedControlBytes + 56, 8); - AES_ctr128_encrypt(packetData.bytes, outData.mutableBytes + 64, packetData.length, &_outgoingKey, _outgoingCtrState.ivec, _outgoingCtrState.ecount, &_outgoingCtrState.num); + [_outgoingAesCtr encryptIn:packetData.bytes out:outData.mutableBytes + 64 len:packetData.length]; [_socket writeData:outData withTimeout:-1 tag:0]; } else { @@ -307,7 +290,8 @@ static void init_ctr(struct ctr_state *state, const unsigned char *iv) } else { if (useEncryption) { NSMutableData *encryptedData = [[NSMutableData alloc] initWithLength:packetData.length]; - AES_ctr128_encrypt(packetData.bytes, encryptedData.mutableBytes, packetData.length, &_outgoingKey, _outgoingCtrState.ivec, _outgoingCtrState.ecount, &_outgoingCtrState.num); + [_outgoingAesCtr encryptIn:packetData.bytes out:encryptedData.mutableBytes len:packetData.length]; + [_socket writeData:encryptedData withTimeout:-1 tag:0]; } else { [_socket writeData:packetData withTimeout:-1 tag:0]; @@ -387,7 +371,8 @@ static void init_ctr(struct ctr_state *state, const unsigned char *iv) NSData *data = nil; if (useEncryption) { NSMutableData *decryptedData = [[NSMutableData alloc] initWithLength:rawData.length]; - AES_ctr128_encrypt(rawData.bytes, decryptedData.mutableBytes, rawData.length, &_incomingKey, _incomingCtrState.ivec, _incomingCtrState.ecount, &_incomingCtrState.num); + [_incomingAesCtr encryptIn:rawData.bytes out:decryptedData.mutableBytes len:rawData.length]; + data = decryptedData; } else { data = rawData; diff --git a/MTProtoKit/MTTcpConnectionBehaviour.m b/MTProtoKit/MTTcpConnectionBehaviour.m index 5364bf9cf2..ac4d8e6046 100644 --- a/MTProtoKit/MTTcpConnectionBehaviour.m +++ b/MTProtoKit/MTTcpConnectionBehaviour.m @@ -8,10 +8,10 @@ #import -#import +#import "MTTcpConnectionBehaviour.h" -#import -#import +#import "MTTimer.h" +#import "MTQueue.h" @interface MTTcpConnectionBehaviour () { diff --git a/MTProtoKit/MTTcpTransport.h b/MTProtoKit/MTTcpTransport.h index 79e50064ae..6afc56dfef 100644 --- a/MTProtoKit/MTTcpTransport.h +++ b/MTProtoKit/MTTcpTransport.h @@ -6,7 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @interface MTTcpTransport : MTTransport diff --git a/MTProtoKit/MTTcpTransport.m b/MTProtoKit/MTTcpTransport.m index d856ba2b43..5732c06588 100644 --- a/MTProtoKit/MTTcpTransport.m +++ b/MTProtoKit/MTTcpTransport.m @@ -6,27 +6,27 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTcpTransport.h" -#import -#import -#import -#import +#import "MTLogging.h" +#import "MTQueue.h" +#import "MTTimer.h" +#import "MTTime.h" -#import +#import "MTDatacenterAddressSet.h" -#import -#import -#import -#import -#import +#import "MTTransportTransaction.h" +#import "MTOutgoingMessage.h" +#import "MTIncomingMessage.h" +#import "MTMessageTransaction.h" +#import "MTPreparedMessage.h" -#import -#import +#import "MTTcpConnection.h" +#import "MTTcpConnectionBehaviour.h" -#import -#import -#import +#import "MTSerialization.h" +#import "MTBuffer.h" +#import "MTPongMessage.h" static const NSTimeInterval MTTcpTransportSleepWatchdogTimeout = 60.0; diff --git a/MTProtoKit/MTTime.h b/MTProtoKit/MTTime.h index 56181cd9ed..21e3871be0 100644 --- a/MTProtoKit/MTTime.h +++ b/MTProtoKit/MTTime.h @@ -9,13 +9,13 @@ #ifndef MtProtoKit_MTTime_h #define MtProtoKit_MTTime_h -typedef double MTAbsoluteTime; - #ifdef __cplusplus extern "C" { #endif + +#import -MTAbsoluteTime MTAbsoluteSystemTime(); +CFAbsoluteTime MTAbsoluteSystemTime(); #ifdef __cplusplus } diff --git a/MTProtoKit/MTTime.m b/MTProtoKit/MTTime.m index 802e43d882..0d79a469b7 100644 --- a/MTProtoKit/MTTime.m +++ b/MTProtoKit/MTTime.m @@ -6,15 +6,15 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTime.h" #import -MTAbsoluteTime MTAbsoluteSystemTime() +CFAbsoluteTime MTAbsoluteSystemTime() { static mach_timebase_info_data_t s_timebase_info; if (s_timebase_info.denom == 0) mach_timebase_info(&s_timebase_info); - return ((MTAbsoluteTime)(mach_absolute_time() * s_timebase_info.numer)) / (s_timebase_info.denom * NSEC_PER_SEC); + return ((CFAbsoluteTime)(mach_absolute_time() * s_timebase_info.numer)) / (s_timebase_info.denom * NSEC_PER_SEC); } diff --git a/MTProtoKit/MTTimeFixContext.h b/MTProtoKit/MTTimeFixContext.h index 0b0615e571..501661bfbb 100644 --- a/MTProtoKit/MTTimeFixContext.h +++ b/MTProtoKit/MTTimeFixContext.h @@ -7,15 +7,14 @@ */ #import -#import @interface MTTimeFixContext : NSObject @property (nonatomic, readonly) int64_t messageId; @property (nonatomic, readonly) int32_t messageSeqNo; @property (nonatomic, strong, readonly) id transactionId; -@property (nonatomic, readonly) MTAbsoluteTime timeFixAbsoluteStartTime; +@property (nonatomic, readonly) CFAbsoluteTime timeFixAbsoluteStartTime; -- (instancetype)initWithMessageId:(int64_t)messageId messageSeqNo:(int32_t)messageSeqNo transactionId:(id)transactionId timeFixAbsoluteStartTime:(MTAbsoluteTime)timeFixAbsoluteStartTime; +- (instancetype)initWithMessageId:(int64_t)messageId messageSeqNo:(int32_t)messageSeqNo transactionId:(id)transactionId timeFixAbsoluteStartTime:(CFAbsoluteTime)timeFixAbsoluteStartTime; @end diff --git a/MTProtoKit/MTTimeFixContext.m b/MTProtoKit/MTTimeFixContext.m index 78063ee533..e06266a0e1 100644 --- a/MTProtoKit/MTTimeFixContext.m +++ b/MTProtoKit/MTTimeFixContext.m @@ -6,11 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTimeFixContext.h" @implementation MTTimeFixContext -- (instancetype)initWithMessageId:(int64_t)messageId messageSeqNo:(int32_t)messageSeqNo transactionId:(id)transactionId timeFixAbsoluteStartTime:(MTAbsoluteTime)timeFixAbsoluteStartTime +- (instancetype)initWithMessageId:(int64_t)messageId messageSeqNo:(int32_t)messageSeqNo transactionId:(id)transactionId timeFixAbsoluteStartTime:(CFAbsoluteTime)timeFixAbsoluteStartTime { self = [super init]; if (self != nil) diff --git a/MTProtoKit/MTTimeSyncMessageService.h b/MTProtoKit/MTTimeSyncMessageService.h index 477717d03e..6a641bfa1c 100644 --- a/MTProtoKit/MTTimeSyncMessageService.h +++ b/MTProtoKit/MTTimeSyncMessageService.h @@ -6,7 +6,11 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @class MTTimeSyncMessageService; diff --git a/MTProtoKit/MTTimeSyncMessageService.m b/MTProtoKit/MTTimeSyncMessageService.m index 7fbd156255..51c76f64d0 100644 --- a/MTProtoKit/MTTimeSyncMessageService.m +++ b/MTProtoKit/MTTimeSyncMessageService.m @@ -6,25 +6,25 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTimeSyncMessageService.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +#import "MTTime.h" +#import "MTContext.h" +#import "MTProto.h" +#import "MTSerialization.h" +#import "MTOutgoingMessage.h" +#import "MTIncomingMessage.h" +#import "MTPreparedMessage.h" +#import "MTMessageTransaction.h" +#import "MTDatacenterSaltInfo.h" +#import "MTBuffer.h" +#import "MTFutureSaltsMessage.h" @interface MTTimeSyncMessageService () { int64_t _currentMessageId; id _currentTransactionId; - MTAbsoluteTime _currentSampleAbsoluteStartTime; + CFAbsoluteTime _currentSampleAbsoluteStartTime; NSUInteger _takenSampleCount; NSUInteger _requiredSampleCount; diff --git a/MTProtoKit/MTTimer.m b/MTProtoKit/MTTimer.m index 9b1deb1467..33b1a76077 100644 --- a/MTProtoKit/MTTimer.m +++ b/MTProtoKit/MTTimer.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTimer.h" @interface MTTimer () diff --git a/MTProtoKit/MTTransport.h b/MTProtoKit/MTTransport.h index 82be0d3f6b..c4c168ca8f 100644 --- a/MTProtoKit/MTTransport.h +++ b/MTProtoKit/MTTransport.h @@ -6,8 +6,9 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import +@class MTContext; @class MTDatacenterAddress; @class MTTransport; @class MTTransportTransaction; @@ -15,7 +16,11 @@ @class MTIncomingMessage; @class MTMessageTransaction; -#import +#ifdef MtProtoKitDynamicFramework +# import +#else +# import +#endif @protocol MTTransportDelegate diff --git a/MTProtoKit/MTTransport.m b/MTProtoKit/MTTransport.m index a9bad210f8..5e52c9d082 100644 --- a/MTProtoKit/MTTransport.m +++ b/MTProtoKit/MTTransport.m @@ -6,9 +6,10 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTransport.h" -#import +#import "MTContext.h" +#import "MTNetworkAvailability.h" @interface MTTransport () { diff --git a/MTProtoKit/MTTransportScheme.m b/MTProtoKit/MTTransportScheme.m index 9da0f1b71d..4203733302 100644 --- a/MTProtoKit/MTTransportScheme.m +++ b/MTProtoKit/MTTransportScheme.m @@ -6,12 +6,12 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTransportScheme.h" -#import -#import +#import "MTTransport.h" +#import "MTDatacenterAddress.h" -#import +#import "MTTcpTransport.h" @interface MTTransportScheme () { diff --git a/MTProtoKit/MTTransportTransaction.m b/MTProtoKit/MTTransportTransaction.m index 0b7fbb13ce..1608f0b3c1 100644 --- a/MTProtoKit/MTTransportTransaction.m +++ b/MTProtoKit/MTTransportTransaction.m @@ -6,7 +6,7 @@ * Copyright Peter Iakovlev, 2013. */ -#import +#import "MTTransportTransaction.h" @implementation MTTransportTransaction diff --git a/MTRsa.h b/MTRsa.h new file mode 100644 index 0000000000..123319aa21 --- /dev/null +++ b/MTRsa.h @@ -0,0 +1,21 @@ +#import + +@interface MTRsa : NSObject + +// return base64 encoded string ++ (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey; +// return raw data ++ (NSData *)encryptData:(NSData *)data publicKey:(NSString *)pubKey; +// return base64 encoded string +// enc with private key NOT working YET! +//+ (NSString *)encryptString:(NSString *)str privateKey:(NSString *)privKey; +// return raw data +//+ (NSData *)encryptData:(NSData *)data privateKey:(NSString *)privKey; + +// decrypt base64 encoded string, convert result to string(not base64 encoded) ++ (NSString *)decryptString:(NSString *)str publicKey:(NSString *)pubKey; ++ (NSData *)decryptData:(NSData *)data publicKey:(NSString *)pubKey; ++ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey; ++ (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey; + +@end diff --git a/MTRsa.m b/MTRsa.m new file mode 100644 index 0000000000..9b95ee0d3d --- /dev/null +++ b/MTRsa.m @@ -0,0 +1,409 @@ +#import "MTRsa.h" + +/* + @author: ideawu + @link: https://github.com/ideawu/Objective-C-RSA + */ + +#import + +@implementation MTRsa + +/* + static NSString *base64_encode(NSString *str){ + NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding]; + if(!data){ + return nil; + } + return base64_encode_data(data); + } + */ + +static NSString *base64_encode_data(NSData *data){ + data = [data base64EncodedDataWithOptions:0]; + NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + return ret; +} + +static NSData *base64_decode(NSString *str){ + NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters]; + return data; +} + ++ (NSData *)stripPublicKeyHeader:(NSData *)d_key{ + // Skip ASN.1 public key header + if (d_key == nil) return(nil); + + unsigned long len = [d_key length]; + if (!len) return(nil); + + unsigned char *c_key = (unsigned char *)[d_key bytes]; + unsigned int idx = 0; + + if (c_key[idx++] != 0x30) return(nil); + + if (c_key[idx] > 0x80) idx += c_key[idx] - 0x80 + 1; + else idx++; + + // PKCS #1 rsaEncryption szOID_RSA_RSA + static unsigned char seqiod[] = + { 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x01, 0x05, 0x00 }; + if (memcmp(&c_key[idx], seqiod, 15)) return(nil); + + idx += 15; + + if (c_key[idx++] != 0x03) return(nil); + + if (c_key[idx] > 0x80) idx += c_key[idx] - 0x80 + 1; + else idx++; + + if (c_key[idx++] != '\0') return(nil); + + // Now make a new NSData from this buffer + return([NSData dataWithBytes:&c_key[idx] length:len - idx]); +} + +//credit: http://hg.mozilla.org/services/fx-home/file/tip/Sources/NetworkAndStorage/CryptoUtils.m#l1036 ++ (NSData *)stripPrivateKeyHeader:(NSData *)d_key{ + // Skip ASN.1 private key header + if (d_key == nil) return(nil); + + unsigned long len = [d_key length]; + if (!len) return(nil); + + unsigned char *c_key = (unsigned char *)[d_key bytes]; + unsigned int idx = 22; //magic byte at offset 22 + + if (0x04 != c_key[idx++]) return nil; + + //calculate length of the key + unsigned int c_len = c_key[idx++]; + int det = c_len & 0x80; + if (!det) { + c_len = c_len & 0x7f; + } else { + int byteCount = c_len & 0x7f; + if (byteCount + idx > len) { + //rsa length field longer than buffer + return nil; + } + unsigned int accum = 0; + unsigned char *ptr = &c_key[idx]; + idx += byteCount; + while (byteCount) { + accum = (accum << 8) + *ptr; + ptr++; + byteCount--; + } + c_len = accum; + } + + // Now make a new NSData from this buffer + return [d_key subdataWithRange:NSMakeRange(idx, c_len)]; +} + ++ (SecKeyRef)addPublicKey:(NSString *)key_s { + NSString *key = [[key_s stringByReplacingOccurrencesOfString:@"-----BEGIN RSA PUBLIC KEY-----\n" withString:@"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A"] stringByReplacingOccurrencesOfString:@"-----END RSA PUBLIC KEY-----" withString:@"-----END PUBLIC KEY-----"]; + NSRange spos = [key rangeOfString:@"-----BEGIN PUBLIC KEY-----"]; + NSRange epos = [key rangeOfString:@"-----END PUBLIC KEY-----"]; + if(spos.location != NSNotFound && epos.location != NSNotFound){ + NSUInteger s = spos.location + spos.length; + NSUInteger e = epos.location; + NSRange range = NSMakeRange(s, e-s); + key = [key substringWithRange:range]; + } + key = [key stringByReplacingOccurrencesOfString:@"\r" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\n" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@" " withString:@""]; + + // This will be base64 encoded, decode it. + NSData *data = base64_decode(key); + data = [MTRsa stripPublicKeyHeader:data]; + if(!data){ + return nil; + } + + //a tag to read/write keychain storage + NSString *tag = @"RSAUtil_PubKey"; + NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]]; + + // Delete any old lingering key with the same tag + NSMutableDictionary *publicKey = [[NSMutableDictionary alloc] init]; + [publicKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass]; + [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + [publicKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag]; + SecItemDelete((__bridge CFDictionaryRef)publicKey); + + // Add persistent version of the key to system keychain + [publicKey setObject:data forKey:(__bridge id)kSecValueData]; + [publicKey setObject:(__bridge id) kSecAttrKeyClassPublic forKey:(__bridge id) + kSecAttrKeyClass]; + [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id) + kSecReturnPersistentRef]; + + CFTypeRef persistKey = nil; + OSStatus status = SecItemAdd((__bridge CFDictionaryRef)publicKey, &persistKey); + if (persistKey != nil){ + CFRelease(persistKey); + } + if ((status != noErr) && (status != errSecDuplicateItem)) { + return nil; + } + + [publicKey removeObjectForKey:(__bridge id)kSecValueData]; + [publicKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef]; + [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef]; + [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + + // Now fetch the SecKeyRef version of the key + SecKeyRef keyRef = nil; + status = SecItemCopyMatching((__bridge CFDictionaryRef)publicKey, (CFTypeRef *)&keyRef); + if(status != noErr){ + return nil; + } + return keyRef; +} + ++ (SecKeyRef)addPrivateKey:(NSString *)key{ + NSRange spos; + NSRange epos; + spos = [key rangeOfString:@"-----BEGIN RSA PRIVATE KEY-----"]; + if(spos.length > 0){ + epos = [key rangeOfString:@"-----END RSA PRIVATE KEY-----"]; + }else{ + spos = [key rangeOfString:@"-----BEGIN PRIVATE KEY-----"]; + epos = [key rangeOfString:@"-----END PRIVATE KEY-----"]; + } + if(spos.location != NSNotFound && epos.location != NSNotFound){ + NSUInteger s = spos.location + spos.length; + NSUInteger e = epos.location; + NSRange range = NSMakeRange(s, e-s); + key = [key substringWithRange:range]; + } + key = [key stringByReplacingOccurrencesOfString:@"\r" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\n" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@"\t" withString:@""]; + key = [key stringByReplacingOccurrencesOfString:@" " withString:@""]; + + // This will be base64 encoded, decode it. + NSData *data = base64_decode(key); + data = [MTRsa stripPrivateKeyHeader:data]; + if(!data){ + return nil; + } + + //a tag to read/write keychain storage + NSString *tag = @"RSAUtil_PrivKey"; + NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]]; + + // Delete any old lingering key with the same tag + NSMutableDictionary *privateKey = [[NSMutableDictionary alloc] init]; + [privateKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass]; + [privateKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + [privateKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag]; + SecItemDelete((__bridge CFDictionaryRef)privateKey); + + // Add persistent version of the key to system keychain + [privateKey setObject:data forKey:(__bridge id)kSecValueData]; + [privateKey setObject:(__bridge id) kSecAttrKeyClassPrivate forKey:(__bridge id) + kSecAttrKeyClass]; + [privateKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id) + kSecReturnPersistentRef]; + + CFTypeRef persistKey = nil; + OSStatus status = SecItemAdd((__bridge CFDictionaryRef)privateKey, &persistKey); + if (persistKey != nil){ + CFRelease(persistKey); + } + if ((status != noErr) && (status != errSecDuplicateItem)) { + return nil; + } + + [privateKey removeObjectForKey:(__bridge id)kSecValueData]; + [privateKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef]; + [privateKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef]; + [privateKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType]; + + // Now fetch the SecKeyRef version of the key + SecKeyRef keyRef = nil; + status = SecItemCopyMatching((__bridge CFDictionaryRef)privateKey, (CFTypeRef *)&keyRef); + if(status != noErr){ + return nil; + } + return keyRef; +} + +/* START: Encryption & Decryption with RSA private key */ + ++ (NSData *)encryptData:(NSData *)data withKeyRef:(SecKeyRef) keyRef{ + const uint8_t *srcbuf = (const uint8_t *)[data bytes]; + size_t srclen = (size_t)data.length; + + size_t block_size = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t); + void *outbuf = malloc(block_size); + size_t src_block_size = block_size; + + NSMutableData *ret = [[NSMutableData alloc] init]; + for(int idx=0; idx src_block_size){ + data_len = src_block_size; + } + + size_t outlen = block_size; + OSStatus status = noErr; + status = SecKeyEncrypt(keyRef, + kSecPaddingNone, + srcbuf + idx, + data_len, + outbuf, + &outlen + ); + if (status != 0) { + NSLog(@"SecKeyEncrypt fail. Error Code: %d", status); + ret = nil; + break; + }else{ + [ret appendBytes:outbuf length:outlen]; + } + } + + free(outbuf); + CFRelease(keyRef); + return ret; +} + ++ (NSString *)encryptString:(NSString *)str privateKey:(NSString *)privKey{ + NSData *data = [MTRsa encryptData:[str dataUsingEncoding:NSUTF8StringEncoding] privateKey:privKey]; + NSString *ret = base64_encode_data(data); + return ret; +} + ++ (NSData *)encryptData:(NSData *)data privateKey:(NSString *)privKey{ + if(!data || !privKey){ + return nil; + } + SecKeyRef keyRef = [MTRsa addPrivateKey:privKey]; + if(!keyRef){ + return nil; + } + return [MTRsa encryptData:data withKeyRef:keyRef]; +} + ++ (NSData *)decryptData:(NSData *)data withKeyRef:(SecKeyRef) keyRef{ + const uint8_t *srcbuf = (const uint8_t *)[data bytes]; + size_t srclen = (size_t)data.length; + + size_t block_size = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t); + UInt8 *outbuf = malloc(block_size); + size_t src_block_size = block_size; + + NSMutableData *ret = [[NSMutableData alloc] init]; + for(int idx=0; idx src_block_size){ + data_len = src_block_size; + } + + size_t outlen = block_size; + OSStatus status = noErr; + status = SecKeyDecrypt(keyRef, + kSecPaddingNone, + srcbuf + idx, + data_len, + outbuf, + &outlen + ); + if (status != 0) { + NSLog(@"SecKeyEncrypt fail. Error Code: %d", status); + ret = nil; + break; + }else{ + //the actual decrypted data is in the middle, locate it! + int idxFirstZero = -1; + int idxNextZero = (int)outlen; + for ( int i = 0; i < outlen; i++ ) { + if ( outbuf[i] == 0 ) { + if ( idxFirstZero < 0 ) { + idxFirstZero = i; + } else { + idxNextZero = i; + break; + } + } + } + + [ret appendBytes:&outbuf[idxFirstZero+1] length:idxNextZero-idxFirstZero-1]; + } + } + + free(outbuf); + CFRelease(keyRef); + return ret; +} + + ++ (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey{ + NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters]; + data = [MTRsa decryptData:data privateKey:privKey]; + NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + return ret; +} + ++ (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey{ + if(!data || !privKey){ + return nil; + } + SecKeyRef keyRef = [MTRsa addPrivateKey:privKey]; + if(!keyRef){ + return nil; + } + return [MTRsa decryptData:data withKeyRef:keyRef]; +} + +/* END: Encryption & Decryption with RSA private key */ + +/* START: Encryption & Decryption with RSA public key */ + ++ (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey{ + NSData *data = [MTRsa encryptData:[str dataUsingEncoding:NSUTF8StringEncoding] publicKey:pubKey]; + NSString *ret = base64_encode_data(data); + return ret; +} + ++ (NSData *)encryptData:(NSData *)data publicKey:(NSString *)pubKey{ + if(!data || !pubKey){ + return nil; + } + SecKeyRef keyRef = [MTRsa addPublicKey:pubKey]; + if(!keyRef){ + return nil; + } + return [MTRsa encryptData:data withKeyRef:keyRef]; +} + ++ (NSString *)decryptString:(NSString *)str publicKey:(NSString *)pubKey{ + NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters]; + data = [MTRsa decryptData:data publicKey:pubKey]; + NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + return ret; +} + ++ (NSData *)decryptData:(NSData *)data publicKey:(NSString *)pubKey{ + if(!data || !pubKey){ + return nil; + } + SecKeyRef keyRef = [MTRsa addPublicKey:pubKey]; + if(!keyRef){ + return nil; + } + return [MTRsa decryptData:data withKeyRef:keyRef]; +} + +/* END: Encryption & Decryption with RSA public key */ + +@end diff --git a/MTSignal.h b/MTSignal.h new file mode 100644 index 0000000000..291c6ba145 --- /dev/null +++ b/MTSignal.h @@ -0,0 +1,41 @@ +#import + +#import "MTSubscriber.h" + +@class MTQueue; + +@interface MTSignal : NSObject +{ +@public + id (^_generator)(MTSubscriber *); +} + +- (instancetype)initWithGenerator:(id (^)(MTSubscriber *))generator; + +- (id)startWithNext:(void (^)(id next))next error:(void (^)(id error))error completed:(void (^)())completed; +- (id)startWithNext:(void (^)(id next))next; +- (id)startWithNext:(void (^)(id next))next completed:(void (^)())completed; + ++ (MTSignal *)single:(id)next; ++ (MTSignal *)fail:(id)error; ++ (MTSignal *)never; ++ (MTSignal *)complete; + +- (MTSignal *)then:(MTSignal *)signal; + +- (MTSignal *)delay:(NSTimeInterval)seconds onQueue:(MTQueue *)queue; +- (MTSignal *)timeout:(NSTimeInterval)seconds onQueue:(MTQueue *)queue orSignal:(MTSignal *)signal; + +- (MTSignal *)catch:(MTSignal *(^)(id error))f; + ++ (MTSignal *)mergeSignals:(NSArray *)signals; + +- (MTSignal *)restart; + +- (MTSignal *)take:(NSUInteger)count; + +- (MTSignal *)mapToSignal:(MTSignal *(^)(id))f; + +- (MTSignal *)onDispose:(void (^)())f; + +@end diff --git a/MTSignal.m b/MTSignal.m new file mode 100644 index 0000000000..e49ff77846 --- /dev/null +++ b/MTSignal.m @@ -0,0 +1,593 @@ +#import "MTSignal.h" + +#import "MTTimer.h" +#import "MTQueue.h" +#import "MTAtomic.h" + +#import + +@interface MTSubscriberDisposable : NSObject +{ + MTSubscriber *_subscriber; + id _disposable; +} + +@end + +@implementation MTSubscriberDisposable + +- (instancetype)initWithSubscriber:(MTSubscriber *)subscriber disposable:(id)disposable +{ + self = [super init]; + if (self != nil) + { + _subscriber = subscriber; + _disposable = disposable; + } + return self; +} + +- (void)dispose +{ + [_subscriber _markTerminatedWithoutDisposal]; + [_disposable dispose]; +} + +@end + +@interface MTSignal_ValueContainer : NSObject + +@property (nonatomic, strong, readonly) id value; + +@end + +@implementation MTSignal_ValueContainer + +- (instancetype)initWithValue:(id)value { + self = [super init]; + if (self != nil) { + _value = value; + } + return self; +} + +@end + +@interface MTSignalQueueState : NSObject +{ + OSSpinLock _lock; + bool _executingSignal; + bool _terminated; + + id _disposable; + MTMetaDisposable *_currentDisposable; + MTSubscriber *_subscriber; + + NSMutableArray *_queuedSignals; + bool _queueMode; +} + +@end + +@implementation MTSignalQueueState + +- (instancetype)initWithSubscriber:(MTSubscriber *)subscriber queueMode:(bool)queueMode +{ + self = [super init]; + if (self != nil) + { + _subscriber = subscriber; + _currentDisposable = [[MTMetaDisposable alloc] init]; + _queuedSignals = queueMode ? [[NSMutableArray alloc] init] : nil; + _queueMode = queueMode; + } + return self; +} + +- (void)beginWithDisposable:(id)disposable +{ + _disposable = disposable; +} + +- (void)enqueueSignal:(MTSignal *)signal +{ + bool startSignal = false; + OSSpinLockLock(&_lock); + if (_queueMode && _executingSignal) + { + [_queuedSignals addObject:signal]; + } + else + { + _executingSignal = true; + startSignal = true; + } + OSSpinLockUnlock(&_lock); + + if (startSignal) + { + __weak MTSignalQueueState *weakSelf = self; + id disposable = [signal startWithNext:^(id next) + { + [_subscriber putNext:next]; + } error:^(id error) + { + [_subscriber putError:error]; + } completed:^ + { + __strong MTSignalQueueState *strongSelf = weakSelf; + if (strongSelf != nil) { + [strongSelf headCompleted]; + } + }]; + + [_currentDisposable setDisposable:disposable]; + } +} + +- (void)headCompleted +{ + MTSignal *nextSignal = nil; + + bool terminated = false; + OSSpinLockLock(&_lock); + _executingSignal = false; + + if (_queueMode) + { + if (_queuedSignals.count != 0) + { + nextSignal = _queuedSignals[0]; + [_queuedSignals removeObjectAtIndex:0]; + _executingSignal = true; + } + else + terminated = _terminated; + } + else + terminated = _terminated; + OSSpinLockUnlock(&_lock); + + if (terminated) + [_subscriber putCompletion]; + else if (nextSignal != nil) + { + __weak MTSignalQueueState *weakSelf = self; + id disposable = [nextSignal startWithNext:^(id next) + { + [_subscriber putNext:next]; + } error:^(id error) + { + [_subscriber putError:error]; + } completed:^ + { + __strong MTSignalQueueState *strongSelf = weakSelf; + if (strongSelf != nil) { + [strongSelf headCompleted]; + } +}]; + + [_currentDisposable setDisposable:disposable]; + } +} + +- (void)beginCompletion +{ + bool executingSignal = false; + OSSpinLockLock(&_lock); + executingSignal = _executingSignal; + _terminated = true; + OSSpinLockUnlock(&_lock); + + if (!executingSignal) + [_subscriber putCompletion]; +} + +- (void)dispose +{ + [_currentDisposable dispose]; + [_disposable dispose]; +} + +@end + +@implementation MTSignal + +- (instancetype)initWithGenerator:(id (^)(MTSubscriber *))generator +{ + self = [super init]; + if (self != nil) + { + _generator = [generator copy]; + } + return self; +} + +- (id)startWithNext:(void (^)(id next))next error:(void (^)(id error))error completed:(void (^)())completed +{ + MTSubscriber *subscriber = [[MTSubscriber alloc] initWithNext:next error:error completed:completed]; + id disposable = _generator(subscriber); + [subscriber _assignDisposable:disposable]; + return [[MTSubscriberDisposable alloc] initWithSubscriber:subscriber disposable:disposable]; +} + +- (id)startWithNext:(void (^)(id next))next +{ + MTSubscriber *subscriber = [[MTSubscriber alloc] initWithNext:next error:nil completed:nil]; + id disposable = _generator(subscriber); + [subscriber _assignDisposable:disposable]; + return [[MTSubscriberDisposable alloc] initWithSubscriber:subscriber disposable:disposable]; +} + +- (id)startWithNext:(void (^)(id next))next completed:(void (^)())completed +{ + MTSubscriber *subscriber = [[MTSubscriber alloc] initWithNext:next error:nil completed:completed]; + id disposable = _generator(subscriber); + [subscriber _assignDisposable:disposable]; + return [[MTSubscriberDisposable alloc] initWithSubscriber:subscriber disposable:disposable]; +} + ++ (MTSignal *)single:(id)next +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + [subscriber putNext:next]; + [subscriber putCompletion]; + return nil; + }]; +} + ++ (MTSignal *)fail:(id)error +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + [subscriber putError:error]; + return nil; + }]; +} + ++ (MTSignal *)never +{ + return [[MTSignal alloc] initWithGenerator:^id (__unused MTSubscriber *subscriber) + { + return nil; + }]; +} + ++ (MTSignal *)complete +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + [subscriber putCompletion]; + return nil; + }]; +} + +- (MTSignal *)then:(MTSignal *)signal +{ + return [[MTSignal alloc] initWithGenerator:^(MTSubscriber *subscriber) + { + MTDisposableSet *compositeDisposable = [[MTDisposableSet alloc] init]; + + MTMetaDisposable *currentDisposable = [[MTMetaDisposable alloc] init]; + [compositeDisposable add:currentDisposable]; + + [currentDisposable setDisposable:[self startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [compositeDisposable add:[signal startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]]; + }]]; + + return compositeDisposable; + }]; +} + +- (MTSignal *)delay:(NSTimeInterval)seconds onQueue:(MTQueue *)queue +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + MTMetaDisposable *disposable = [[MTMetaDisposable alloc] init]; + + MTTimer *timer = [[MTTimer alloc] initWithTimeout:seconds repeat:false completion:^ + { + [disposable setDisposable:[self startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]]; + } queue:queue.nativeQueue]; + + [timer start]; + + [disposable setDisposable:[[MTBlockDisposable alloc] initWithBlock:^ + { + [timer invalidate]; + }]]; + + return disposable; + }]; +} + +- (MTSignal *)timeout:(NSTimeInterval)seconds onQueue:(MTQueue *)queue orSignal:(MTSignal *)signal +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + MTMetaDisposable *disposable = [[MTMetaDisposable alloc] init]; + + MTTimer *timer = [[MTTimer alloc] initWithTimeout:seconds repeat:false completion:^ + { + [disposable setDisposable:[signal startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]]; + } queue:queue.nativeQueue]; + [timer start]; + + [disposable setDisposable:[self startWithNext:^(id next) + { + [timer invalidate]; + [subscriber putNext:next]; + } error:^(id error) + { + [timer invalidate]; + [subscriber putError:error]; + } completed:^ + { + [timer invalidate]; + [subscriber putCompletion]; + }]]; + + return disposable; + }]; +} + +- (MTSignal *)catch:(MTSignal *(^)(id error))f +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + MTDisposableSet *disposable = [[MTDisposableSet alloc] init]; + + [disposable add:[self startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + MTSignal *signal = f(error); + [disposable add:[signal startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]]; + } completed:^ + { + [subscriber putCompletion]; + }]]; + + return disposable; + }]; +} + ++ (MTSignal *)mergeSignals:(NSArray *)signals +{ + if (signals.count == 0) + return [MTSignal complete]; + + return [[MTSignal alloc] initWithGenerator:^id(MTSubscriber *subscriber) + { + MTDisposableSet *disposables = [[MTDisposableSet alloc] init]; + MTAtomic *completedStates = [[MTAtomic alloc] initWithValue:[[NSSet alloc] init]]; + + NSInteger index = -1; + NSUInteger count = signals.count; + for (MTSignal *signal in signals) + { + index++; + + id disposable = [signal startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + NSSet *set = [completedStates modify:^id(NSSet *set) + { + return [set setByAddingObject:@(index)]; + }]; + if (set.count == count) + [subscriber putCompletion]; + }]; + + [disposables add:disposable]; + } + + return disposables; + }]; +}; + +static dispatch_block_t recursiveBlock(void (^block)(dispatch_block_t recurse)) +{ + return ^ + { + block(recursiveBlock(block)); + }; +} + +- (MTSignal *)restart +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + MTAtomic *shouldRestart = [[MTAtomic alloc] initWithValue:@true]; + + MTMetaDisposable *currentDisposable = [[MTMetaDisposable alloc] init]; + + void (^start)() = recursiveBlock(^(dispatch_block_t recurse) + { + NSNumber *currentShouldRestart = [shouldRestart with:^id(NSNumber *current) + { + return current; + }]; + + if ([currentShouldRestart boolValue]) + { + id disposable = [self startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + recurse(); + }]; + [currentDisposable setDisposable:disposable]; + } + }); + + start(); + + return [[MTBlockDisposable alloc] initWithBlock:^ + { + [currentDisposable dispose]; + + [shouldRestart modify:^id(__unused id current) + { + return @false; + }]; + }]; + }]; +} + +- (MTSignal *)take:(NSUInteger)count +{ + return [[MTSignal alloc] initWithGenerator:^id(MTSubscriber *subscriber) + { + MTAtomic *counter = [[MTAtomic alloc] initWithValue:@(0)]; + return [self startWithNext:^(id next) + { + __block bool passthrough = false; + __block bool complete = false; + [counter modify:^id(NSNumber *currentCount) + { + NSUInteger updatedCount = [currentCount unsignedIntegerValue] + 1; + if (updatedCount <= count) + passthrough = true; + if (updatedCount == count) + complete = true; + return @(updatedCount); + }]; + + if (passthrough) + [subscriber putNext:next]; + if (complete) + [subscriber putCompletion]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]; + }]; +} + +- (MTSignal *)switchToLatest +{ + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + MTSignalQueueState *state = [[MTSignalQueueState alloc] initWithSubscriber:subscriber queueMode:false]; + + [state beginWithDisposable:[self startWithNext:^(id next) + { + [state enqueueSignal:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [state beginCompletion]; + }]]; + + return state; + }]; +} + +- (MTSignal *)map:(id (^)(id))f { + return [[MTSignal alloc] initWithGenerator:^id (MTSubscriber *subscriber) + { + return [self startWithNext:^(id next) + { + [subscriber putNext:f(next)]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]; + }]; +} + +- (MTSignal *)mapToSignal:(MTSignal *(^)(id))f +{ + return [[self map:f] switchToLatest]; +} + +- (MTSignal *)onDispose:(void (^)())f +{ + return [[MTSignal alloc] initWithGenerator:^(MTSubscriber *subscriber) + { + MTDisposableSet *compositeDisposable = [[MTDisposableSet alloc] init]; + + [compositeDisposable add:[self startWithNext:^(id next) + { + [subscriber putNext:next]; + } error:^(id error) + { + [subscriber putError:error]; + } completed:^ + { + [subscriber putCompletion]; + }]]; + + [compositeDisposable add:[[MTBlockDisposable alloc] initWithBlock:^ + { + f(); + }]]; + + return compositeDisposable; + }]; +} + +@end diff --git a/MTSubscriber.h b/MTSubscriber.h new file mode 100644 index 0000000000..3997534632 --- /dev/null +++ b/MTSubscriber.h @@ -0,0 +1,18 @@ +#import + +#import "MTDisposable.h" + +@interface MTSubscriber : NSObject +{ +} + +- (instancetype)initWithNext:(void (^)(id))next error:(void (^)(id))error completed:(void (^)())completed; + +- (void)_assignDisposable:(id)disposable; +- (void)_markTerminatedWithoutDisposal; + +- (void)putNext:(id)next; +- (void)putError:(id)error; +- (void)putCompletion; + +@end diff --git a/MTSubscriber.m b/MTSubscriber.m new file mode 100644 index 0000000000..9091b99ff3 --- /dev/null +++ b/MTSubscriber.m @@ -0,0 +1,144 @@ +#import "MTSubscriber.h" + +#import + +@interface MTSubscriberBlocks : NSObject { +@public + void (^_next)(id); + void (^_error)(id); + void (^_completed)(); +} + +@end + +@implementation MTSubscriberBlocks + +- (instancetype)initWithNext:(void (^)(id))next error:(void (^)(id))error completed:(void (^)())completed { + self = [super init]; + if (self != nil) { + _next = [next copy]; + _error = [error copy]; + _completed = [completed copy]; + } + return self; +} + +@end + +@interface MTSubscriber () +{ +@protected + OSSpinLock _lock; + bool _terminated; + id _disposable; + MTSubscriberBlocks *_blocks; +} + +@end + +@implementation MTSubscriber + +- (instancetype)initWithNext:(void (^)(id))next error:(void (^)(id))error completed:(void (^)())completed +{ + self = [super init]; + if (self != nil) + { + _blocks = [[MTSubscriberBlocks alloc] initWithNext:next error:error completed:completed]; + } + return self; +} + +- (void)_assignDisposable:(id)disposable +{ + if (_terminated) + [disposable dispose]; + else + _disposable = disposable; +} + +- (void)_markTerminatedWithoutDisposal +{ + OSSpinLockLock(&_lock); + MTSubscriberBlocks *blocks = nil; + if (!_terminated) + { + blocks = _blocks; + _blocks = nil; + + _terminated = true; + } + OSSpinLockUnlock(&_lock); + + if (blocks) { + blocks = nil; + } +} + +- (void)putNext:(id)next +{ + MTSubscriberBlocks *blocks = nil; + + OSSpinLockLock(&_lock); + if (!_terminated) { + blocks = _blocks; + } + OSSpinLockUnlock(&_lock); + + if (blocks && blocks->_next) { + blocks->_next(next); + } +} + +- (void)putError:(id)error +{ + bool shouldDispose = false; + MTSubscriberBlocks *blocks = nil; + + OSSpinLockLock(&_lock); + if (!_terminated) + { + blocks = _blocks; + _blocks = nil; + + shouldDispose = true; + _terminated = true; + } + OSSpinLockUnlock(&_lock); + + if (blocks && blocks->_error) { + blocks->_error(error); + } + + if (shouldDispose) + [self->_disposable dispose]; +} + +- (void)putCompletion +{ + bool shouldDispose = false; + MTSubscriberBlocks *blocks = nil; + + OSSpinLockLock(&_lock); + if (!_terminated) + { + blocks = _blocks; + _blocks = nil; + + shouldDispose = true; + _terminated = true; + } + OSSpinLockUnlock(&_lock); + + if (blocks && blocks->_completed) + blocks->_completed(); + + if (shouldDispose) + [self->_disposable dispose]; +} + +- (void)dispose +{ + [self->_disposable dispose]; +} + +@end diff --git a/MtProtoKit.xcodeproj/project.pbxproj b/MtProtoKit.xcodeproj/project.pbxproj index 50531c0f4d..7ea2737f3f 100644 --- a/MtProtoKit.xcodeproj/project.pbxproj +++ b/MtProtoKit.xcodeproj/project.pbxproj @@ -12,12 +12,44 @@ D00354701C173CB9006610DA /* SSignalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0580ABE1B0F3E7100E8235B /* SSignalKit.framework */; }; D00354721C173CD0006610DA /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D00354711C173CD0006610DA /* libz.tbd */; }; D00354741C173CD9006610DA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D00354731C173CD9006610DA /* SystemConfiguration.framework */; }; + D010DB7D1D70ABEE0012AD96 /* MTRsa.h in Headers */ = {isa = PBXBuildFile; fileRef = D010DB7B1D70ABEE0012AD96 /* MTRsa.h */; }; + D010DB7E1D70ABEE0012AD96 /* MTRsa.m in Sources */ = {isa = PBXBuildFile; fileRef = D010DB7C1D70ABEE0012AD96 /* MTRsa.m */; }; + D010DB811D70B3B90012AD96 /* MTAes.h in Headers */ = {isa = PBXBuildFile; fileRef = D010DB7F1D70B3B90012AD96 /* MTAes.h */; }; + D010DB821D70B3B90012AD96 /* MTAes.m in Sources */ = {isa = PBXBuildFile; fileRef = D010DB801D70B3B90012AD96 /* MTAes.m */; }; D0580AC21B0F3E9C00E8235B /* MTDiscoverConnectionSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = D0580AC01B0F3E9C00E8235B /* MTDiscoverConnectionSignals.h */; }; D0580AC31B0F3E9C00E8235B /* MTDiscoverConnectionSignals.m in Sources */ = {isa = PBXBuildFile; fileRef = D0580AC11B0F3E9C00E8235B /* MTDiscoverConnectionSignals.m */; }; D079AB9C1AF39B8000076F59 /* MtProtoKitMac.h in Headers */ = {isa = PBXBuildFile; fileRef = D079AB9B1AF39B8000076F59 /* MtProtoKitMac.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D079ABB01AF39BA400076F59 /* MTProtoKit.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A31D18B158AE00C65116 /* MTProtoKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; D09A59581B582EFF00FC3724 /* MTFileBasedKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = D09A59561B582EFF00FC3724 /* MTFileBasedKeychain.h */; settings = {ATTRIBUTES = (Public, ); }; }; D09A59591B582EFF00FC3724 /* MTFileBasedKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = D09A59571B582EFF00FC3724 /* MTFileBasedKeychain.m */; }; + D0CAF2CB1D75E24C0011F558 /* MTSignal.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2C91D75E24C0011F558 /* MTSignal.h */; }; + D0CAF2CC1D75E24C0011F558 /* MTSignal.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2CA1D75E24C0011F558 /* MTSignal.m */; }; + D0CAF2CD1D75E2570011F558 /* MTSignal.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2C91D75E24C0011F558 /* MTSignal.h */; }; + D0CAF2CE1D75E2580011F558 /* MTSignal.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2C91D75E24C0011F558 /* MTSignal.h */; }; + D0CAF2CF1D75E25B0011F558 /* MTSignal.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2CA1D75E24C0011F558 /* MTSignal.m */; }; + D0CAF2D01D75E25B0011F558 /* MTSignal.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2CA1D75E24C0011F558 /* MTSignal.m */; }; + D0CAF2D31D75E26D0011F558 /* MTSubscriber.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2D11D75E26D0011F558 /* MTSubscriber.h */; }; + D0CAF2D41D75E26D0011F558 /* MTSubscriber.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2D21D75E26D0011F558 /* MTSubscriber.m */; }; + D0CAF2D71D75E2840011F558 /* MTDisposable.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2D51D75E2840011F558 /* MTDisposable.h */; }; + D0CAF2D81D75E2840011F558 /* MTDisposable.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2D61D75E2840011F558 /* MTDisposable.m */; }; + D0CAF2D91D75E3160011F558 /* MTSubscriber.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2D11D75E26D0011F558 /* MTSubscriber.h */; }; + D0CAF2DA1D75E3160011F558 /* MTSubscriber.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2D11D75E26D0011F558 /* MTSubscriber.h */; }; + D0CAF2DB1D75E31A0011F558 /* MTDisposable.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2D51D75E2840011F558 /* MTDisposable.h */; }; + D0CAF2DC1D75E31B0011F558 /* MTDisposable.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2D51D75E2840011F558 /* MTDisposable.h */; }; + D0CAF2DD1D75E31E0011F558 /* MTDisposable.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2D61D75E2840011F558 /* MTDisposable.m */; }; + D0CAF2DE1D75E31E0011F558 /* MTSubscriber.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2D21D75E26D0011F558 /* MTSubscriber.m */; }; + D0CAF2DF1D75E31F0011F558 /* MTDisposable.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2D61D75E2840011F558 /* MTDisposable.m */; }; + D0CAF2E01D75E31F0011F558 /* MTSubscriber.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2D21D75E26D0011F558 /* MTSubscriber.m */; }; + D0CAF2E31D75E7F30011F558 /* MTAtomic.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2E11D75E7F30011F558 /* MTAtomic.h */; }; + D0CAF2E41D75E7F30011F558 /* MTAtomic.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2E21D75E7F30011F558 /* MTAtomic.m */; }; + D0CAF2E51D75EA790011F558 /* MTAtomic.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2E11D75E7F30011F558 /* MTAtomic.h */; }; + D0CAF2E61D75EA7A0011F558 /* MTAtomic.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CAF2E11D75E7F30011F558 /* MTAtomic.h */; }; + D0CAF2E71D75EA7E0011F558 /* MTAtomic.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2E21D75E7F30011F558 /* MTAtomic.m */; }; + D0CAF2E81D75EA7E0011F558 /* MTAtomic.m in Sources */ = {isa = PBXBuildFile; fileRef = D0CAF2E21D75E7F30011F558 /* MTAtomic.m */; }; + D0CAF2EC1D75F4520011F558 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0CAF2EB1D75F4520011F558 /* Security.framework */; }; + D0CAF2ED1D75F4570011F558 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D00354731C173CD9006610DA /* SystemConfiguration.framework */; }; + D0CAF2EF1D75F4E20011F558 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0CAF2EE1D75F4E20011F558 /* UIKit.framework */; }; + D0CAF2F11D75F4EA0011F558 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0CAF2F01D75F4EA0011F558 /* CFNetwork.framework */; }; + D0CAF2FD1D7628FD0011F558 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D0CD990F1D75C16100F41187 /* libcrypto.a */; }; D0CB05FC1ADC4483005E298F /* MtProtoKit.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CB05FB1ADC4483005E298F /* MtProtoKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; D0CB06101ADC44B7005E298F /* MTTime.m in Sources */ = {isa = PBXBuildFile; fileRef = 93DBD23418B2DA1E00631ADC /* MTTime.m */; }; D0CB06111ADC44B7005E298F /* MTTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84D818AFE81C007F1076 /* MTTimer.m */; }; @@ -41,7 +73,7 @@ D0CB06231ADC4558005E298F /* MTContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A839E18AFB75B007F1076 /* MTContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; D0CB06241ADC455C005E298F /* MTContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A839C18AFB75B007F1076 /* MTContext.m */; }; D0CB06251ADC4562005E298F /* MTTransportScheme.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33418B161B600C65116 /* MTTransportScheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D0CB06281ADC456A005E298F /* MTDiscoverDatacenterAddressAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D518AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CB06281ADC456A005E298F /* MTDiscoverDatacenterAddressAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D518AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.h */; }; D0CB06291ADC456E005E298F /* MTDiscoverDatacenterAddressAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83D418AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.m */; }; D0CB062A1ADC4575005E298F /* MTDatacenterTransferAuthAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A839F18AFB75B007F1076 /* MTDatacenterTransferAuthAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; D0CB062B1ADC4575005E298F /* MTDatacenterAuthAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83A018AFB75B007F1076 /* MTDatacenterAuthAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -108,13 +140,321 @@ D0CB06681ADC45DA005E298F /* MTHttpWorker.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3AA18B1650F00C65116 /* MTHttpWorker.m */; }; D0CB06691ADC45DA005E298F /* MTHttpWorkerBehaviour.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3AC18B1650F00C65116 /* MTHttpWorkerBehaviour.m */; }; D0CB066A1ADC4846005E298F /* MTResendMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A37D18B164E600C65116 /* MTResendMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D0CB066B1ADC48C4005E298F /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D063A2F718B14A9400C65116 /* libcrypto.a */; }; D0CB066C1ADC49FA005E298F /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F818AFF259007F1076 /* GCDAsyncSocket.m */; }; D0CB066D1ADC49FF005E298F /* AFJSONUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A851818AFF2F8007F1076 /* AFJSONUtilities.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; D0CB066E1ADC49FF005E298F /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EA18AFF259007F1076 /* AFHTTPClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; D0CB066F1ADC49FF005E298F /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EC18AFF259007F1076 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; D0CB06701ADC49FF005E298F /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F518AFF259007F1076 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; D0CB06711ADC4A50005E298F /* MTTransportScheme.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33518B161B600C65116 /* MTTransportScheme.m */; }; + D0CD97D21D74B91400F41187 /* MTTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DBD23318B2D9AA00631ADC /* MTTime.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97D31D74B91700F41187 /* MTTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DBD23318B2D9AA00631ADC /* MTTime.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97D41D74B91B00F41187 /* MTTime.m in Sources */ = {isa = PBXBuildFile; fileRef = 93DBD23418B2DA1E00631ADC /* MTTime.m */; }; + D0CD97D51D74B91C00F41187 /* MTTime.m in Sources */ = {isa = PBXBuildFile; fileRef = 93DBD23418B2DA1E00631ADC /* MTTime.m */; }; + D0CD97D61D74B91E00F41187 /* MTTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A84D918AFE81D007F1076 /* MTTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97D71D74B92000F41187 /* MTTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A84D918AFE81D007F1076 /* MTTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97D81D74B93100F41187 /* MTTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84D818AFE81C007F1076 /* MTTimer.m */; }; + D0CD97D91D74B93100F41187 /* MTLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84DB18AFE81D007F1076 /* MTLogging.m */; }; + D0CD97DA1D74B93100F41187 /* MTEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84DC18AFE81D007F1076 /* MTEncryption.m */; }; + D0CD97DB1D74B93100F41187 /* MTQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84A018AFCF8E007F1076 /* MTQueue.m */; }; + D0CD97DC1D74B93100F41187 /* MTOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = D0503AD918B027F80074C3FE /* MTOutputStream.m */; }; + D0CD97DD1D74B93100F41187 /* MTInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = D0503ADD18B029480074C3FE /* MTInputStream.m */; }; + D0CD97DE1D74B93100F41187 /* MTRsa.m in Sources */ = {isa = PBXBuildFile; fileRef = D010DB7C1D70ABEE0012AD96 /* MTRsa.m */; }; + D0CD97DF1D74B93100F41187 /* MTAes.m in Sources */ = {isa = PBXBuildFile; fileRef = D010DB801D70B3B90012AD96 /* MTAes.m */; }; + D0CD97E01D74B93300F41187 /* MTTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84D818AFE81C007F1076 /* MTTimer.m */; }; + D0CD97E11D74B93300F41187 /* MTLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84DB18AFE81D007F1076 /* MTLogging.m */; }; + D0CD97E21D74B93300F41187 /* MTEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84DC18AFE81D007F1076 /* MTEncryption.m */; }; + D0CD97E31D74B93300F41187 /* MTQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84A018AFCF8E007F1076 /* MTQueue.m */; }; + D0CD97E41D74B93300F41187 /* MTOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = D0503AD918B027F80074C3FE /* MTOutputStream.m */; }; + D0CD97E51D74B93300F41187 /* MTInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = D0503ADD18B029480074C3FE /* MTInputStream.m */; }; + D0CD97E61D74B93300F41187 /* MTRsa.m in Sources */ = {isa = PBXBuildFile; fileRef = D010DB7C1D70ABEE0012AD96 /* MTRsa.m */; }; + D0CD97E71D74B93300F41187 /* MTAes.m in Sources */ = {isa = PBXBuildFile; fileRef = D010DB801D70B3B90012AD96 /* MTAes.m */; }; + D0CD97E81D74B94300F41187 /* MTLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A84DA18AFE81D007F1076 /* MTLogging.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97E91D74B94300F41187 /* MTEncryption.h in Headers */ = {isa = PBXBuildFile; fileRef = D0254CC518B10404009452AA /* MTEncryption.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97EA1D74B94300F41187 /* MTInternalId.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D118AFB75B007F1076 /* MTInternalId.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97EB1D74B94300F41187 /* MTQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A849F18AFCF8E007F1076 /* MTQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97EC1D74B94300F41187 /* MTOutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = D0503AD818B027F80074C3FE /* MTOutputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97ED1D74B94300F41187 /* MTInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = D0503ADC18B029480074C3FE /* MTInputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97EE1D74B94300F41187 /* MTLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A84DA18AFE81D007F1076 /* MTLogging.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97EF1D74B94300F41187 /* MTEncryption.h in Headers */ = {isa = PBXBuildFile; fileRef = D0254CC518B10404009452AA /* MTEncryption.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97F01D74B94300F41187 /* MTInternalId.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D118AFB75B007F1076 /* MTInternalId.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97F11D74B94300F41187 /* MTQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A849F18AFCF8E007F1076 /* MTQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97F21D74B94300F41187 /* MTOutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = D0503AD818B027F80074C3FE /* MTOutputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97F31D74B94300F41187 /* MTInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = D0503ADC18B029480074C3FE /* MTInputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97F61D74B94B00F41187 /* MTRsa.h in Headers */ = {isa = PBXBuildFile; fileRef = D010DB7B1D70ABEE0012AD96 /* MTRsa.h */; }; + D0CD97F71D74B94B00F41187 /* MTAes.h in Headers */ = {isa = PBXBuildFile; fileRef = D010DB7F1D70B3B90012AD96 /* MTAes.h */; }; + D0CD97F81D74B94B00F41187 /* MTRsa.h in Headers */ = {isa = PBXBuildFile; fileRef = D010DB7B1D70ABEE0012AD96 /* MTRsa.h */; }; + D0CD97F91D74B94B00F41187 /* MTAes.h in Headers */ = {isa = PBXBuildFile; fileRef = D010DB7F1D70B3B90012AD96 /* MTAes.h */; }; + D0CD97FA1D74B95000F41187 /* MTSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83B518AFB75B007F1076 /* MTSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97FB1D74B95100F41187 /* MTSerialization.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83B518AFB75B007F1076 /* MTSerialization.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD97FC1D74B96300F41187 /* MTBadMsgNotificationMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0041ADD983C007D9ED6 /* MTBadMsgNotificationMessage.h */; }; + D0CD97FD1D74B96300F41187 /* MTBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0061ADD983C007D9ED6 /* MTBuffer.h */; }; + D0CD97FE1D74B96300F41187 /* MTBufferReader.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0081ADD983C007D9ED6 /* MTBufferReader.h */; }; + D0CD97FF1D74B96300F41187 /* MTDestroySessionResponseMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A00A1ADD983C007D9ED6 /* MTDestroySessionResponseMessage.h */; }; + D0CD98001D74B96300F41187 /* MTDropRpcResultMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A00C1ADD983C007D9ED6 /* MTDropRpcResultMessage.h */; }; + D0CD98011D74B96400F41187 /* MTBadMsgNotificationMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0041ADD983C007D9ED6 /* MTBadMsgNotificationMessage.h */; }; + D0CD98021D74B96400F41187 /* MTBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0061ADD983C007D9ED6 /* MTBuffer.h */; }; + D0CD98031D74B96400F41187 /* MTBufferReader.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0081ADD983C007D9ED6 /* MTBufferReader.h */; }; + D0CD98041D74B96400F41187 /* MTDestroySessionResponseMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A00A1ADD983C007D9ED6 /* MTDestroySessionResponseMessage.h */; }; + D0CD98051D74B96400F41187 /* MTDropRpcResultMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A00C1ADD983C007D9ED6 /* MTDropRpcResultMessage.h */; }; + D0CD98061D74B96C00F41187 /* MTBadMsgNotificationMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0051ADD983C007D9ED6 /* MTBadMsgNotificationMessage.m */; }; + D0CD98071D74B96C00F41187 /* MTBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0071ADD983C007D9ED6 /* MTBuffer.m */; }; + D0CD98081D74B96C00F41187 /* MTBufferReader.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0091ADD983C007D9ED6 /* MTBufferReader.m */; }; + D0CD98091D74B96C00F41187 /* MTDestroySessionResponseMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A00B1ADD983C007D9ED6 /* MTDestroySessionResponseMessage.m */; }; + D0CD980A1D74B96C00F41187 /* MTDropRpcResultMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A00D1ADD983C007D9ED6 /* MTDropRpcResultMessage.m */; }; + D0CD980B1D74B96C00F41187 /* MTBadMsgNotificationMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0051ADD983C007D9ED6 /* MTBadMsgNotificationMessage.m */; }; + D0CD980C1D74B96C00F41187 /* MTBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0071ADD983C007D9ED6 /* MTBuffer.m */; }; + D0CD980D1D74B96C00F41187 /* MTBufferReader.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0091ADD983C007D9ED6 /* MTBufferReader.m */; }; + D0CD980E1D74B96C00F41187 /* MTDestroySessionResponseMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A00B1ADD983C007D9ED6 /* MTDestroySessionResponseMessage.m */; }; + D0CD980F1D74B96C00F41187 /* MTDropRpcResultMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A00D1ADD983C007D9ED6 /* MTDropRpcResultMessage.m */; }; + D0CD98101D74B96F00F41187 /* MTExportedAuthorizationData.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A00E1ADD983C007D9ED6 /* MTExportedAuthorizationData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98111D74B97000F41187 /* MTExportedAuthorizationData.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A00E1ADD983C007D9ED6 /* MTExportedAuthorizationData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98121D74B99400F41187 /* MTFutureSaltsMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0101ADD983C007D9ED6 /* MTFutureSaltsMessage.h */; }; + D0CD98131D74B99400F41187 /* MTInternalMessageParser.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0121ADD983C007D9ED6 /* MTInternalMessageParser.h */; }; + D0CD98141D74B99400F41187 /* MTMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0141ADD983C007D9ED6 /* MTMessage.h */; }; + D0CD98151D74B99400F41187 /* MTMsgAllInfoMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0161ADD983C007D9ED6 /* MTMsgAllInfoMessage.h */; }; + D0CD98161D74B99400F41187 /* MTMsgContainerMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0181ADD983C007D9ED6 /* MTMsgContainerMessage.h */; }; + D0CD98171D74B99400F41187 /* MTMsgDetailedInfoMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A01A1ADD983C007D9ED6 /* MTMsgDetailedInfoMessage.h */; }; + D0CD98181D74B99400F41187 /* MTMsgResendReqMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A01C1ADD983C007D9ED6 /* MTMsgResendReqMessage.h */; }; + D0CD98191D74B99400F41187 /* MTMsgsAckMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A01E1ADD983C007D9ED6 /* MTMsgsAckMessage.h */; }; + D0CD981A1D74B99400F41187 /* MTMsgsStateInfoMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0201ADD983C007D9ED6 /* MTMsgsStateInfoMessage.h */; }; + D0CD981B1D74B99400F41187 /* MTMsgsStateReqMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0221ADD983C007D9ED6 /* MTMsgsStateReqMessage.h */; }; + D0CD981C1D74B99400F41187 /* MTNewSessionCreatedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0241ADD983C007D9ED6 /* MTNewSessionCreatedMessage.h */; }; + D0CD981D1D74B99400F41187 /* MTPingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0261ADD983C007D9ED6 /* MTPingMessage.h */; }; + D0CD981E1D74B99400F41187 /* MTPongMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0281ADD983C007D9ED6 /* MTPongMessage.h */; }; + D0CD981F1D74B99400F41187 /* MTResPqMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A02A1ADD983C007D9ED6 /* MTResPqMessage.h */; }; + D0CD98201D74B99500F41187 /* MTFutureSaltsMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0101ADD983C007D9ED6 /* MTFutureSaltsMessage.h */; }; + D0CD98211D74B99500F41187 /* MTInternalMessageParser.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0121ADD983C007D9ED6 /* MTInternalMessageParser.h */; }; + D0CD98221D74B99500F41187 /* MTMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0141ADD983C007D9ED6 /* MTMessage.h */; }; + D0CD98231D74B99500F41187 /* MTMsgAllInfoMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0161ADD983C007D9ED6 /* MTMsgAllInfoMessage.h */; }; + D0CD98241D74B99500F41187 /* MTMsgContainerMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0181ADD983C007D9ED6 /* MTMsgContainerMessage.h */; }; + D0CD98251D74B99500F41187 /* MTMsgDetailedInfoMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A01A1ADD983C007D9ED6 /* MTMsgDetailedInfoMessage.h */; }; + D0CD98261D74B99500F41187 /* MTMsgResendReqMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A01C1ADD983C007D9ED6 /* MTMsgResendReqMessage.h */; }; + D0CD98271D74B99500F41187 /* MTMsgsAckMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A01E1ADD983C007D9ED6 /* MTMsgsAckMessage.h */; }; + D0CD98281D74B99500F41187 /* MTMsgsStateInfoMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0201ADD983C007D9ED6 /* MTMsgsStateInfoMessage.h */; }; + D0CD98291D74B99500F41187 /* MTMsgsStateReqMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0221ADD983C007D9ED6 /* MTMsgsStateReqMessage.h */; }; + D0CD982A1D74B99500F41187 /* MTNewSessionCreatedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0241ADD983C007D9ED6 /* MTNewSessionCreatedMessage.h */; }; + D0CD982B1D74B99500F41187 /* MTPingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0261ADD983C007D9ED6 /* MTPingMessage.h */; }; + D0CD982C1D74B99500F41187 /* MTPongMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0281ADD983C007D9ED6 /* MTPongMessage.h */; }; + D0CD982D1D74B99500F41187 /* MTResPqMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A02A1ADD983C007D9ED6 /* MTResPqMessage.h */; }; + D0CD982E1D74B9AA00F41187 /* MTExportedAuthorizationData.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A00F1ADD983C007D9ED6 /* MTExportedAuthorizationData.m */; }; + D0CD982F1D74B9AA00F41187 /* MTFutureSaltsMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0111ADD983C007D9ED6 /* MTFutureSaltsMessage.m */; }; + D0CD98301D74B9AA00F41187 /* MTInternalMessageParser.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0131ADD983C007D9ED6 /* MTInternalMessageParser.m */; }; + D0CD98311D74B9AA00F41187 /* MTMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0151ADD983C007D9ED6 /* MTMessage.m */; }; + D0CD98321D74B9AA00F41187 /* MTMsgAllInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0171ADD983C007D9ED6 /* MTMsgAllInfoMessage.m */; }; + D0CD98331D74B9AA00F41187 /* MTMsgContainerMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0191ADD983C007D9ED6 /* MTMsgContainerMessage.m */; }; + D0CD98341D74B9AA00F41187 /* MTMsgDetailedInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A01B1ADD983C007D9ED6 /* MTMsgDetailedInfoMessage.m */; }; + D0CD98351D74B9AA00F41187 /* MTMsgResendReqMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A01D1ADD983C007D9ED6 /* MTMsgResendReqMessage.m */; }; + D0CD98361D74B9AA00F41187 /* MTMsgsAckMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A01F1ADD983C007D9ED6 /* MTMsgsAckMessage.m */; }; + D0CD98371D74B9AA00F41187 /* MTMsgsStateInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0211ADD983C007D9ED6 /* MTMsgsStateInfoMessage.m */; }; + D0CD98381D74B9AA00F41187 /* MTMsgsStateReqMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0231ADD983C007D9ED6 /* MTMsgsStateReqMessage.m */; }; + D0CD98391D74B9AA00F41187 /* MTNewSessionCreatedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0251ADD983C007D9ED6 /* MTNewSessionCreatedMessage.m */; }; + D0CD983A1D74B9AA00F41187 /* MTPingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0271ADD983C007D9ED6 /* MTPingMessage.m */; }; + D0CD983B1D74B9AA00F41187 /* MTPongMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0291ADD983C007D9ED6 /* MTPongMessage.m */; }; + D0CD983C1D74B9AA00F41187 /* MTResPqMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A02B1ADD983C007D9ED6 /* MTResPqMessage.m */; }; + D0CD983D1D74B9AA00F41187 /* MTExportedAuthorizationData.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A00F1ADD983C007D9ED6 /* MTExportedAuthorizationData.m */; }; + D0CD983E1D74B9AA00F41187 /* MTFutureSaltsMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0111ADD983C007D9ED6 /* MTFutureSaltsMessage.m */; }; + D0CD983F1D74B9AA00F41187 /* MTInternalMessageParser.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0131ADD983C007D9ED6 /* MTInternalMessageParser.m */; }; + D0CD98401D74B9AA00F41187 /* MTMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0151ADD983C007D9ED6 /* MTMessage.m */; }; + D0CD98411D74B9AA00F41187 /* MTMsgAllInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0171ADD983C007D9ED6 /* MTMsgAllInfoMessage.m */; }; + D0CD98421D74B9AA00F41187 /* MTMsgContainerMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0191ADD983C007D9ED6 /* MTMsgContainerMessage.m */; }; + D0CD98431D74B9AA00F41187 /* MTMsgDetailedInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A01B1ADD983C007D9ED6 /* MTMsgDetailedInfoMessage.m */; }; + D0CD98441D74B9AA00F41187 /* MTMsgResendReqMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A01D1ADD983C007D9ED6 /* MTMsgResendReqMessage.m */; }; + D0CD98451D74B9AA00F41187 /* MTMsgsAckMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A01F1ADD983C007D9ED6 /* MTMsgsAckMessage.m */; }; + D0CD98461D74B9AA00F41187 /* MTMsgsStateInfoMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0211ADD983C007D9ED6 /* MTMsgsStateInfoMessage.m */; }; + D0CD98471D74B9AA00F41187 /* MTMsgsStateReqMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0231ADD983C007D9ED6 /* MTMsgsStateReqMessage.m */; }; + D0CD98481D74B9AA00F41187 /* MTNewSessionCreatedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0251ADD983C007D9ED6 /* MTNewSessionCreatedMessage.m */; }; + D0CD98491D74B9AA00F41187 /* MTPingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0271ADD983C007D9ED6 /* MTPingMessage.m */; }; + D0CD984A1D74B9AA00F41187 /* MTPongMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0291ADD983C007D9ED6 /* MTPongMessage.m */; }; + D0CD984B1D74B9AA00F41187 /* MTResPqMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A02B1ADD983C007D9ED6 /* MTResPqMessage.m */; }; + D0CD984C1D74B9AD00F41187 /* MTRpcError.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A02C1ADD983C007D9ED6 /* MTRpcError.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD984D1D74B9AE00F41187 /* MTRpcError.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A02C1ADD983C007D9ED6 /* MTRpcError.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD984E1D74B9B700F41187 /* MTRpcError.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A02D1ADD983C007D9ED6 /* MTRpcError.m */; }; + D0CD984F1D74B9B700F41187 /* MTRpcResultMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A02F1ADD983C007D9ED6 /* MTRpcResultMessage.m */; }; + D0CD98501D74B9B700F41187 /* MTServerDhInnerDataMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0311ADD983C007D9ED6 /* MTServerDhInnerDataMessage.m */; }; + D0CD98511D74B9B700F41187 /* MTServerDhParamsMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0331ADD983C007D9ED6 /* MTServerDhParamsMessage.m */; }; + D0CD98521D74B9B700F41187 /* MTSetClientDhParamsResponseMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0351ADD983C007D9ED6 /* MTSetClientDhParamsResponseMessage.m */; }; + D0CD98531D74B9B700F41187 /* MTRpcError.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A02D1ADD983C007D9ED6 /* MTRpcError.m */; }; + D0CD98541D74B9B700F41187 /* MTRpcResultMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A02F1ADD983C007D9ED6 /* MTRpcResultMessage.m */; }; + D0CD98551D74B9B700F41187 /* MTServerDhInnerDataMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0311ADD983C007D9ED6 /* MTServerDhInnerDataMessage.m */; }; + D0CD98561D74B9B700F41187 /* MTServerDhParamsMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0331ADD983C007D9ED6 /* MTServerDhParamsMessage.m */; }; + D0CD98571D74B9B700F41187 /* MTSetClientDhParamsResponseMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0351ADD983C007D9ED6 /* MTSetClientDhParamsResponseMessage.m */; }; + D0CD98581D74B9BF00F41187 /* MTRpcResultMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A02E1ADD983C007D9ED6 /* MTRpcResultMessage.h */; }; + D0CD98591D74B9BF00F41187 /* MTServerDhInnerDataMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0301ADD983C007D9ED6 /* MTServerDhInnerDataMessage.h */; }; + D0CD985A1D74B9BF00F41187 /* MTServerDhParamsMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0321ADD983C007D9ED6 /* MTServerDhParamsMessage.h */; }; + D0CD985B1D74B9BF00F41187 /* MTSetClientDhParamsResponseMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0341ADD983C007D9ED6 /* MTSetClientDhParamsResponseMessage.h */; }; + D0CD985C1D74B9BF00F41187 /* MTRpcResultMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A02E1ADD983C007D9ED6 /* MTRpcResultMessage.h */; }; + D0CD985D1D74B9BF00F41187 /* MTServerDhInnerDataMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0301ADD983C007D9ED6 /* MTServerDhInnerDataMessage.h */; }; + D0CD985E1D74B9BF00F41187 /* MTServerDhParamsMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0321ADD983C007D9ED6 /* MTServerDhParamsMessage.h */; }; + D0CD985F1D74B9BF00F41187 /* MTSetClientDhParamsResponseMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0341ADD983C007D9ED6 /* MTSetClientDhParamsResponseMessage.h */; }; + D0CD98601D74B9D000F41187 /* MTKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83C018AFB75B007F1076 /* MTKeychain.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98611D74B9D000F41187 /* MTKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83C018AFB75B007F1076 /* MTKeychain.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98621D74B9D500F41187 /* MTKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83A318AFB75B007F1076 /* MTKeychain.m */; }; + D0CD98631D74B9D500F41187 /* MTKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83A318AFB75B007F1076 /* MTKeychain.m */; }; + D0CD98641D74B9D700F41187 /* MTFileBasedKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = D09A59561B582EFF00FC3724 /* MTFileBasedKeychain.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98651D74B9D800F41187 /* MTFileBasedKeychain.h in Headers */ = {isa = PBXBuildFile; fileRef = D09A59561B582EFF00FC3724 /* MTFileBasedKeychain.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98661D74B9DD00F41187 /* MTFileBasedKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = D09A59571B582EFF00FC3724 /* MTFileBasedKeychain.m */; }; + D0CD98671D74B9DD00F41187 /* MTFileBasedKeychain.m in Sources */ = {isa = PBXBuildFile; fileRef = D09A59571B582EFF00FC3724 /* MTFileBasedKeychain.m */; }; + D0CD98681D74B9E200F41187 /* MTContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A839E18AFB75B007F1076 /* MTContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98691D74B9E300F41187 /* MTContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A839E18AFB75B007F1076 /* MTContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD986A1D74B9E900F41187 /* MTContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A839C18AFB75B007F1076 /* MTContext.m */; }; + D0CD986B1D74B9E900F41187 /* MTContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A839C18AFB75B007F1076 /* MTContext.m */; }; + D0CD986C1D74B9EF00F41187 /* MTTransportScheme.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33418B161B600C65116 /* MTTransportScheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD986D1D74B9F000F41187 /* MTTransportScheme.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33418B161B600C65116 /* MTTransportScheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD986E1D74B9F400F41187 /* MTTransportScheme.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33518B161B600C65116 /* MTTransportScheme.m */; }; + D0CD986F1D74B9F500F41187 /* MTTransportScheme.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33518B161B600C65116 /* MTTransportScheme.m */; }; + D0CD98701D74B9F700F41187 /* MTDiscoverConnectionSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = D0580AC01B0F3E9C00E8235B /* MTDiscoverConnectionSignals.h */; }; + D0CD98711D74B9F700F41187 /* MTDiscoverConnectionSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = D0580AC01B0F3E9C00E8235B /* MTDiscoverConnectionSignals.h */; }; + D0CD98721D74B9F900F41187 /* MTDiscoverConnectionSignals.m in Sources */ = {isa = PBXBuildFile; fileRef = D0580AC11B0F3E9C00E8235B /* MTDiscoverConnectionSignals.m */; }; + D0CD98731D74B9F900F41187 /* MTDiscoverConnectionSignals.m in Sources */ = {isa = PBXBuildFile; fileRef = D0580AC11B0F3E9C00E8235B /* MTDiscoverConnectionSignals.m */; }; + D0CD98741D74BA0100F41187 /* MTDiscoverDatacenterAddressAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D518AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.h */; }; + D0CD98751D74BA0100F41187 /* MTDiscoverDatacenterAddressAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D518AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.h */; }; + D0CD98761D74BA0700F41187 /* MTDiscoverDatacenterAddressAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83D418AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.m */; }; + D0CD98771D74BA0700F41187 /* MTDiscoverDatacenterAddressAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83D418AFB75B007F1076 /* MTDiscoverDatacenterAddressAction.m */; }; + D0CD98781D74BA4100F41187 /* MTDatacenterTransferAuthAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A839F18AFB75B007F1076 /* MTDatacenterTransferAuthAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98791D74BA4100F41187 /* MTDatacenterAuthAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83A018AFB75B007F1076 /* MTDatacenterAuthAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD987A1D74BA4100F41187 /* MTDatacenterAuthMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D918AFB75B007F1076 /* MTDatacenterAuthMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD987B1D74BA4100F41187 /* MTDatacenterTransferAuthAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A839F18AFB75B007F1076 /* MTDatacenterTransferAuthAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD987C1D74BA4100F41187 /* MTDatacenterAuthAction.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83A018AFB75B007F1076 /* MTDatacenterAuthAction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD987D1D74BA4100F41187 /* MTDatacenterAuthMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83D918AFB75B007F1076 /* MTDatacenterAuthMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD987E1D74BA4900F41187 /* MTDatacenterTransferAuthAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A839D18AFB75B007F1076 /* MTDatacenterTransferAuthAction.m */; }; + D0CD987F1D74BA4900F41187 /* MTDatacenterAuthAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83CE18AFB75B007F1076 /* MTDatacenterAuthAction.m */; }; + D0CD98801D74BA4900F41187 /* MTDatacenterAuthMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83B018AFB75B007F1076 /* MTDatacenterAuthMessageService.m */; }; + D0CD98811D74BA4900F41187 /* MTDatacenterTransferAuthAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A839D18AFB75B007F1076 /* MTDatacenterTransferAuthAction.m */; }; + D0CD98821D74BA4900F41187 /* MTDatacenterAuthAction.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83CE18AFB75B007F1076 /* MTDatacenterAuthAction.m */; }; + D0CD98831D74BA4900F41187 /* MTDatacenterAuthMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83B018AFB75B007F1076 /* MTDatacenterAuthMessageService.m */; }; + D0CD98841D74BA5100F41187 /* MTDatacenterAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83CB18AFB75B007F1076 /* MTDatacenterAddress.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98851D74BA5100F41187 /* MTDatacenterAddressSet.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83CD18AFB75B007F1076 /* MTDatacenterAddressSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98861D74BA5100F41187 /* MTDatacenterAuthInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83C918AFB75B007F1076 /* MTDatacenterAuthInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98871D74BA5100F41187 /* MTDatacenterSaltInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83C718AFB75B007F1076 /* MTDatacenterSaltInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98881D74BA5100F41187 /* MTDatacenterAddressListData.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0691ADD987A007D9ED6 /* MTDatacenterAddressListData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98891D74BA5200F41187 /* MTDatacenterAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83CB18AFB75B007F1076 /* MTDatacenterAddress.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD988A1D74BA5200F41187 /* MTDatacenterAddressSet.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83CD18AFB75B007F1076 /* MTDatacenterAddressSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD988B1D74BA5200F41187 /* MTDatacenterAuthInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83C918AFB75B007F1076 /* MTDatacenterAuthInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD988C1D74BA5200F41187 /* MTDatacenterSaltInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D05A83C718AFB75B007F1076 /* MTDatacenterSaltInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD988D1D74BA5200F41187 /* MTDatacenterAddressListData.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0691ADD987A007D9ED6 /* MTDatacenterAddressListData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD988E1D74BA5900F41187 /* MTDatacenterAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83CA18AFB75B007F1076 /* MTDatacenterAddress.m */; }; + D0CD988F1D74BA5900F41187 /* MTDatacenterAddressSet.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83CC18AFB75B007F1076 /* MTDatacenterAddressSet.m */; }; + D0CD98901D74BA5900F41187 /* MTDatacenterAuthInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83C818AFB75B007F1076 /* MTDatacenterAuthInfo.m */; }; + D0CD98911D74BA5900F41187 /* MTDatacenterSaltInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83C618AFB75B007F1076 /* MTDatacenterSaltInfo.m */; }; + D0CD98921D74BA5900F41187 /* MTDatacenterAddressListData.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A06A1ADD987A007D9ED6 /* MTDatacenterAddressListData.m */; }; + D0CD98931D74BA5A00F41187 /* MTDatacenterAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83CA18AFB75B007F1076 /* MTDatacenterAddress.m */; }; + D0CD98941D74BA5A00F41187 /* MTDatacenterAddressSet.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83CC18AFB75B007F1076 /* MTDatacenterAddressSet.m */; }; + D0CD98951D74BA5A00F41187 /* MTDatacenterAuthInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83C818AFB75B007F1076 /* MTDatacenterAuthInfo.m */; }; + D0CD98961D74BA5A00F41187 /* MTDatacenterSaltInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A83C618AFB75B007F1076 /* MTDatacenterSaltInfo.m */; }; + D0CD98971D74BA5A00F41187 /* MTDatacenterAddressListData.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A06A1ADD987A007D9ED6 /* MTDatacenterAddressListData.m */; }; + D0CD98981D74BA6500F41187 /* MTProto.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32418B1618D00C65116 /* MTProto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98991D74BA6500F41187 /* MTSessionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32618B1618D00C65116 /* MTSessionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD989A1D74BA6500F41187 /* MTTimeFixContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32818B1618D00C65116 /* MTTimeFixContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD989B1D74BA6500F41187 /* MTPreparedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32218B1618D00C65116 /* MTPreparedMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD989C1D74BA6500F41187 /* MTOutgoingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32018B1618D00C65116 /* MTOutgoingMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD989D1D74BA6500F41187 /* MTIncomingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33618B161B600C65116 /* MTIncomingMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD989E1D74BA6500F41187 /* MTMessageEncryptionKey.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33818B161B600C65116 /* MTMessageEncryptionKey.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD989F1D74BA6500F41187 /* MTProto.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32418B1618D00C65116 /* MTProto.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A01D74BA6500F41187 /* MTSessionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32618B1618D00C65116 /* MTSessionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A11D74BA6500F41187 /* MTTimeFixContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32818B1618D00C65116 /* MTTimeFixContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A21D74BA6500F41187 /* MTPreparedMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32218B1618D00C65116 /* MTPreparedMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A31D74BA6500F41187 /* MTOutgoingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A32018B1618D00C65116 /* MTOutgoingMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A41D74BA6500F41187 /* MTIncomingMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33618B161B600C65116 /* MTIncomingMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A51D74BA6500F41187 /* MTMessageEncryptionKey.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A33818B161B600C65116 /* MTMessageEncryptionKey.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98A61D74BA6E00F41187 /* MTProto.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32518B1618D00C65116 /* MTProto.m */; }; + D0CD98A71D74BA6E00F41187 /* MTSessionInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32718B1618D00C65116 /* MTSessionInfo.m */; }; + D0CD98A81D74BA6E00F41187 /* MTTimeFixContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32918B1618D00C65116 /* MTTimeFixContext.m */; }; + D0CD98A91D74BA6F00F41187 /* MTPreparedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32318B1618D00C65116 /* MTPreparedMessage.m */; }; + D0CD98AA1D74BA6F00F41187 /* MTOutgoingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32118B1618D00C65116 /* MTOutgoingMessage.m */; }; + D0CD98AB1D74BA6F00F41187 /* MTIncomingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33718B161B600C65116 /* MTIncomingMessage.m */; }; + D0CD98AC1D74BA6F00F41187 /* MTMessageEncryptionKey.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33918B161B600C65116 /* MTMessageEncryptionKey.m */; }; + D0CD98AD1D74BA6F00F41187 /* MTProto.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32518B1618D00C65116 /* MTProto.m */; }; + D0CD98AE1D74BA6F00F41187 /* MTSessionInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32718B1618D00C65116 /* MTSessionInfo.m */; }; + D0CD98AF1D74BA6F00F41187 /* MTTimeFixContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32918B1618D00C65116 /* MTTimeFixContext.m */; }; + D0CD98B01D74BA6F00F41187 /* MTPreparedMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32318B1618D00C65116 /* MTPreparedMessage.m */; }; + D0CD98B11D74BA6F00F41187 /* MTOutgoingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A32118B1618D00C65116 /* MTOutgoingMessage.m */; }; + D0CD98B21D74BA6F00F41187 /* MTIncomingMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33718B161B600C65116 /* MTIncomingMessage.m */; }; + D0CD98B31D74BA6F00F41187 /* MTMessageEncryptionKey.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A33918B161B600C65116 /* MTMessageEncryptionKey.m */; }; + D0CD98B41D74BA7500F41187 /* MTNetworkAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A38318B164F800C65116 /* MTNetworkAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98B51D74BA7500F41187 /* MTTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A38518B164F800C65116 /* MTTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98B61D74BA7500F41187 /* MTTransportTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A38718B164F800C65116 /* MTTransportTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98B71D74BA7500F41187 /* MTNetworkAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A38318B164F800C65116 /* MTNetworkAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98B81D74BA7500F41187 /* MTTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A38518B164F800C65116 /* MTTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98B91D74BA7500F41187 /* MTTransportTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A38718B164F800C65116 /* MTTransportTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98BA1D74BA7C00F41187 /* MTNetworkAvailability.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A38418B164F800C65116 /* MTNetworkAvailability.m */; }; + D0CD98BB1D74BA7C00F41187 /* MTTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A38618B164F800C65116 /* MTTransport.m */; }; + D0CD98BC1D74BA7C00F41187 /* MTTransportTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A38818B164F800C65116 /* MTTransportTransaction.m */; }; + D0CD98BD1D74BA7C00F41187 /* MTNetworkAvailability.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A38418B164F800C65116 /* MTNetworkAvailability.m */; }; + D0CD98BE1D74BA7C00F41187 /* MTTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A38618B164F800C65116 /* MTTransport.m */; }; + D0CD98BF1D74BA7C00F41187 /* MTTransportTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A38818B164F800C65116 /* MTTransportTransaction.m */; }; + D0CD98C01D74BA8200F41187 /* MTTcpTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A39918B1650400C65116 /* MTTcpTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98C11D74BA8300F41187 /* MTTcpTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A39918B1650400C65116 /* MTTcpTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98C31D74BA8A00F41187 /* MTTcpTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39A18B1650400C65116 /* MTTcpTransport.m */; }; + D0CD98C41D74BA8A00F41187 /* MTTcpTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39A18B1650400C65116 /* MTTcpTransport.m */; }; + D0CD98C51D74BA8D00F41187 /* MTTcpConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A39518B1650400C65116 /* MTTcpConnection.h */; }; + D0CD98C61D74BA8D00F41187 /* MTTcpConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A39518B1650400C65116 /* MTTcpConnection.h */; }; + D0CD98C71D74BA9000F41187 /* MTTcpConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39618B1650400C65116 /* MTTcpConnection.m */; }; + D0CD98C81D74BA9100F41187 /* MTTcpConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39618B1650400C65116 /* MTTcpConnection.m */; }; + D0CD98CA1D74BA9400F41187 /* MTTcpConnectionBehaviour.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A39718B1650400C65116 /* MTTcpConnectionBehaviour.h */; }; + D0CD98CB1D74BA9500F41187 /* MTTcpConnectionBehaviour.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A39718B1650400C65116 /* MTTcpConnectionBehaviour.h */; }; + D0CD98CC1D74BA9700F41187 /* MTTcpConnectionBehaviour.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39818B1650400C65116 /* MTTcpConnectionBehaviour.m */; }; + D0CD98CD1D74BA9700F41187 /* MTTcpConnectionBehaviour.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39818B1650400C65116 /* MTTcpConnectionBehaviour.m */; }; + D0CD98CE1D74BA9B00F41187 /* MTHttpTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A3A718B1650F00C65116 /* MTHttpTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98CF1D74BA9B00F41187 /* MTHttpTransport.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A3A718B1650F00C65116 /* MTHttpTransport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98D01D74BAA200F41187 /* MTHttpTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3A818B1650F00C65116 /* MTHttpTransport.m */; }; + D0CD98D11D74BAA200F41187 /* MTHttpTransport.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3A818B1650F00C65116 /* MTHttpTransport.m */; }; + D0CD98D21D74BAA400F41187 /* MTHttpWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A3A918B1650F00C65116 /* MTHttpWorker.h */; }; + D0CD98D31D74BAA500F41187 /* MTHttpWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A3A918B1650F00C65116 /* MTHttpWorker.h */; }; + D0CD98D41D74BAA800F41187 /* MTHttpWorker.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3AA18B1650F00C65116 /* MTHttpWorker.m */; }; + D0CD98D51D74BAA800F41187 /* MTHttpWorker.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3AA18B1650F00C65116 /* MTHttpWorker.m */; }; + D0CD98D61D74BAAA00F41187 /* MTHttpWorkerBehaviour.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A3AB18B1650F00C65116 /* MTHttpWorkerBehaviour.h */; }; + D0CD98D71D74BAAA00F41187 /* MTHttpWorkerBehaviour.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A3AB18B1650F00C65116 /* MTHttpWorkerBehaviour.h */; }; + D0CD98D81D74BAAD00F41187 /* MTHttpWorkerBehaviour.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3AC18B1650F00C65116 /* MTHttpWorkerBehaviour.m */; }; + D0CD98D91D74BAAD00F41187 /* MTHttpWorkerBehaviour.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A3AC18B1650F00C65116 /* MTHttpWorkerBehaviour.m */; }; + D0CD98DC1D74BAEA00F41187 /* AFJSONUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A851818AFF2F8007F1076 /* AFJSONUtilities.m */; }; + D0CD98DD1D74BAEA00F41187 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EA18AFF259007F1076 /* AFHTTPClient.m */; }; + D0CD98DE1D74BAEA00F41187 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EC18AFF259007F1076 /* AFHTTPRequestOperation.m */; }; + D0CD98DF1D74BAEA00F41187 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F518AFF259007F1076 /* AFURLConnectionOperation.m */; }; + D0CD98E01D74BAEB00F41187 /* AFJSONUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A851818AFF2F8007F1076 /* AFJSONUtilities.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D0CD98E11D74BAEB00F41187 /* AFHTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EA18AFF259007F1076 /* AFHTTPClient.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D0CD98E21D74BAEB00F41187 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EC18AFF259007F1076 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D0CD98E31D74BAEB00F41187 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F518AFF259007F1076 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D0CD98E41D74BAF400F41187 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F818AFF259007F1076 /* GCDAsyncSocket.m */; }; + D0CD98E51D74BAF400F41187 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F818AFF259007F1076 /* GCDAsyncSocket.m */; }; + D0CD98E81D75C0BB00F41187 /* MTMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35018B1631900C65116 /* MTMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98E91D75C0BB00F41187 /* MTMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35018B1631900C65116 /* MTMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98EA1D75C0C100F41187 /* MTMessageTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35118B1631900C65116 /* MTMessageTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98EB1D75C0C100F41187 /* MTMessageTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35118B1631900C65116 /* MTMessageTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98EC1D75C0C500F41187 /* MTMessageTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A35218B1631900C65116 /* MTMessageTransaction.m */; }; + D0CD98ED1D75C0C500F41187 /* MTMessageTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A35218B1631900C65116 /* MTMessageTransaction.m */; }; + D0CD98EE1D75C0C900F41187 /* MTTimeSyncMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35918B164BA00C65116 /* MTTimeSyncMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98EF1D75C0CA00F41187 /* MTTimeSyncMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35918B164BA00C65116 /* MTTimeSyncMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98F01D75C0D200F41187 /* MTTimeSyncMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A35A18B164BA00C65116 /* MTTimeSyncMessageService.m */; }; + D0CD98F11D75C0D300F41187 /* MTTimeSyncMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A35A18B164BA00C65116 /* MTTimeSyncMessageService.m */; }; + D0CD98F21D75C0D700F41187 /* MTRequestMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36718B164D600C65116 /* MTRequestMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98F31D75C0D700F41187 /* MTRequestMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36718B164D600C65116 /* MTRequestMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98F41D75C0DD00F41187 /* MTRequestMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36818B164D600C65116 /* MTRequestMessageService.m */; }; + D0CD98F51D75C0DD00F41187 /* MTRequestMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36818B164D600C65116 /* MTRequestMessageService.m */; }; + D0CD98F61D75C0E400F41187 /* MTRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36318B164D600C65116 /* MTRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98F71D75C0E400F41187 /* MTRequestContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36518B164D600C65116 /* MTRequestContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98F81D75C0E400F41187 /* MTRequestErrorContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DBD22F18B2D72800631ADC /* MTRequestErrorContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98F91D75C0E400F41187 /* MTDropResponseContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36118B164D600C65116 /* MTDropResponseContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98FA1D75C0E400F41187 /* MTApiEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35F18B164D600C65116 /* MTApiEnvironment.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98FB1D75C0E500F41187 /* MTRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36318B164D600C65116 /* MTRequest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98FC1D75C0E500F41187 /* MTRequestContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36518B164D600C65116 /* MTRequestContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98FD1D75C0E500F41187 /* MTRequestErrorContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 93DBD22F18B2D72800631ADC /* MTRequestErrorContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98FE1D75C0E500F41187 /* MTDropResponseContext.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A36118B164D600C65116 /* MTDropResponseContext.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD98FF1D75C0E500F41187 /* MTApiEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35F18B164D600C65116 /* MTApiEnvironment.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD99001D75C0ED00F41187 /* MTRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36418B164D600C65116 /* MTRequest.m */; }; + D0CD99011D75C0ED00F41187 /* MTRequestContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36618B164D600C65116 /* MTRequestContext.m */; }; + D0CD99021D75C0ED00F41187 /* MTRequestErrorContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 93DBD23018B2D72800631ADC /* MTRequestErrorContext.m */; }; + D0CD99031D75C0ED00F41187 /* MTDropResponseContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36218B164D600C65116 /* MTDropResponseContext.m */; }; + D0CD99041D75C0ED00F41187 /* MTApiEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36018B164D600C65116 /* MTApiEnvironment.m */; }; + D0CD99051D75C0ED00F41187 /* MTRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36418B164D600C65116 /* MTRequest.m */; }; + D0CD99061D75C0ED00F41187 /* MTRequestContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36618B164D600C65116 /* MTRequestContext.m */; }; + D0CD99071D75C0ED00F41187 /* MTRequestErrorContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 93DBD23018B2D72800631ADC /* MTRequestErrorContext.m */; }; + D0CD99081D75C0ED00F41187 /* MTDropResponseContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36218B164D600C65116 /* MTDropResponseContext.m */; }; + D0CD99091D75C0ED00F41187 /* MTApiEnvironment.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A36018B164D600C65116 /* MTApiEnvironment.m */; }; + D0CD990A1D75C0F300F41187 /* MTResendMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A37D18B164E600C65116 /* MTResendMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD990B1D75C0F400F41187 /* MTResendMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A37D18B164E600C65116 /* MTResendMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D0CD990C1D75C0F900F41187 /* MTResendMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A37E18B164E600C65116 /* MTResendMessageService.m */; }; + D0CD990D1D75C0F900F41187 /* MTResendMessageService.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A37E18B164E600C65116 /* MTResendMessageService.m */; }; + D0CD990E1D75C12C00F41187 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D00354711C173CD0006610DA /* libz.tbd */; }; D0D1A0361ADD983C007D9ED6 /* MTBadMsgNotificationMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0041ADD983C007D9ED6 /* MTBadMsgNotificationMessage.h */; }; D0D1A0371ADD983C007D9ED6 /* MTBadMsgNotificationMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D1A0051ADD983C007D9ED6 /* MTBadMsgNotificationMessage.m */; }; D0D1A0381ADD983C007D9ED6 /* MTBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1A0061ADD983C007D9ED6 /* MTBuffer.h */; }; @@ -170,7 +510,6 @@ D0D225101B4D817B0085E26D /* MtProtoKitDynamic.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D2250F1B4D817B0085E26D /* MtProtoKitDynamic.h */; settings = {ATTRIBUTES = (Public, ); }; }; D0D225161B4D817B0085E26D /* MtProtoKitDynamic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0D2250B1B4D817B0085E26D /* MtProtoKitDynamic.framework */; }; D0D2251D1B4D817B0085E26D /* MtProtoKitDynamicTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D0D2251C1B4D817B0085E26D /* MtProtoKitDynamicTests.m */; }; - D0E1D6741CBC20BA00B04029 /* SSignalKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0E1D6731CBC20BA00B04029 /* SSignalKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -200,81 +539,10 @@ D00354691C173BF0006610DA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D00354711C173CD0006610DA /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; D00354731C173CD9006610DA /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - D0254C2C18B103D4009452AA /* aes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aes.h; sourceTree = ""; }; - D0254C2D18B103D4009452AA /* asn1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asn1.h; sourceTree = ""; }; - D0254C2E18B103D4009452AA /* asn1_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asn1_mac.h; sourceTree = ""; }; - D0254C2F18B103D4009452AA /* asn1t.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asn1t.h; sourceTree = ""; }; - D0254C3018B103D4009452AA /* bio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bio.h; sourceTree = ""; }; - D0254C3118B103D4009452AA /* blowfish.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blowfish.h; sourceTree = ""; }; - D0254C3218B103D4009452AA /* bn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bn.h; sourceTree = ""; }; - D0254C3318B103D4009452AA /* buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = buffer.h; sourceTree = ""; }; - D0254C3418B103D4009452AA /* camellia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = camellia.h; sourceTree = ""; }; - D0254C3518B103D4009452AA /* cast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cast.h; sourceTree = ""; }; - D0254C3618B103D4009452AA /* cmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cmac.h; sourceTree = ""; }; - D0254C3718B103D4009452AA /* cms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cms.h; sourceTree = ""; }; - D0254C3818B103D4009452AA /* comp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = comp.h; sourceTree = ""; }; - D0254C3918B103D4009452AA /* conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conf.h; sourceTree = ""; }; - D0254C3A18B103D4009452AA /* conf_api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conf_api.h; sourceTree = ""; }; - D0254C3B18B103D4009452AA /* crypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypto.h; sourceTree = ""; }; - D0254C3C18B103D4009452AA /* des.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = des.h; sourceTree = ""; }; - D0254C3D18B103D4009452AA /* des_old.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = des_old.h; sourceTree = ""; }; - D0254C3E18B103D4009452AA /* dh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dh.h; sourceTree = ""; }; - D0254C3F18B103D4009452AA /* dsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsa.h; sourceTree = ""; }; - D0254C4018B103D4009452AA /* dso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dso.h; sourceTree = ""; }; - D0254C4118B103D4009452AA /* dtls1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dtls1.h; sourceTree = ""; }; - D0254C4218B103D4009452AA /* e_os2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = e_os2.h; sourceTree = ""; }; - D0254C4318B103D4009452AA /* ebcdic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ebcdic.h; sourceTree = ""; }; - D0254C4418B103D4009452AA /* ec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ec.h; sourceTree = ""; }; - D0254C4518B103D4009452AA /* ecdh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ecdh.h; sourceTree = ""; }; - D0254C4618B103D4009452AA /* ecdsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ecdsa.h; sourceTree = ""; }; - D0254C4718B103D4009452AA /* engine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = engine.h; sourceTree = ""; }; - D0254C4818B103D4009452AA /* err.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = err.h; sourceTree = ""; }; - D0254C4918B103D4009452AA /* evp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = evp.h; sourceTree = ""; }; - D0254C4A18B103D4009452AA /* hmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hmac.h; sourceTree = ""; }; - D0254C4B18B103D4009452AA /* idea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = idea.h; sourceTree = ""; }; - D0254C4C18B103D4009452AA /* krb5_asn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = krb5_asn.h; sourceTree = ""; }; - D0254C4D18B103D4009452AA /* kssl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kssl.h; sourceTree = ""; }; - D0254C4E18B103D4009452AA /* lhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lhash.h; sourceTree = ""; }; - D0254C4F18B103D4009452AA /* md4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md4.h; sourceTree = ""; }; - D0254C5018B103D4009452AA /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = ""; }; - D0254C5118B103D4009452AA /* mdc2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mdc2.h; sourceTree = ""; }; - D0254C5218B103D4009452AA /* modes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = modes.h; sourceTree = ""; }; - D0254C5318B103D4009452AA /* obj_mac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = obj_mac.h; sourceTree = ""; }; - D0254C5418B103D4009452AA /* objects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objects.h; sourceTree = ""; }; - D0254C5518B103D4009452AA /* ocsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ocsp.h; sourceTree = ""; }; - D0254C5618B103D4009452AA /* opensslconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opensslconf.h; sourceTree = ""; }; - D0254C5718B103D4009452AA /* opensslv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = opensslv.h; sourceTree = ""; }; - D0254C5818B103D4009452AA /* ossl_typ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ossl_typ.h; sourceTree = ""; }; - D0254C5918B103D4009452AA /* pem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pem.h; sourceTree = ""; }; - D0254C5A18B103D4009452AA /* pem2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pem2.h; sourceTree = ""; }; - D0254C5B18B103D4009452AA /* pkcs12.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pkcs12.h; sourceTree = ""; }; - D0254C5C18B103D4009452AA /* pkcs7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pkcs7.h; sourceTree = ""; }; - D0254C5D18B103D4009452AA /* pqueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pqueue.h; sourceTree = ""; }; - D0254C5E18B103D4009452AA /* rand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rand.h; sourceTree = ""; }; - D0254C5F18B103D4009452AA /* rc2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rc2.h; sourceTree = ""; }; - D0254C6018B103D4009452AA /* rc4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rc4.h; sourceTree = ""; }; - D0254C6118B103D4009452AA /* ripemd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ripemd.h; sourceTree = ""; }; - D0254C6218B103D4009452AA /* rsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rsa.h; sourceTree = ""; }; - D0254C6318B103D4009452AA /* safestack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = safestack.h; sourceTree = ""; }; - D0254C6418B103D4009452AA /* seed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = seed.h; sourceTree = ""; }; - D0254C6518B103D4009452AA /* sha.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha.h; sourceTree = ""; }; - D0254C6618B103D4009452AA /* srp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srp.h; sourceTree = ""; }; - D0254C6718B103D4009452AA /* srtp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srtp.h; sourceTree = ""; }; - D0254C6818B103D4009452AA /* ssl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ssl.h; sourceTree = ""; }; - D0254C6918B103D4009452AA /* ssl2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ssl2.h; sourceTree = ""; }; - D0254C6A18B103D4009452AA /* ssl23.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ssl23.h; sourceTree = ""; }; - D0254C6B18B103D4009452AA /* ssl3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ssl3.h; sourceTree = ""; }; - D0254C6C18B103D4009452AA /* stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stack.h; sourceTree = ""; }; - D0254C6D18B103D4009452AA /* symhacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = symhacks.h; sourceTree = ""; }; - D0254C6E18B103D4009452AA /* tls1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tls1.h; sourceTree = ""; }; - D0254C6F18B103D4009452AA /* ts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ts.h; sourceTree = ""; }; - D0254C7018B103D4009452AA /* txt_db.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = txt_db.h; sourceTree = ""; }; - D0254C7118B103D4009452AA /* ui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ui.h; sourceTree = ""; }; - D0254C7218B103D4009452AA /* ui_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ui_compat.h; sourceTree = ""; }; - D0254C7318B103D4009452AA /* whrlpool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = whrlpool.h; sourceTree = ""; }; - D0254C7418B103D4009452AA /* x509.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509.h; sourceTree = ""; }; - D0254C7518B103D4009452AA /* x509_vfy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509_vfy.h; sourceTree = ""; }; - D0254C7618B103D4009452AA /* x509v3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x509v3.h; sourceTree = ""; }; + D010DB7B1D70ABEE0012AD96 /* MTRsa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRsa.h; sourceTree = ""; }; + D010DB7C1D70ABEE0012AD96 /* MTRsa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRsa.m; sourceTree = ""; }; + D010DB7F1D70B3B90012AD96 /* MTAes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTAes.h; sourceTree = ""; }; + D010DB801D70B3B90012AD96 /* MTAes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTAes.m; sourceTree = ""; }; D0254CC518B10404009452AA /* MTEncryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTEncryption.h; path = MTProtoKit/MTEncryption.h; sourceTree = ""; }; D0503AD818B027F80074C3FE /* MTOutputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTOutputStream.h; path = MTProtoKit/MTOutputStream.h; sourceTree = ""; }; D0503AD918B027F80074C3FE /* MTOutputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MTOutputStream.m; path = MTProtoKit/MTOutputStream.m; sourceTree = ""; }; @@ -336,7 +604,6 @@ D05A84F818AFF259007F1076 /* GCDAsyncSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GCDAsyncSocket.m; sourceTree = ""; }; D05A851718AFF2F8007F1076 /* AFJSONUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFJSONUtilities.h; sourceTree = ""; }; D05A851818AFF2F8007F1076 /* AFJSONUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFJSONUtilities.m; sourceTree = ""; }; - D063A2F718B14A9400C65116 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; D063A2F918B14AB500C65116 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libcrypto.dylib; sourceTree = DEVELOPER_DIR; }; D063A31518B157F700C65116 /* MtProtoKit-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "MtProtoKit-Prefix.pch"; path = "MtProtoKitiOS/MtProtoKit-Prefix.pch"; sourceTree = SOURCE_ROOT; }; D063A31818B157F700C65116 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; @@ -400,12 +667,24 @@ D079ABA81AF39B8000076F59 /* MtProtoKitMacTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MtProtoKitMacTests.m; sourceTree = ""; }; D09A59561B582EFF00FC3724 /* MTFileBasedKeychain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTFileBasedKeychain.h; path = MTProtoKit/MTFileBasedKeychain.h; sourceTree = ""; }; D09A59571B582EFF00FC3724 /* MTFileBasedKeychain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MTFileBasedKeychain.m; path = MTProtoKit/MTFileBasedKeychain.m; sourceTree = ""; }; - D0A44E4D18B24A6000B64FC6 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcrypto.a; sourceTree = ""; }; + D0CAF2C91D75E24C0011F558 /* MTSignal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTSignal.h; sourceTree = ""; }; + D0CAF2CA1D75E24C0011F558 /* MTSignal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTSignal.m; sourceTree = ""; }; + D0CAF2D11D75E26D0011F558 /* MTSubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTSubscriber.h; sourceTree = ""; }; + D0CAF2D21D75E26D0011F558 /* MTSubscriber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTSubscriber.m; sourceTree = ""; }; + D0CAF2D51D75E2840011F558 /* MTDisposable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTDisposable.h; sourceTree = ""; }; + D0CAF2D61D75E2840011F558 /* MTDisposable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTDisposable.m; sourceTree = ""; }; + D0CAF2E11D75E7F30011F558 /* MTAtomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTAtomic.h; sourceTree = ""; }; + D0CAF2E21D75E7F30011F558 /* MTAtomic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTAtomic.m; sourceTree = ""; }; + D0CAF2EB1D75F4520011F558 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + D0CAF2EE1D75F4E20011F558 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + D0CAF2F01D75F4EA0011F558 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; D0CB05F71ADC4483005E298F /* MtProtoKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MtProtoKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D0CB05FA1ADC4483005E298F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D0CB05FB1ADC4483005E298F /* MtProtoKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MtProtoKit.h; sourceTree = ""; }; D0CB06071ADC4483005E298F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; D0CB06081ADC4483005E298F /* MtProtoKitTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MtProtoKitTests.m; sourceTree = ""; }; + D0CD98E61D75BFAE00F41187 /* SSignalKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SSignalKit.framework; path = "../SSignalKit/build/Debug-iphoneos/SSignalKit.framework"; sourceTree = ""; }; + D0CD990F1D75C16100F41187 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = openssl/iOS/libcrypto.a; sourceTree = ""; }; D0D1A0041ADD983C007D9ED6 /* MTBadMsgNotificationMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTBadMsgNotificationMessage.h; path = MTProtoKit/MTBadMsgNotificationMessage.h; sourceTree = ""; }; D0D1A0051ADD983C007D9ED6 /* MTBadMsgNotificationMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MTBadMsgNotificationMessage.m; path = MTProtoKit/MTBadMsgNotificationMessage.m; sourceTree = ""; }; D0D1A0061ADD983C007D9ED6 /* MTBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTBuffer.h; path = MTProtoKit/MTBuffer.h; sourceTree = ""; }; @@ -491,8 +770,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D0E1D6741CBC20BA00B04029 /* SSignalKit.framework in Frameworks */, - D0CB066B1ADC48C4005E298F /* libcrypto.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -500,6 +777,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + D0CAF2FD1D7628FD0011F558 /* libcrypto.a in Frameworks */, + D0CAF2F11D75F4EA0011F558 /* CFNetwork.framework in Frameworks */, + D0CAF2EF1D75F4E20011F558 /* UIKit.framework in Frameworks */, + D0CAF2ED1D75F4570011F558 /* SystemConfiguration.framework in Frameworks */, + D0CAF2EC1D75F4520011F558 /* Security.framework in Frameworks */, + D0CD990E1D75C12C00F41187 /* libz.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -534,98 +817,6 @@ path = MtProtoKitStabilityTests; sourceTree = ""; }; - D0254C2918B103D4009452AA /* openssl */ = { - isa = PBXGroup; - children = ( - D0A44E4C18B24A6000B64FC6 /* OSX */, - D063A2F618B14A9400C65116 /* iOS */, - D0254C2B18B103D4009452AA /* openssl */, - ); - path = openssl; - sourceTree = ""; - }; - D0254C2B18B103D4009452AA /* openssl */ = { - isa = PBXGroup; - children = ( - D0254C2C18B103D4009452AA /* aes.h */, - D0254C2D18B103D4009452AA /* asn1.h */, - D0254C2E18B103D4009452AA /* asn1_mac.h */, - D0254C2F18B103D4009452AA /* asn1t.h */, - D0254C3018B103D4009452AA /* bio.h */, - D0254C3118B103D4009452AA /* blowfish.h */, - D0254C3218B103D4009452AA /* bn.h */, - D0254C3318B103D4009452AA /* buffer.h */, - D0254C3418B103D4009452AA /* camellia.h */, - D0254C3518B103D4009452AA /* cast.h */, - D0254C3618B103D4009452AA /* cmac.h */, - D0254C3718B103D4009452AA /* cms.h */, - D0254C3818B103D4009452AA /* comp.h */, - D0254C3918B103D4009452AA /* conf.h */, - D0254C3A18B103D4009452AA /* conf_api.h */, - D0254C3B18B103D4009452AA /* crypto.h */, - D0254C3C18B103D4009452AA /* des.h */, - D0254C3D18B103D4009452AA /* des_old.h */, - D0254C3E18B103D4009452AA /* dh.h */, - D0254C3F18B103D4009452AA /* dsa.h */, - D0254C4018B103D4009452AA /* dso.h */, - D0254C4118B103D4009452AA /* dtls1.h */, - D0254C4218B103D4009452AA /* e_os2.h */, - D0254C4318B103D4009452AA /* ebcdic.h */, - D0254C4418B103D4009452AA /* ec.h */, - D0254C4518B103D4009452AA /* ecdh.h */, - D0254C4618B103D4009452AA /* ecdsa.h */, - D0254C4718B103D4009452AA /* engine.h */, - D0254C4818B103D4009452AA /* err.h */, - D0254C4918B103D4009452AA /* evp.h */, - D0254C4A18B103D4009452AA /* hmac.h */, - D0254C4B18B103D4009452AA /* idea.h */, - D0254C4C18B103D4009452AA /* krb5_asn.h */, - D0254C4D18B103D4009452AA /* kssl.h */, - D0254C4E18B103D4009452AA /* lhash.h */, - D0254C4F18B103D4009452AA /* md4.h */, - D0254C5018B103D4009452AA /* md5.h */, - D0254C5118B103D4009452AA /* mdc2.h */, - D0254C5218B103D4009452AA /* modes.h */, - D0254C5318B103D4009452AA /* obj_mac.h */, - D0254C5418B103D4009452AA /* objects.h */, - D0254C5518B103D4009452AA /* ocsp.h */, - D0254C5618B103D4009452AA /* opensslconf.h */, - D0254C5718B103D4009452AA /* opensslv.h */, - D0254C5818B103D4009452AA /* ossl_typ.h */, - D0254C5918B103D4009452AA /* pem.h */, - D0254C5A18B103D4009452AA /* pem2.h */, - D0254C5B18B103D4009452AA /* pkcs12.h */, - D0254C5C18B103D4009452AA /* pkcs7.h */, - D0254C5D18B103D4009452AA /* pqueue.h */, - D0254C5E18B103D4009452AA /* rand.h */, - D0254C5F18B103D4009452AA /* rc2.h */, - D0254C6018B103D4009452AA /* rc4.h */, - D0254C6118B103D4009452AA /* ripemd.h */, - D0254C6218B103D4009452AA /* rsa.h */, - D0254C6318B103D4009452AA /* safestack.h */, - D0254C6418B103D4009452AA /* seed.h */, - D0254C6518B103D4009452AA /* sha.h */, - D0254C6618B103D4009452AA /* srp.h */, - D0254C6718B103D4009452AA /* srtp.h */, - D0254C6818B103D4009452AA /* ssl.h */, - D0254C6918B103D4009452AA /* ssl2.h */, - D0254C6A18B103D4009452AA /* ssl23.h */, - D0254C6B18B103D4009452AA /* ssl3.h */, - D0254C6C18B103D4009452AA /* stack.h */, - D0254C6D18B103D4009452AA /* symhacks.h */, - D0254C6E18B103D4009452AA /* tls1.h */, - D0254C6F18B103D4009452AA /* ts.h */, - D0254C7018B103D4009452AA /* txt_db.h */, - D0254C7118B103D4009452AA /* ui.h */, - D0254C7218B103D4009452AA /* ui_compat.h */, - D0254C7318B103D4009452AA /* whrlpool.h */, - D0254C7418B103D4009452AA /* x509.h */, - D0254C7518B103D4009452AA /* x509_vfy.h */, - D0254C7618B103D4009452AA /* x509v3.h */, - ); - path = openssl; - sourceTree = ""; - }; D05A830918AFB3F9007F1076 = { isa = PBXGroup; children = ( @@ -661,6 +852,11 @@ D05A831618AFB3F9007F1076 /* Frameworks */ = { isa = PBXGroup; children = ( + D0CAF2F01D75F4EA0011F558 /* CFNetwork.framework */, + D0CAF2EE1D75F4E20011F558 /* UIKit.framework */, + D0CAF2EB1D75F4520011F558 /* Security.framework */, + D0CD990F1D75C16100F41187 /* libcrypto.a */, + D0CD98E61D75BFAE00F41187 /* SSignalKit.framework */, D0E1D6731CBC20BA00B04029 /* SSignalKit.framework */, D00354731C173CD9006610DA /* SystemConfiguration.framework */, D00354711C173CD0006610DA /* libz.tbd */, @@ -745,6 +941,7 @@ D05A842B18AFB770007F1076 /* Utils */ = { isa = PBXGroup; children = ( + D0CD99111D75C5D100F41187 /* Signals */, 93DBD23318B2D9AA00631ADC /* MTTime.h */, 93DBD23418B2DA1E00631ADC /* MTTime.m */, D05A84D918AFE81D007F1076 /* MTTimer.h */, @@ -760,6 +957,10 @@ D0503AD918B027F80074C3FE /* MTOutputStream.m */, D0503ADC18B029480074C3FE /* MTInputStream.h */, D0503ADD18B029480074C3FE /* MTInputStream.m */, + D010DB7B1D70ABEE0012AD96 /* MTRsa.h */, + D010DB7C1D70ABEE0012AD96 /* MTRsa.m */, + D010DB7F1D70B3B90012AD96 /* MTAes.h */, + D010DB801D70B3B90012AD96 /* MTAes.m */, ); name = Utils; sourceTree = ""; @@ -966,7 +1167,6 @@ D05A84E718AFF0EE007F1076 /* Third Party */ = { isa = PBXGroup; children = ( - D0254C2918B103D4009452AA /* openssl */, D05A84E818AFF259007F1076 /* AFNetworking */, D05A84F618AFF259007F1076 /* AsyncSocket */, ); @@ -1000,14 +1200,6 @@ path = thirdparty/AsyncSocket; sourceTree = ""; }; - D063A2F618B14A9400C65116 /* iOS */ = { - isa = PBXGroup; - children = ( - D063A2F718B14A9400C65116 /* libcrypto.a */, - ); - path = iOS; - sourceTree = ""; - }; D063A31618B157F700C65116 /* en.lproj */ = { isa = PBXGroup; children = ( @@ -1051,14 +1243,6 @@ name = "Supporting Files"; sourceTree = ""; }; - D0A44E4C18B24A6000B64FC6 /* OSX */ = { - isa = PBXGroup; - children = ( - D0A44E4D18B24A6000B64FC6 /* libcrypto.a */, - ); - path = OSX; - sourceTree = ""; - }; D0CB05F81ADC4483005E298F /* MtProtoKit */ = { isa = PBXGroup; children = ( @@ -1093,6 +1277,21 @@ name = "Supporting Files"; sourceTree = ""; }; + D0CD99111D75C5D100F41187 /* Signals */ = { + isa = PBXGroup; + children = ( + D0CAF2E11D75E7F30011F558 /* MTAtomic.h */, + D0CAF2E21D75E7F30011F558 /* MTAtomic.m */, + D0CAF2D51D75E2840011F558 /* MTDisposable.h */, + D0CAF2D61D75E2840011F558 /* MTDisposable.m */, + D0CAF2D11D75E26D0011F558 /* MTSubscriber.h */, + D0CAF2D21D75E26D0011F558 /* MTSubscriber.m */, + D0CAF2C91D75E24C0011F558 /* MTSignal.h */, + D0CAF2CA1D75E24C0011F558 /* MTSignal.m */, + ); + name = Signals; + sourceTree = ""; + }; D0D1A0681ADD9844007D9ED6 /* Messages */ = { isa = PBXGroup; children = ( @@ -1191,8 +1390,87 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + D0CD97FD1D74B96300F41187 /* MTBuffer.h in Headers */, + D0CD98D61D74BAAA00F41187 /* MTHttpWorkerBehaviour.h in Headers */, + D0CD98131D74B99400F41187 /* MTInternalMessageParser.h in Headers */, + D0CD98EE1D75C0C900F41187 /* MTTimeSyncMessageService.h in Headers */, + D0CD989F1D74BA6500F41187 /* MTProto.h in Headers */, + D0CD98F21D75C0D700F41187 /* MTRequestMessageService.h in Headers */, + D0CD97D21D74B91400F41187 /* MTTime.h in Headers */, + D0CD98151D74B99400F41187 /* MTMsgAllInfoMessage.h in Headers */, + D0CD98A31D74BA6500F41187 /* MTOutgoingMessage.h in Headers */, + D0CD97F81D74B94B00F41187 /* MTRsa.h in Headers */, + D0CD98C01D74BA8200F41187 /* MTTcpTransport.h in Headers */, + D0CD98CA1D74BA9400F41187 /* MTTcpConnectionBehaviour.h in Headers */, + D0CD981F1D74B99400F41187 /* MTResPqMessage.h in Headers */, + D0CD98E81D75C0BB00F41187 /* MTMessageService.h in Headers */, + D0CD98681D74B9E200F41187 /* MTContext.h in Headers */, + D0CD985B1D74B9BF00F41187 /* MTSetClientDhParamsResponseMessage.h in Headers */, + D0CD98741D74BA0100F41187 /* MTDiscoverDatacenterAddressAction.h in Headers */, + D0CD98EA1D75C0C100F41187 /* MTMessageTransaction.h in Headers */, + D0CD98B41D74BA7500F41187 /* MTNetworkAvailability.h in Headers */, + D0CD98A21D74BA6500F41187 /* MTPreparedMessage.h in Headers */, + D0CD98F91D75C0E400F41187 /* MTDropResponseContext.h in Headers */, + D0CD986C1D74B9EF00F41187 /* MTTransportScheme.h in Headers */, + D0CD984D1D74B9AE00F41187 /* MTRpcError.h in Headers */, + D0CD98171D74B99400F41187 /* MTMsgDetailedInfoMessage.h in Headers */, + D0CD98A41D74BA6500F41187 /* MTIncomingMessage.h in Headers */, + D0CD97FC1D74B96300F41187 /* MTBadMsgNotificationMessage.h in Headers */, + D0CD98121D74B99400F41187 /* MTFutureSaltsMessage.h in Headers */, + D0CD985A1D74B9BF00F41187 /* MTServerDhParamsMessage.h in Headers */, + D0CAF2E51D75EA790011F558 /* MTAtomic.h in Headers */, + D0CD98A11D74BA6500F41187 /* MTTimeFixContext.h in Headers */, + D0CD97FE1D74B96300F41187 /* MTBufferReader.h in Headers */, + D0CD97FF1D74B96300F41187 /* MTDestroySessionResponseMessage.h in Headers */, + D0CD97FA1D74B95000F41187 /* MTSerialization.h in Headers */, + D0CD98641D74B9D700F41187 /* MTFileBasedKeychain.h in Headers */, + D0CD98A01D74BA6500F41187 /* MTSessionInfo.h in Headers */, + D0CD97D61D74B91E00F41187 /* MTTimer.h in Headers */, + D0CD98F81D75C0E400F41187 /* MTRequestErrorContext.h in Headers */, + D0CD98A51D74BA6500F41187 /* MTMessageEncryptionKey.h in Headers */, + D0CD981D1D74B99400F41187 /* MTPingMessage.h in Headers */, + D0CD97F91D74B94B00F41187 /* MTAes.h in Headers */, + D0CD98581D74B9BF00F41187 /* MTRpcResultMessage.h in Headers */, D079AB9C1AF39B8000076F59 /* MtProtoKitMac.h in Headers */, - D079ABB01AF39BA400076F59 /* MTProtoKit.h in Headers */, + D0CD98161D74B99400F41187 /* MTMsgContainerMessage.h in Headers */, + D0CD981A1D74B99400F41187 /* MTMsgsStateInfoMessage.h in Headers */, + D0CD98191D74B99400F41187 /* MTMsgsAckMessage.h in Headers */, + D0CD98FA1D75C0E400F41187 /* MTApiEnvironment.h in Headers */, + D0CD98881D74BA5100F41187 /* MTDatacenterAddressListData.h in Headers */, + D0CD98591D74B9BF00F41187 /* MTServerDhInnerDataMessage.h in Headers */, + D0CD98601D74B9D000F41187 /* MTKeychain.h in Headers */, + D0CD98181D74B99400F41187 /* MTMsgResendReqMessage.h in Headers */, + D0CD97E81D74B94300F41187 /* MTLogging.h in Headers */, + D0CD98F61D75C0E400F41187 /* MTRequest.h in Headers */, + D0CAF2D91D75E3160011F558 /* MTSubscriber.h in Headers */, + D0CD98D21D74BAA400F41187 /* MTHttpWorker.h in Headers */, + D0CD981B1D74B99400F41187 /* MTMsgsStateReqMessage.h in Headers */, + D0CD98101D74B96F00F41187 /* MTExportedAuthorizationData.h in Headers */, + D0CD98F71D75C0E400F41187 /* MTRequestContext.h in Headers */, + D0CD98871D74BA5100F41187 /* MTDatacenterSaltInfo.h in Headers */, + D0CD98CE1D74BA9B00F41187 /* MTHttpTransport.h in Headers */, + D0CD97ED1D74B94300F41187 /* MTInputStream.h in Headers */, + D0CD98141D74B99400F41187 /* MTMessage.h in Headers */, + D0CD987A1D74BA4100F41187 /* MTDatacenterAuthMessageService.h in Headers */, + D0CD98861D74BA5100F41187 /* MTDatacenterAuthInfo.h in Headers */, + D0CD98B51D74BA7500F41187 /* MTTransport.h in Headers */, + D0CD97EC1D74B94300F41187 /* MTOutputStream.h in Headers */, + D0CD98701D74B9F700F41187 /* MTDiscoverConnectionSignals.h in Headers */, + D0CD97E91D74B94300F41187 /* MTEncryption.h in Headers */, + D0CD97EB1D74B94300F41187 /* MTQueue.h in Headers */, + D0CD98001D74B96300F41187 /* MTDropRpcResultMessage.h in Headers */, + D0CD98791D74BA4100F41187 /* MTDatacenterAuthAction.h in Headers */, + D0CD981C1D74B99400F41187 /* MTNewSessionCreatedMessage.h in Headers */, + D0CD98781D74BA4100F41187 /* MTDatacenterTransferAuthAction.h in Headers */, + D0CD990A1D75C0F300F41187 /* MTResendMessageService.h in Headers */, + D0CD98841D74BA5100F41187 /* MTDatacenterAddress.h in Headers */, + D0CD97EA1D74B94300F41187 /* MTInternalId.h in Headers */, + D0CAF2DB1D75E31A0011F558 /* MTDisposable.h in Headers */, + D0CD98851D74BA5100F41187 /* MTDatacenterAddressSet.h in Headers */, + D0CD98B61D74BA7500F41187 /* MTTransportTransaction.h in Headers */, + D0CD981E1D74B99400F41187 /* MTPongMessage.h in Headers */, + D0CD98C51D74BA8D00F41187 /* MTTcpConnection.h in Headers */, + D0CAF2CD1D75E2570011F558 /* MTSignal.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1202,6 +1480,7 @@ files = ( D0D1A0381ADD983C007D9ED6 /* MTBuffer.h in Headers */, D0CB06181ADC4541005E298F /* MTTime.h in Headers */, + D0CAF2E31D75E7F30011F558 /* MTAtomic.h in Headers */, D0D1A0581ADD983C007D9ED6 /* MTPingMessage.h in Headers */, D0CB064E1ADC45B1005E298F /* MTDropResponseContext.h in Headers */, D0D1A06B1ADD987A007D9ED6 /* MTDatacenterAddressListData.h in Headers */, @@ -1209,12 +1488,14 @@ D0D1A03A1ADD983C007D9ED6 /* MTBufferReader.h in Headers */, D0CB065C1ADC45CE005E298F /* MTTcpConnection.h in Headers */, D0D1A0501ADD983C007D9ED6 /* MTMsgsAckMessage.h in Headers */, + D0CAF2CB1D75E24C0011F558 /* MTSignal.h in Headers */, D0CB06461ADC45A2005E298F /* MTMessageService.h in Headers */, D0D1A0601ADD983C007D9ED6 /* MTRpcResultMessage.h in Headers */, D0D1A0461ADD983C007D9ED6 /* MTMessage.h in Headers */, D0D1A0441ADD983C007D9ED6 /* MTInternalMessageParser.h in Headers */, D0D1A05A1ADD983C007D9ED6 /* MTPongMessage.h in Headers */, D0D1A0481ADD983C007D9ED6 /* MTMsgAllInfoMessage.h in Headers */, + D0CAF2D71D75E2840011F558 /* MTDisposable.h in Headers */, D0CB062A1ADC4575005E298F /* MTDatacenterTransferAuthAction.h in Headers */, D0CB064F1ADC45B1005E298F /* MTApiEnvironment.h in Headers */, D0CB06191ADC4541005E298F /* MTTimer.h in Headers */, @@ -1240,11 +1521,13 @@ D0CB064A1ADC45B1005E298F /* MTRequestMessageService.h in Headers */, D0D1A0561ADD983C007D9ED6 /* MTNewSessionCreatedMessage.h in Headers */, D0CB061A1ADC4541005E298F /* MTLogging.h in Headers */, + D0CAF2D31D75E26D0011F558 /* MTSubscriber.h in Headers */, D0CB065A1ADC45CE005E298F /* MTTransportTransaction.h in Headers */, D0CB06281ADC456A005E298F /* MTDiscoverDatacenterAddressAction.h in Headers */, D0CB06591ADC45CE005E298F /* MTTransport.h in Headers */, D0CB061F1ADC4541005E298F /* MTInputStream.h in Headers */, D0CB063D1ADC4591005E298F /* MTIncomingMessage.h in Headers */, + D010DB7D1D70ABEE0012AD96 /* MTRsa.h in Headers */, D0CB06251ADC4562005E298F /* MTTransportScheme.h in Headers */, D0D1A05C1ADD983C007D9ED6 /* MTResPqMessage.h in Headers */, D0D1A03E1ADD983C007D9ED6 /* MTDropRpcResultMessage.h in Headers */, @@ -1274,6 +1557,7 @@ D0D1A0521ADD983C007D9ED6 /* MTMsgsStateInfoMessage.h in Headers */, D0D1A0421ADD983C007D9ED6 /* MTFutureSaltsMessage.h in Headers */, D0CB064B1ADC45B1005E298F /* MTRequest.h in Headers */, + D010DB811D70B3B90012AD96 /* MTAes.h in Headers */, D0CB062C1ADC4575005E298F /* MTDatacenterAuthMessageService.h in Headers */, D0CB061C1ADC4541005E298F /* MTInternalId.h in Headers */, ); @@ -1283,7 +1567,87 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + D0CD98021D74B96400F41187 /* MTBuffer.h in Headers */, + D0CD98D71D74BAAA00F41187 /* MTHttpWorkerBehaviour.h in Headers */, + D0CD98211D74B99500F41187 /* MTInternalMessageParser.h in Headers */, + D0CD98EF1D75C0CA00F41187 /* MTTimeSyncMessageService.h in Headers */, + D0CD98981D74BA6500F41187 /* MTProto.h in Headers */, + D0CD98F31D75C0D700F41187 /* MTRequestMessageService.h in Headers */, + D0CD97D31D74B91700F41187 /* MTTime.h in Headers */, + D0CD98231D74B99500F41187 /* MTMsgAllInfoMessage.h in Headers */, + D0CD989C1D74BA6500F41187 /* MTOutgoingMessage.h in Headers */, + D0CD97F61D74B94B00F41187 /* MTRsa.h in Headers */, + D0CD98C11D74BA8300F41187 /* MTTcpTransport.h in Headers */, + D0CD98CB1D74BA9500F41187 /* MTTcpConnectionBehaviour.h in Headers */, + D0CD982D1D74B99500F41187 /* MTResPqMessage.h in Headers */, + D0CD98E91D75C0BB00F41187 /* MTMessageService.h in Headers */, + D0CD98691D74B9E300F41187 /* MTContext.h in Headers */, + D0CD985F1D74B9BF00F41187 /* MTSetClientDhParamsResponseMessage.h in Headers */, + D0CD98751D74BA0100F41187 /* MTDiscoverDatacenterAddressAction.h in Headers */, + D0CD98EB1D75C0C100F41187 /* MTMessageTransaction.h in Headers */, + D0CD98B71D74BA7500F41187 /* MTNetworkAvailability.h in Headers */, + D0CD989B1D74BA6500F41187 /* MTPreparedMessage.h in Headers */, + D0CD98FE1D75C0E500F41187 /* MTDropResponseContext.h in Headers */, + D0CD986D1D74B9F000F41187 /* MTTransportScheme.h in Headers */, + D0CD984C1D74B9AD00F41187 /* MTRpcError.h in Headers */, + D0CD98251D74B99500F41187 /* MTMsgDetailedInfoMessage.h in Headers */, + D0CD989D1D74BA6500F41187 /* MTIncomingMessage.h in Headers */, + D0CD98011D74B96400F41187 /* MTBadMsgNotificationMessage.h in Headers */, + D0CD98201D74B99500F41187 /* MTFutureSaltsMessage.h in Headers */, + D0CD985E1D74B9BF00F41187 /* MTServerDhParamsMessage.h in Headers */, + D0CAF2E61D75EA7A0011F558 /* MTAtomic.h in Headers */, + D0CD989A1D74BA6500F41187 /* MTTimeFixContext.h in Headers */, + D0CD98031D74B96400F41187 /* MTBufferReader.h in Headers */, + D0CD98041D74B96400F41187 /* MTDestroySessionResponseMessage.h in Headers */, + D0CD97FB1D74B95100F41187 /* MTSerialization.h in Headers */, + D0CD98651D74B9D800F41187 /* MTFileBasedKeychain.h in Headers */, + D0CD98991D74BA6500F41187 /* MTSessionInfo.h in Headers */, + D0CD97D71D74B92000F41187 /* MTTimer.h in Headers */, + D0CD98FD1D75C0E500F41187 /* MTRequestErrorContext.h in Headers */, + D0CD989E1D74BA6500F41187 /* MTMessageEncryptionKey.h in Headers */, + D0CD982B1D74B99500F41187 /* MTPingMessage.h in Headers */, + D0CD97F71D74B94B00F41187 /* MTAes.h in Headers */, + D0CD985C1D74B9BF00F41187 /* MTRpcResultMessage.h in Headers */, D0D225101B4D817B0085E26D /* MtProtoKitDynamic.h in Headers */, + D0CD98241D74B99500F41187 /* MTMsgContainerMessage.h in Headers */, + D0CD98281D74B99500F41187 /* MTMsgsStateInfoMessage.h in Headers */, + D0CD98271D74B99500F41187 /* MTMsgsAckMessage.h in Headers */, + D0CD98FF1D75C0E500F41187 /* MTApiEnvironment.h in Headers */, + D0CD988D1D74BA5200F41187 /* MTDatacenterAddressListData.h in Headers */, + D0CD985D1D74B9BF00F41187 /* MTServerDhInnerDataMessage.h in Headers */, + D0CD98611D74B9D000F41187 /* MTKeychain.h in Headers */, + D0CD98261D74B99500F41187 /* MTMsgResendReqMessage.h in Headers */, + D0CD97EE1D74B94300F41187 /* MTLogging.h in Headers */, + D0CD98FB1D75C0E500F41187 /* MTRequest.h in Headers */, + D0CAF2DA1D75E3160011F558 /* MTSubscriber.h in Headers */, + D0CD98D31D74BAA500F41187 /* MTHttpWorker.h in Headers */, + D0CD98291D74B99500F41187 /* MTMsgsStateReqMessage.h in Headers */, + D0CD98111D74B97000F41187 /* MTExportedAuthorizationData.h in Headers */, + D0CD98FC1D75C0E500F41187 /* MTRequestContext.h in Headers */, + D0CD988C1D74BA5200F41187 /* MTDatacenterSaltInfo.h in Headers */, + D0CD98CF1D74BA9B00F41187 /* MTHttpTransport.h in Headers */, + D0CD97F31D74B94300F41187 /* MTInputStream.h in Headers */, + D0CD98221D74B99500F41187 /* MTMessage.h in Headers */, + D0CD987D1D74BA4100F41187 /* MTDatacenterAuthMessageService.h in Headers */, + D0CD988B1D74BA5200F41187 /* MTDatacenterAuthInfo.h in Headers */, + D0CD98B81D74BA7500F41187 /* MTTransport.h in Headers */, + D0CD97F21D74B94300F41187 /* MTOutputStream.h in Headers */, + D0CD98711D74B9F700F41187 /* MTDiscoverConnectionSignals.h in Headers */, + D0CD97EF1D74B94300F41187 /* MTEncryption.h in Headers */, + D0CD97F11D74B94300F41187 /* MTQueue.h in Headers */, + D0CD98051D74B96400F41187 /* MTDropRpcResultMessage.h in Headers */, + D0CD987C1D74BA4100F41187 /* MTDatacenterAuthAction.h in Headers */, + D0CD982A1D74B99500F41187 /* MTNewSessionCreatedMessage.h in Headers */, + D0CD987B1D74BA4100F41187 /* MTDatacenterTransferAuthAction.h in Headers */, + D0CD990B1D75C0F400F41187 /* MTResendMessageService.h in Headers */, + D0CD98891D74BA5200F41187 /* MTDatacenterAddress.h in Headers */, + D0CD97F01D74B94300F41187 /* MTInternalId.h in Headers */, + D0CAF2DC1D75E31B0011F558 /* MTDisposable.h in Headers */, + D0CD988A1D74BA5200F41187 /* MTDatacenterAddressSet.h in Headers */, + D0CD98B91D74BA7500F41187 /* MTTransportTransaction.h in Headers */, + D0CD982C1D74B99500F41187 /* MTPongMessage.h in Headers */, + D0CD98C61D74BA8D00F41187 /* MTTcpConnection.h in Headers */, + D0CAF2CE1D75E2580011F558 /* MTSignal.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1386,7 +1750,7 @@ D05A830A18AFB3F9007F1076 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0510; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = Telegram; TargetAttributes = { D00354641C173BF0006610DA = { @@ -1397,9 +1761,13 @@ }; D0CB05F61ADC4483005E298F = { CreatedOnToolsVersion = 6.3; + LastSwiftMigration = 0800; + ProvisioningStyle = Manual; }; D0D2250A1B4D817B0085E26D = { CreatedOnToolsVersion = 6.4; + DevelopmentTeam = X834Q8SBVP; + ProvisioningStyle = Manual; }; D0D225141B4D817B0085E26D = { CreatedOnToolsVersion = 6.4; @@ -1478,6 +1846,88 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D0CD98DC1D74BAEA00F41187 /* AFJSONUtilities.m in Sources */, + D0CD99021D75C0ED00F41187 /* MTRequestErrorContext.m in Sources */, + D0CD98371D74B9AA00F41187 /* MTMsgsStateInfoMessage.m in Sources */, + D0CD99011D75C0ED00F41187 /* MTRequestContext.m in Sources */, + D0CAF2DE1D75E31E0011F558 /* MTSubscriber.m in Sources */, + D0CD984E1D74B9B700F41187 /* MTRpcError.m in Sources */, + D0CD98361D74B9AA00F41187 /* MTMsgsAckMessage.m in Sources */, + D0CD97E71D74B93300F41187 /* MTAes.m in Sources */, + D0CD98EC1D75C0C500F41187 /* MTMessageTransaction.m in Sources */, + D0CD98C71D74BA9000F41187 /* MTTcpConnection.m in Sources */, + D0CD98621D74B9D500F41187 /* MTKeychain.m in Sources */, + D0CD987F1D74BA4900F41187 /* MTDatacenterAuthAction.m in Sources */, + D0CD98911D74BA5900F41187 /* MTDatacenterSaltInfo.m in Sources */, + D0CD98761D74BA0700F41187 /* MTDiscoverDatacenterAddressAction.m in Sources */, + D0CD98CC1D74BA9700F41187 /* MTTcpConnectionBehaviour.m in Sources */, + D0CD983A1D74B9AA00F41187 /* MTPingMessage.m in Sources */, + D0CD97E31D74B93300F41187 /* MTQueue.m in Sources */, + D0CAF2DD1D75E31E0011F558 /* MTDisposable.m in Sources */, + D0CD98D41D74BAA800F41187 /* MTHttpWorker.m in Sources */, + D0CD987E1D74BA4900F41187 /* MTDatacenterTransferAuthAction.m in Sources */, + D0CD988F1D74BA5900F41187 /* MTDatacenterAddressSet.m in Sources */, + D0CD98091D74B96C00F41187 /* MTDestroySessionResponseMessage.m in Sources */, + D0CD982E1D74B9AA00F41187 /* MTExportedAuthorizationData.m in Sources */, + D0CD986E1D74B9F400F41187 /* MTTransportScheme.m in Sources */, + D0CD98D81D74BAAD00F41187 /* MTHttpWorkerBehaviour.m in Sources */, + D0CD98A71D74BA6E00F41187 /* MTSessionInfo.m in Sources */, + D0CD98BA1D74BA7C00F41187 /* MTNetworkAvailability.m in Sources */, + D0CD990C1D75C0F900F41187 /* MTResendMessageService.m in Sources */, + D0CD97E61D74B93300F41187 /* MTRsa.m in Sources */, + D0CD98921D74BA5900F41187 /* MTDatacenterAddressListData.m in Sources */, + D0CD98071D74B96C00F41187 /* MTBuffer.m in Sources */, + D0CD97E01D74B93300F41187 /* MTTimer.m in Sources */, + D0CD98671D74B9DD00F41187 /* MTFileBasedKeychain.m in Sources */, + D0CD986A1D74B9E900F41187 /* MTContext.m in Sources */, + D0CD98DE1D74BAEA00F41187 /* AFHTTPRequestOperation.m in Sources */, + D0CD98081D74B96C00F41187 /* MTBufferReader.m in Sources */, + D0CD98341D74B9AA00F41187 /* MTMsgDetailedInfoMessage.m in Sources */, + D0CD984F1D74B9B700F41187 /* MTRpcResultMessage.m in Sources */, + D0CD98391D74B9AA00F41187 /* MTNewSessionCreatedMessage.m in Sources */, + D0CD98381D74B9AA00F41187 /* MTMsgsStateReqMessage.m in Sources */, + D0CD98801D74BA4900F41187 /* MTDatacenterAuthMessageService.m in Sources */, + D0CD98AA1D74BA6F00F41187 /* MTOutgoingMessage.m in Sources */, + D0CD98E41D74BAF400F41187 /* GCDAsyncSocket.m in Sources */, + D0CAF2E81D75EA7E0011F558 /* MTAtomic.m in Sources */, + D0CD98901D74BA5900F41187 /* MTDatacenterAuthInfo.m in Sources */, + D0CD97E51D74B93300F41187 /* MTInputStream.m in Sources */, + D0CD98BB1D74BA7C00F41187 /* MTTransport.m in Sources */, + D0CD982F1D74B9AA00F41187 /* MTFutureSaltsMessage.m in Sources */, + D0CD98A61D74BA6E00F41187 /* MTProto.m in Sources */, + D0CD98331D74B9AA00F41187 /* MTMsgContainerMessage.m in Sources */, + D0CD980A1D74B96C00F41187 /* MTDropRpcResultMessage.m in Sources */, + D0CD98511D74B9B700F41187 /* MTServerDhParamsMessage.m in Sources */, + D0CD97E21D74B93300F41187 /* MTEncryption.m in Sources */, + D0CD97E11D74B93300F41187 /* MTLogging.m in Sources */, + D0CD98AB1D74BA6F00F41187 /* MTIncomingMessage.m in Sources */, + D0CD98501D74B9B700F41187 /* MTServerDhInnerDataMessage.m in Sources */, + D0CD99031D75C0ED00F41187 /* MTDropResponseContext.m in Sources */, + D0CD983B1D74B9AA00F41187 /* MTPongMessage.m in Sources */, + D0CD98BC1D74BA7C00F41187 /* MTTransportTransaction.m in Sources */, + D0CD98F41D75C0DD00F41187 /* MTRequestMessageService.m in Sources */, + D0CD98A81D74BA6E00F41187 /* MTTimeFixContext.m in Sources */, + D0CD98721D74B9F900F41187 /* MTDiscoverConnectionSignals.m in Sources */, + D0CD98061D74B96C00F41187 /* MTBadMsgNotificationMessage.m in Sources */, + D0CD98311D74B9AA00F41187 /* MTMessage.m in Sources */, + D0CD99001D75C0ED00F41187 /* MTRequest.m in Sources */, + D0CD98DD1D74BAEA00F41187 /* AFHTTPClient.m in Sources */, + D0CD98F01D75C0D200F41187 /* MTTimeSyncMessageService.m in Sources */, + D0CD98A91D74BA6F00F41187 /* MTPreparedMessage.m in Sources */, + D0CD99041D75C0ED00F41187 /* MTApiEnvironment.m in Sources */, + D0CD983C1D74B9AA00F41187 /* MTResPqMessage.m in Sources */, + D0CD98C41D74BA8A00F41187 /* MTTcpTransport.m in Sources */, + D0CD98AC1D74BA6F00F41187 /* MTMessageEncryptionKey.m in Sources */, + D0CD98301D74B9AA00F41187 /* MTInternalMessageParser.m in Sources */, + D0CD98DF1D74BAEA00F41187 /* AFURLConnectionOperation.m in Sources */, + D0CD98321D74B9AA00F41187 /* MTMsgAllInfoMessage.m in Sources */, + D0CD97D51D74B91C00F41187 /* MTTime.m in Sources */, + D0CD98351D74B9AA00F41187 /* MTMsgResendReqMessage.m in Sources */, + D0CD97E41D74B93300F41187 /* MTOutputStream.m in Sources */, + D0CD988E1D74BA5900F41187 /* MTDatacenterAddress.m in Sources */, + D0CD98D01D74BAA200F41187 /* MTHttpTransport.m in Sources */, + D0CD98521D74B9B700F41187 /* MTSetClientDhParamsResponseMessage.m in Sources */, + D0CAF2CF1D75E25B0011F558 /* MTSignal.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1503,6 +1953,7 @@ D0CB062E1ADC457B005E298F /* MTDatacenterAuthAction.m in Sources */, D0CB06441ADC4599005E298F /* MTIncomingMessage.m in Sources */, D0D1A0511ADD983C007D9ED6 /* MTMsgsAckMessage.m in Sources */, + D010DB821D70B3B90012AD96 /* MTAes.m in Sources */, D0CB066F1ADC49FF005E298F /* AFHTTPRequestOperation.m in Sources */, D0D1A06C1ADD987A007D9ED6 /* MTDatacenterAddressListData.m in Sources */, D09A59591B582EFF00FC3724 /* MTFileBasedKeychain.m in Sources */, @@ -1527,12 +1978,15 @@ D0D1A0371ADD983C007D9ED6 /* MTBadMsgNotificationMessage.m in Sources */, D0CB06691ADC45DA005E298F /* MTHttpWorkerBehaviour.m in Sources */, D0CB066E1ADC49FF005E298F /* AFHTTPClient.m in Sources */, + D0CAF2E41D75E7F30011F558 /* MTAtomic.m in Sources */, D0CB06611ADC45DA005E298F /* MTNetworkAvailability.m in Sources */, D0D1A0611ADD983C007D9ED6 /* MTRpcResultMessage.m in Sources */, D0CB06131ADC44B7005E298F /* MTEncryption.m in Sources */, + D0CAF2D41D75E26D0011F558 /* MTSubscriber.m in Sources */, D0CB06531ADC45BA005E298F /* MTRequestContext.m in Sources */, D0D1A03F1ADD983C007D9ED6 /* MTDropRpcResultMessage.m in Sources */, D0D1A0651ADD983C007D9ED6 /* MTServerDhParamsMessage.m in Sources */, + D0CAF2D81D75E2840011F558 /* MTDisposable.m in Sources */, D0CB06541ADC45BA005E298F /* MTRequestErrorContext.m in Sources */, D0D1A05B1ADD983C007D9ED6 /* MTPongMessage.m in Sources */, D0CB06241ADC455C005E298F /* MTContext.m in Sources */, @@ -1559,8 +2013,10 @@ D0D1A03D1ADD983C007D9ED6 /* MTDestroySessionResponseMessage.m in Sources */, D0CB06151ADC44B7005E298F /* MTOutputStream.m in Sources */, D0D1A0491ADD983C007D9ED6 /* MTMsgAllInfoMessage.m in Sources */, + D010DB7E1D70ABEE0012AD96 /* MTRsa.m in Sources */, D0D1A0631ADD983C007D9ED6 /* MTServerDhInnerDataMessage.m in Sources */, D0D1A0571ADD983C007D9ED6 /* MTNewSessionCreatedMessage.m in Sources */, + D0CAF2CC1D75E24C0011F558 /* MTSignal.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1568,6 +2024,88 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D0CD98E01D74BAEB00F41187 /* AFJSONUtilities.m in Sources */, + D0CD99071D75C0ED00F41187 /* MTRequestErrorContext.m in Sources */, + D0CD98461D74B9AA00F41187 /* MTMsgsStateInfoMessage.m in Sources */, + D0CD99061D75C0ED00F41187 /* MTRequestContext.m in Sources */, + D0CAF2E01D75E31F0011F558 /* MTSubscriber.m in Sources */, + D0CD98531D74B9B700F41187 /* MTRpcError.m in Sources */, + D0CD98451D74B9AA00F41187 /* MTMsgsAckMessage.m in Sources */, + D0CD97DF1D74B93100F41187 /* MTAes.m in Sources */, + D0CD98ED1D75C0C500F41187 /* MTMessageTransaction.m in Sources */, + D0CD98C81D74BA9100F41187 /* MTTcpConnection.m in Sources */, + D0CD98631D74B9D500F41187 /* MTKeychain.m in Sources */, + D0CD98821D74BA4900F41187 /* MTDatacenterAuthAction.m in Sources */, + D0CD98961D74BA5A00F41187 /* MTDatacenterSaltInfo.m in Sources */, + D0CD98771D74BA0700F41187 /* MTDiscoverDatacenterAddressAction.m in Sources */, + D0CD98CD1D74BA9700F41187 /* MTTcpConnectionBehaviour.m in Sources */, + D0CD98491D74B9AA00F41187 /* MTPingMessage.m in Sources */, + D0CD97DB1D74B93100F41187 /* MTQueue.m in Sources */, + D0CAF2DF1D75E31F0011F558 /* MTDisposable.m in Sources */, + D0CD98D51D74BAA800F41187 /* MTHttpWorker.m in Sources */, + D0CD98811D74BA4900F41187 /* MTDatacenterTransferAuthAction.m in Sources */, + D0CD98941D74BA5A00F41187 /* MTDatacenterAddressSet.m in Sources */, + D0CD980E1D74B96C00F41187 /* MTDestroySessionResponseMessage.m in Sources */, + D0CD983D1D74B9AA00F41187 /* MTExportedAuthorizationData.m in Sources */, + D0CD986F1D74B9F500F41187 /* MTTransportScheme.m in Sources */, + D0CD98D91D74BAAD00F41187 /* MTHttpWorkerBehaviour.m in Sources */, + D0CD98AE1D74BA6F00F41187 /* MTSessionInfo.m in Sources */, + D0CD98BD1D74BA7C00F41187 /* MTNetworkAvailability.m in Sources */, + D0CD990D1D75C0F900F41187 /* MTResendMessageService.m in Sources */, + D0CD97DE1D74B93100F41187 /* MTRsa.m in Sources */, + D0CD98971D74BA5A00F41187 /* MTDatacenterAddressListData.m in Sources */, + D0CD980C1D74B96C00F41187 /* MTBuffer.m in Sources */, + D0CD97D81D74B93100F41187 /* MTTimer.m in Sources */, + D0CD98661D74B9DD00F41187 /* MTFileBasedKeychain.m in Sources */, + D0CD986B1D74B9E900F41187 /* MTContext.m in Sources */, + D0CD98E21D74BAEB00F41187 /* AFHTTPRequestOperation.m in Sources */, + D0CD980D1D74B96C00F41187 /* MTBufferReader.m in Sources */, + D0CD98431D74B9AA00F41187 /* MTMsgDetailedInfoMessage.m in Sources */, + D0CD98541D74B9B700F41187 /* MTRpcResultMessage.m in Sources */, + D0CD98481D74B9AA00F41187 /* MTNewSessionCreatedMessage.m in Sources */, + D0CD98471D74B9AA00F41187 /* MTMsgsStateReqMessage.m in Sources */, + D0CD98831D74BA4900F41187 /* MTDatacenterAuthMessageService.m in Sources */, + D0CD98B11D74BA6F00F41187 /* MTOutgoingMessage.m in Sources */, + D0CD98E51D74BAF400F41187 /* GCDAsyncSocket.m in Sources */, + D0CAF2E71D75EA7E0011F558 /* MTAtomic.m in Sources */, + D0CD98951D74BA5A00F41187 /* MTDatacenterAuthInfo.m in Sources */, + D0CD97DD1D74B93100F41187 /* MTInputStream.m in Sources */, + D0CD98BE1D74BA7C00F41187 /* MTTransport.m in Sources */, + D0CD983E1D74B9AA00F41187 /* MTFutureSaltsMessage.m in Sources */, + D0CD98AD1D74BA6F00F41187 /* MTProto.m in Sources */, + D0CD98421D74B9AA00F41187 /* MTMsgContainerMessage.m in Sources */, + D0CD980F1D74B96C00F41187 /* MTDropRpcResultMessage.m in Sources */, + D0CD98561D74B9B700F41187 /* MTServerDhParamsMessage.m in Sources */, + D0CD97DA1D74B93100F41187 /* MTEncryption.m in Sources */, + D0CD97D91D74B93100F41187 /* MTLogging.m in Sources */, + D0CD98B21D74BA6F00F41187 /* MTIncomingMessage.m in Sources */, + D0CD98551D74B9B700F41187 /* MTServerDhInnerDataMessage.m in Sources */, + D0CD99081D75C0ED00F41187 /* MTDropResponseContext.m in Sources */, + D0CD984A1D74B9AA00F41187 /* MTPongMessage.m in Sources */, + D0CD98BF1D74BA7C00F41187 /* MTTransportTransaction.m in Sources */, + D0CD98F51D75C0DD00F41187 /* MTRequestMessageService.m in Sources */, + D0CD98AF1D74BA6F00F41187 /* MTTimeFixContext.m in Sources */, + D0CD98731D74B9F900F41187 /* MTDiscoverConnectionSignals.m in Sources */, + D0CD980B1D74B96C00F41187 /* MTBadMsgNotificationMessage.m in Sources */, + D0CD98401D74B9AA00F41187 /* MTMessage.m in Sources */, + D0CD99051D75C0ED00F41187 /* MTRequest.m in Sources */, + D0CD98E11D74BAEB00F41187 /* AFHTTPClient.m in Sources */, + D0CD98F11D75C0D300F41187 /* MTTimeSyncMessageService.m in Sources */, + D0CD98B01D74BA6F00F41187 /* MTPreparedMessage.m in Sources */, + D0CD99091D75C0ED00F41187 /* MTApiEnvironment.m in Sources */, + D0CD984B1D74B9AA00F41187 /* MTResPqMessage.m in Sources */, + D0CD98C31D74BA8A00F41187 /* MTTcpTransport.m in Sources */, + D0CD98B31D74BA6F00F41187 /* MTMessageEncryptionKey.m in Sources */, + D0CD983F1D74B9AA00F41187 /* MTInternalMessageParser.m in Sources */, + D0CD98E31D74BAEB00F41187 /* AFURLConnectionOperation.m in Sources */, + D0CD98411D74B9AA00F41187 /* MTMsgAllInfoMessage.m in Sources */, + D0CD97D41D74B91B00F41187 /* MTTime.m in Sources */, + D0CD98441D74B9AA00F41187 /* MTMsgResendReqMessage.m in Sources */, + D0CD97DC1D74B93100F41187 /* MTOutputStream.m in Sources */, + D0CD98931D74BA5A00F41187 /* MTDatacenterAddress.m in Sources */, + D0CD98D11D74BAA200F41187 /* MTHttpTransport.m in Sources */, + D0CD98571D74B9B700F41187 /* MTSetClientDhParamsResponseMessage.m in Sources */, + D0CAF2D01D75E25B0011F558 /* MTSignal.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1667,17 +2205,24 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_MODULES_AUTOLINK = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -1691,7 +2236,8 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.1; - ONLY_ACTIVE_ARCH = NO; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; SDKROOT = iphoneos; }; name = Debug; @@ -1704,17 +2250,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_MODULES_AUTOLINK = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1722,6 +2274,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.1; + PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -1752,6 +2305,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1781,6 +2335,7 @@ MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1797,17 +2352,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_MODULES_AUTOLINK = NO; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1815,6 +2376,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 7.1; + PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -1823,10 +2385,12 @@ D096C2D31CC3C664006D814E /* Hockeyapp */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -1858,8 +2422,12 @@ MACH_O_TYPE = staticlib; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = "-lz"; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_MODULE_NAME = MtProtoKit; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = X834Q8SBVP/; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1887,6 +2455,7 @@ MACH_O_TYPE = staticlib; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1898,24 +2467,39 @@ D096C2D51CC3C664006D814E /* Hockeyapp */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; + DEPLOYMENT_POSTPROCESSING = NO; + DEVELOPMENT_TEAM = X834Q8SBVP; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/openssl"; INFOPLIST_FILE = MtProtoKitDynamic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.4; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/openssl/iOS", + ); MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CFLAGS = "-DMtProtoKitDynamicFramework=1"; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SEPARATE_STRIP = NO; SKIP_INSTALL = YES; + STRIPFLAGS = ""; + STRIP_STYLE = all; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1939,6 +2523,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Hockeyapp; @@ -1964,9 +2549,12 @@ D0CB060A1ADC4483005E298F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -2002,8 +2590,13 @@ MACH_O_TYPE = staticlib; MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = "-lz"; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_MODULE_NAME = MtProtoKit; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = X834Q8SBVP/; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2013,10 +2606,11 @@ D0CB060B1ADC4483005E298F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; ARCHS = "$(ARCHS_STANDARD)"; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; @@ -2048,8 +2642,12 @@ MACH_O_TYPE = staticlib; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = "-lz"; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_MODULE_NAME = MtProtoKit; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = X834Q8SBVP/; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2059,11 +2657,16 @@ D0D2251E1B4D817B0085E26D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; + DEPLOYMENT_POSTPROCESSING = NO; + DEVELOPMENT_TEAM = X834Q8SBVP; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -2073,14 +2676,25 @@ "DEBUG=1", "$(inherited)", ); + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/openssl"; INFOPLIST_FILE = MtProtoKitDynamic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.4; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/openssl/iOS", + ); MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = "-DMtProtoKitDynamicFramework=1"; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SEPARATE_STRIP = NO; SKIP_INSTALL = YES; + STRIPFLAGS = ""; + STRIP_STYLE = all; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2090,24 +2704,39 @@ D0D2251F1B4D817B0085E26D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; + DEPLOYMENT_POSTPROCESSING = NO; + DEVELOPMENT_TEAM = X834Q8SBVP; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; + HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/openssl"; INFOPLIST_FILE = MtProtoKitDynamic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.4; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/openssl/iOS", + ); MTL_ENABLE_DEBUG_INFO = NO; + OTHER_CFLAGS = "-DMtProtoKitDynamicFramework=1"; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SEPARATE_STRIP = NO; SKIP_INSTALL = YES; + STRIPFLAGS = ""; + STRIP_STYLE = all; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -2135,6 +2764,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -2156,6 +2786,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "org.telegram.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; diff --git a/MtProtoKitDynamic/Info.plist b/MtProtoKitDynamic/Info.plist index f6228f96e7..d3de8eefb6 100644 --- a/MtProtoKitDynamic/Info.plist +++ b/MtProtoKitDynamic/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.telegram.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/MtProtoKitDynamic/MtProtoKitDynamic.h b/MtProtoKitDynamic/MtProtoKitDynamic.h index d044d8de89..0b5250f21b 100644 --- a/MtProtoKitDynamic/MtProtoKitDynamic.h +++ b/MtProtoKitDynamic/MtProtoKitDynamic.h @@ -14,6 +14,52 @@ FOUNDATION_EXPORT double MtProtoKitDynamicVersionNumber; //! Project version string for MtProtoKitDynamic. FOUNDATION_EXPORT const unsigned char MtProtoKitDynamicVersionString[]; -// In this header, you should import all the public headers of your framework using statements like #import - +#ifndef MtProtoKitDynamicFramework +# define MtProtoKitDynamicFramework 1 +#endif +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/MtProtoKitDynamicTests/Info.plist b/MtProtoKitDynamicTests/Info.plist index 29dacae6b5..ba72822e87 100644 --- a/MtProtoKitDynamicTests/Info.plist +++ b/MtProtoKitDynamicTests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.telegram.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/MtProtoKitMac/Info.plist b/MtProtoKitMac/Info.plist index 10172f8a1d..fb8e650960 100644 --- a/MtProtoKitMac/Info.plist +++ b/MtProtoKitMac/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - org.telegram.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/build/MtProtoKit.build/Debug/MtProtoKit OSX.build/dgph b/build/MtProtoKit.build/Debug/MtProtoKit OSX.build/dgph deleted file mode 100644 index f82cc6cfe4..0000000000 Binary files a/build/MtProtoKit.build/Debug/MtProtoKit OSX.build/dgph and /dev/null differ diff --git a/openssl/iOS/libcrypto.a b/openssl/iOS/libcrypto.a index cb8625e581..16b472ba08 100644 Binary files a/openssl/iOS/libcrypto.a and b/openssl/iOS/libcrypto.a differ diff --git a/openssl/openssl/aes.h b/openssl/openssl/aes.h index 87bf60f6f2..faa66c4914 100644 --- a/openssl/openssl/aes.h +++ b/openssl/openssl/aes.h @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/openssl/openssl/async.h b/openssl/openssl/async.h new file mode 100644 index 0000000000..5b2e496dbd --- /dev/null +++ b/openssl/openssl/async.h @@ -0,0 +1,98 @@ +/* + * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#ifndef HEADER_ASYNC_H +# define HEADER_ASYNC_H + +#if defined(_WIN32) +# if defined(BASETYPES) || defined(_WINDEF_H) +/* application has to include to use this */ +#define OSSL_ASYNC_FD HANDLE +#define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE +# endif +#else +#define OSSL_ASYNC_FD int +#define OSSL_BAD_ASYNC_FD -1 +#endif + + +# ifdef __cplusplus +extern "C" { +# endif + +typedef struct async_job_st ASYNC_JOB; +typedef struct async_wait_ctx_st ASYNC_WAIT_CTX; + +#define ASYNC_ERR 0 +#define ASYNC_NO_JOBS 1 +#define ASYNC_PAUSE 2 +#define ASYNC_FINISH 3 + +int ASYNC_init_thread(size_t max_size, size_t init_size); +void ASYNC_cleanup_thread(void); + +#ifdef OSSL_ASYNC_FD +ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void); +void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx); +int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key, + OSSL_ASYNC_FD fd, + void *custom_data, + void (*cleanup)(ASYNC_WAIT_CTX *, const void *, + OSSL_ASYNC_FD, void *)); +int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key, + OSSL_ASYNC_FD *fd, void **custom_data); +int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd, + size_t *numfds); +int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd, + size_t *numaddfds, OSSL_ASYNC_FD *delfd, + size_t *numdelfds); +int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key); +#endif + +int ASYNC_is_capable(void); + +int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret, + int (*func)(void *), void *args, size_t size); +int ASYNC_pause_job(void); + +ASYNC_JOB *ASYNC_get_current_job(void); +ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job); +void ASYNC_block_pause(void); +void ASYNC_unblock_pause(void); + +/* BEGIN ERROR CODES */ +/* + * The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + +int ERR_load_ASYNC_strings(void); + +/* Error codes for the ASYNC functions. */ + +/* Function codes. */ +# define ASYNC_F_ASYNC_CTX_NEW 100 +# define ASYNC_F_ASYNC_INIT_THREAD 101 +# define ASYNC_F_ASYNC_JOB_NEW 102 +# define ASYNC_F_ASYNC_PAUSE_JOB 103 +# define ASYNC_F_ASYNC_START_FUNC 104 +# define ASYNC_F_ASYNC_START_JOB 105 + +/* Reason codes. */ +# define ASYNC_R_FAILED_TO_SET_POOL 101 +# define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102 +# define ASYNC_R_INIT_FAILED 105 +# define ASYNC_R_INVALID_POOL_SIZE 103 + +# ifdef __cplusplus +} +# endif +#endif diff --git a/openssl/openssl/bio.h b/openssl/openssl/bio.h index f78796b069..6790aed28e 100644 --- a/openssl/openssl/bio.h +++ b/openssl/openssl/bio.h @@ -479,11 +479,11 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) # define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) # define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0) +# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL) # define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) -/* BIO_s_accept_socket() */ +/* BIO_s_accept() */ # define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) # define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) /* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ @@ -496,6 +496,7 @@ struct bio_dgram_sctp_prinfo { # define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) # define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) +/* BIO_s_accept() and BIO_s_connect() */ # define BIO_do_connect(b) BIO_do_handshake(b) # define BIO_do_accept(b) BIO_do_handshake(b) # define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) @@ -515,12 +516,15 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) # define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) +/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ # define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) # define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) +/* BIO_s_file() */ # define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) # define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) +/* BIO_s_fd() and BIO_s_file() */ # define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) # define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) @@ -685,7 +689,7 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); BIO_METHOD *BIO_s_mem(void); -BIO *BIO_new_mem_buf(void *buf, int len); +BIO *BIO_new_mem_buf(const void *buf, int len); BIO_METHOD *BIO_s_socket(void); BIO_METHOD *BIO_s_connect(void); BIO_METHOD *BIO_s_accept(void); diff --git a/openssl/openssl/bn.h b/openssl/openssl/bn.h index 5696965e9a..86264ae631 100644 --- a/openssl/openssl/bn.h +++ b/openssl/openssl/bn.h @@ -125,6 +125,7 @@ #ifndef HEADER_BN_H # define HEADER_BN_H +# include # include # ifndef OPENSSL_NO_FP_API # include /* FILE */ @@ -721,8 +722,17 @@ const BIGNUM *BN_get0_nist_prime_521(void); /* library internal functions */ -# define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\ - (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2)) +# define bn_expand(a,bits) \ + ( \ + bits > (INT_MAX - BN_BITS2 + 1) ? \ + NULL \ + : \ + (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \ + (a) \ + : \ + bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \ + ) + # define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) BIGNUM *bn_expand2(BIGNUM *a, int words); # ifndef OPENSSL_NO_DEPRECATED diff --git a/openssl/openssl/buffer.h b/openssl/openssl/buffer.h index c343dd772f..efd240a5f9 100644 --- a/openssl/openssl/buffer.h +++ b/openssl/openssl/buffer.h @@ -86,7 +86,13 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len); int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); size_t BUF_strnlen(const char *str, size_t maxlen); char *BUF_strdup(const char *str); + +/* + * Like strndup, but in addition, explicitly guarantees to never read past the + * first |siz| bytes of |str|. + */ char *BUF_strndup(const char *str, size_t siz); + void *BUF_memdup(const void *data, size_t siz); void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); diff --git a/openssl/openssl/camellia.h b/openssl/openssl/camellia.h index 9be7c0fd99..45e8d25b1d 100644 --- a/openssl/openssl/camellia.h +++ b/openssl/openssl/camellia.h @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia.h */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/openssl/openssl/comp.h b/openssl/openssl/comp.h index 406c428aae..60a073404e 100644 --- a/openssl/openssl/comp.h +++ b/openssl/openssl/comp.h @@ -4,6 +4,10 @@ # include +# ifdef OPENSSL_NO_COMP +# error COMP is disabled. +# endif + #ifdef __cplusplus extern "C" { #endif diff --git a/openssl/openssl/crypto.h b/openssl/openssl/crypto.h index c450d7a3c3..6c644ce12a 100644 --- a/openssl/openssl/crypto.h +++ b/openssl/openssl/crypto.h @@ -628,7 +628,7 @@ void OPENSSL_init(void); * into a defined order as the return value when a != b is undefined, other * than to be non-zero. */ -int CRYPTO_memcmp(const void *a, const void *b, size_t len); +int CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len); /* BEGIN ERROR CODES */ /* diff --git a/openssl/openssl/ct.h b/openssl/openssl/ct.h new file mode 100644 index 0000000000..6c63265257 --- /dev/null +++ b/openssl/openssl/ct.h @@ -0,0 +1,518 @@ +/* + * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_CT_H +# define HEADER_CT_H + +# include + +# ifndef OPENSSL_NO_CT +# include +# include +# include +# ifdef __cplusplus +extern "C" { +# endif + + +/* Minimum RSA key size, from RFC6962 */ +# define SCT_MIN_RSA_BITS 2048 + +/* All hashes are SHA256 in v1 of Certificate Transparency */ +# define CT_V1_HASHLEN SHA256_DIGEST_LENGTH + +typedef enum { + CT_LOG_ENTRY_TYPE_NOT_SET = -1, + CT_LOG_ENTRY_TYPE_X509 = 0, + CT_LOG_ENTRY_TYPE_PRECERT = 1 +} ct_log_entry_type_t; + +typedef enum { + SCT_VERSION_NOT_SET = -1, + SCT_VERSION_V1 = 0 +} sct_version_t; + +typedef enum { + SCT_SOURCE_UNKNOWN, + SCT_SOURCE_TLS_EXTENSION, + SCT_SOURCE_X509V3_EXTENSION, + SCT_SOURCE_OCSP_STAPLED_RESPONSE +} sct_source_t; + +typedef enum { + SCT_VALIDATION_STATUS_NOT_SET, + SCT_VALIDATION_STATUS_UNKNOWN_LOG, + SCT_VALIDATION_STATUS_VALID, + SCT_VALIDATION_STATUS_INVALID, + SCT_VALIDATION_STATUS_UNVERIFIED, + SCT_VALIDATION_STATUS_UNKNOWN_VERSION +} sct_validation_status_t; + +DEFINE_STACK_OF(SCT) +DEFINE_STACK_OF(CTLOG) + +/****************************************** + * CT policy evaluation context functions * + ******************************************/ + +/* + * Creates a new, empty policy evaluation context. + * The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished + * with the CT_POLICY_EVAL_CTX. + */ +CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void); + +/* Deletes a policy evaluation context and anything it owns. */ +void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx); + +/* Gets the peer certificate that the SCTs are for */ +X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the certificate associated with the received SCTs. + * Increments the reference count of cert. + * Returns 1 on success, 0 otherwise. + */ +int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert); + +/* Gets the issuer of the aforementioned certificate */ +X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the issuer of the certificate associated with the received SCTs. + * Increments the reference count of issuer. + * Returns 1 on success, 0 otherwise. + */ +int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer); + +/* Gets the CT logs that are trusted sources of SCTs */ +const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx); + +/* Sets the log store that is in use. It must outlive the CT_POLICY_EVAL_CTX. */ +void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, + CTLOG_STORE *log_store); + +/***************** + * SCT functions * + *****************/ + +/* + * Creates a new, blank SCT. + * The caller is responsible for calling SCT_free when finished with the SCT. + */ +SCT *SCT_new(void); + +/* + * Creates a new SCT from some base64-encoded strings. + * The caller is responsible for calling SCT_free when finished with the SCT. + */ +SCT *SCT_new_from_base64(unsigned char version, + const char *logid_base64, + ct_log_entry_type_t entry_type, + uint64_t timestamp, + const char *extensions_base64, + const char *signature_base64); + +/* + * Frees the SCT and the underlying data structures. + */ +void SCT_free(SCT *sct); + +/* + * Free a stack of SCTs, and the underlying SCTs themselves. + * Intended to be compatible with X509V3_EXT_FREE. + */ +void SCT_LIST_free(STACK_OF(SCT) *a); + +/* + * Returns the version of the SCT. + */ +sct_version_t SCT_get_version(const SCT *sct); + +/* + * Set the version of an SCT. + * Returns 1 on success, 0 if the version is unrecognized. + */ +__owur int SCT_set_version(SCT *sct, sct_version_t version); + +/* + * Returns the log entry type of the SCT. + */ +ct_log_entry_type_t SCT_get_log_entry_type(const SCT *sct); + +/* + * Set the log entry type of an SCT. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set_log_entry_type(SCT *sct, ct_log_entry_type_t entry_type); + +/* + * Gets the ID of the log that an SCT came from. + * Ownership of the log ID remains with the SCT. + * Returns the length of the log ID. + */ +size_t SCT_get0_log_id(const SCT *sct, unsigned char **log_id); + +/* + * Set the log ID of an SCT to point directly to the *log_id specified. + * The SCT takes ownership of the specified pointer. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set0_log_id(SCT *sct, unsigned char *log_id, size_t log_id_len); + +/* + * Set the log ID of an SCT. + * This makes a copy of the log_id. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set1_log_id(SCT *sct, const unsigned char *log_id, + size_t log_id_len); + +/* + * Returns the timestamp for the SCT (epoch time in milliseconds). + */ +uint64_t SCT_get_timestamp(const SCT *sct); + +/* + * Set the timestamp of an SCT (epoch time in milliseconds). + */ +void SCT_set_timestamp(SCT *sct, uint64_t timestamp); + +/* + * Return the NID for the signature used by the SCT. + * For CT v1, this will be either NID_sha256WithRSAEncryption or + * NID_ecdsa_with_SHA256 (or NID_undef if incorrect/unset). + */ +int SCT_get_signature_nid(const SCT *sct); + +/* + * Set the signature type of an SCT + * For CT v1, this should be either NID_sha256WithRSAEncryption or + * NID_ecdsa_with_SHA256. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set_signature_nid(SCT *sct, int nid); + +/* + * Set *ext to point to the extension data for the SCT. ext must not be NULL. + * The SCT retains ownership of this pointer. + * Returns length of the data pointed to. + */ +size_t SCT_get0_extensions(const SCT *sct, unsigned char **ext); + +/* + * Set the extensions of an SCT to point directly to the *ext specified. + * The SCT takes ownership of the specified pointer. + */ +void SCT_set0_extensions(SCT *sct, unsigned char *ext, size_t ext_len); + +/* + * Set the extensions of an SCT. + * This takes a copy of the ext. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set1_extensions(SCT *sct, const unsigned char *ext, + size_t ext_len); + +/* + * Set *sig to point to the signature for the SCT. sig must not be NULL. + * The SCT retains ownership of this pointer. + * Returns length of the data pointed to. + */ +size_t SCT_get0_signature(const SCT *sct, unsigned char **sig); + +/* + * Set the signature of an SCT to point directly to the *sig specified. + * The SCT takes ownership of the specified pointer. + */ +void SCT_set0_signature(SCT *sct, unsigned char *sig, size_t sig_len); + +/* + * Set the signature of an SCT to be a copy of the *sig specified. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set1_signature(SCT *sct, const unsigned char *sig, + size_t sig_len); + +/* + * The origin of this SCT, e.g. TLS extension, OCSP response, etc. + */ +sct_source_t SCT_get_source(const SCT *sct); + +/* + * Set the origin of this SCT, e.g. TLS extension, OCSP response, etc. + * Returns 1 on success, 0 otherwise. + */ +__owur int SCT_set_source(SCT *sct, sct_source_t source); + +/* + * Returns a text string describing the validation status of |sct|. + */ +const char *SCT_validation_status_string(const SCT *sct); + +/* + * Pretty-prints an |sct| to |out|. + * It will be indented by the number of spaces specified by |indent|. + * If |logs| is not NULL, it will be used to lookup the CT log that the SCT came + * from, so that the log name can be printed. + */ +void SCT_print(const SCT *sct, BIO *out, int indent, const CTLOG_STORE *logs); + +/* + * Pretty-prints an |sct_list| to |out|. + * It will be indented by the number of spaces specified by |indent|. + * SCTs will be delimited by |separator|. + * If |logs| is not NULL, it will be used to lookup the CT log that each SCT + * came from, so that the log names can be printed. + */ +void SCT_LIST_print(const STACK_OF(SCT) *sct_list, BIO *out, int indent, + const char *separator, const CTLOG_STORE *logs); + +/* + * Gets the last result of validating this SCT. + * If it has not been validated yet, returns SCT_VALIDATION_STATUS_NOT_SET. + */ +sct_validation_status_t SCT_get_validation_status(const SCT *sct); + +/* + * Validates the given SCT with the provided context. + * Sets the "validation_status" field of the SCT. + * Returns 1 if the SCT is valid and the signature verifies. + * Returns 0 if the SCT is invalid or could not be verified. + * Returns -1 if an error occurs. + */ +__owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx); + +/* + * Validates the given list of SCTs with the provided context. + * Sets the "validation_status" field of each SCT. + * Returns 1 if there are no invalid SCTs and all signatures verify. + * Returns 0 if at least one SCT is invalid or could not be verified. + * Returns a negative integer if an error occurs. + */ +__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts, + CT_POLICY_EVAL_CTX *ctx); + + +/********************************* + * SCT parsing and serialisation * + *********************************/ + +/* + * Serialize (to TLS format) a stack of SCTs and return the length. + * "a" must not be NULL. + * If "pp" is NULL, just return the length of what would have been serialized. + * If "pp" is not NULL and "*pp" is null, function will allocate a new pointer + * for data that caller is responsible for freeing (only if function returns + * successfully). + * If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring + * that "*pp" is large enough to accept all of the serialized data. + * Returns < 0 on error, >= 0 indicating bytes written (or would have been) + * on success. + */ +__owur int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); + +/* + * Convert TLS format SCT list to a stack of SCTs. + * If "a" or "*a" is NULL, a new stack will be created that the caller is + * responsible for freeing (by calling SCT_LIST_free). + * "**pp" and "*pp" must not be NULL. + * Upon success, "*pp" will point to after the last bytes read, and a stack + * will be returned. + * Upon failure, a NULL pointer will be returned, and the position of "*pp" is + * not defined. + */ +STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + size_t len); + +/* + * Serialize (to DER format) a stack of SCTs and return the length. + * "a" must not be NULL. + * If "pp" is NULL, just returns the length of what would have been serialized. + * If "pp" is not NULL and "*pp" is null, function will allocate a new pointer + * for data that caller is responsible for freeing (only if function returns + * successfully). + * If "pp" is NULL and "*pp" is not NULL, caller is responsible for ensuring + * that "*pp" is large enough to accept all of the serialized data. + * Returns < 0 on error, >= 0 indicating bytes written (or would have been) + * on success. + */ +__owur int i2d_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); + +/* + * Parses an SCT list in DER format and returns it. + * If "a" or "*a" is NULL, a new stack will be created that the caller is + * responsible for freeing (by calling SCT_LIST_free). + * "**pp" and "*pp" must not be NULL. + * Upon success, "*pp" will point to after the last bytes read, and a stack + * will be returned. + * Upon failure, a NULL pointer will be returned, and the position of "*pp" is + * not defined. + */ +STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + long len); + +/* + * Serialize (to TLS format) an |sct| and write it to |out|. + * If |out| is null, no SCT will be output but the length will still be returned. + * If |out| points to a null pointer, a string will be allocated to hold the + * TLS-format SCT. It is the responsibility of the caller to free it. + * If |out| points to an allocated string, the TLS-format SCT will be written + * to it. + * The length of the SCT in TLS format will be returned. + */ +__owur int i2o_SCT(const SCT *sct, unsigned char **out); + +/* + * Parses an SCT in TLS format and returns it. + * If |psct| is not null, it will end up pointing to the parsed SCT. If it + * already points to a non-null pointer, the pointer will be free'd. + * |in| should be a pointer to a string containing the TLS-format SCT. + * |in| will be advanced to the end of the SCT if parsing succeeds. + * |len| should be the length of the SCT in |in|. + * Returns NULL if an error occurs. + * If the SCT is an unsupported version, only the SCT's 'sct' and 'sct_len' + * fields will be populated (with |in| and |len| respectively). + */ +SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len); + +/******************** + * CT log functions * + ********************/ + +/* + * Creates a new CT log instance with the given |public_key| and |name|. + * Takes ownership of |public_key| but copies |name|. + * Returns NULL if malloc fails or if |public_key| cannot be converted to DER. + * Should be deleted by the caller using CTLOG_free when no longer needed. + */ +CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name); + +/* + * Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER + * in |pkey_base64|. The |name| is a string to help users identify this log. + * Returns 1 on success, 0 on failure. + * Should be deleted by the caller using CTLOG_free when no longer needed. + */ +int CTLOG_new_from_base64(CTLOG ** ct_log, + const char *pkey_base64, const char *name); + +/* + * Deletes a CT log instance and its fields. + */ +void CTLOG_free(CTLOG *log); + +/* Gets the name of the CT log */ +const char *CTLOG_get0_name(const CTLOG *log); +/* Gets the ID of the CT log */ +void CTLOG_get0_log_id(const CTLOG *log, const uint8_t **log_id, + size_t *log_id_len); +/* Gets the public key of the CT log */ +EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log); + +/************************** + * CT log store functions * + **************************/ + +/* + * Creates a new CT log store. + * Should be deleted by the caller using CTLOG_STORE_free when no longer needed. + */ +CTLOG_STORE *CTLOG_STORE_new(void); + +/* + * Deletes a CT log store and all of the CT log instances held within. + */ +void CTLOG_STORE_free(CTLOG_STORE *store); + +/* + * Finds a CT log in the store based on its log ID. + * Returns the CT log, or NULL if no match is found. + */ +const CTLOG *CTLOG_STORE_get0_log_by_id(const CTLOG_STORE *store, + const uint8_t *log_id, + size_t log_id_len); + +/* + * Loads a CT log list into a |store| from a |file|. + * Returns 1 if loading is successful, or 0 otherwise. + */ +__owur int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file); + +/* + * Loads the default CT log list into a |store|. + * See internal/cryptlib.h for the environment variable and file path that are + * consulted to find the default file. + * Returns 1 if loading is successful, or 0 otherwise. + */ +__owur int CTLOG_STORE_load_default_file(CTLOG_STORE *store); + +/* BEGIN ERROR CODES */ +/* + * The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + +int ERR_load_CT_strings(void); + +/* Error codes for the CT functions. */ + +/* Function codes. */ +# define CT_F_CTLOG_NEW 117 +# define CT_F_CTLOG_NEW_FROM_BASE64 118 +# define CT_F_CTLOG_NEW_FROM_CONF 119 +# define CT_F_CTLOG_NEW_NULL 120 +# define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 +# define CT_F_CTLOG_STORE_LOAD_FILE 123 +# define CT_F_CTLOG_STORE_LOAD_LOG 130 +# define CT_F_CTLOG_STORE_NEW 131 +# define CT_F_CT_BASE64_DECODE 124 +# define CT_F_CT_POLICY_EVAL_CTX_NEW 133 +# define CT_F_CT_V1_LOG_ID_FROM_PKEY 125 +# define CT_F_I2O_SCT 107 +# define CT_F_I2O_SCT_LIST 108 +# define CT_F_I2O_SCT_SIGNATURE 109 +# define CT_F_O2I_SCT 110 +# define CT_F_O2I_SCT_LIST 111 +# define CT_F_O2I_SCT_SIGNATURE 112 +# define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_NEW 100 +# define CT_F_SCT_NEW_FROM_BASE64 127 +# define CT_F_SCT_SET0_LOG_ID 101 +# define CT_F_SCT_SET1_EXTENSIONS 114 +# define CT_F_SCT_SET1_LOG_ID 115 +# define CT_F_SCT_SET1_SIGNATURE 116 +# define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 +# define CT_F_SCT_SET_SIGNATURE_NID 103 +# define CT_F_SCT_SET_VERSION 104 +# define CT_F_SCT_CTX_VERIFY 128 + +/* Reason codes. */ +# define CT_R_BASE64_DECODE_ERROR 108 +# define CT_R_INVALID_LOG_ID_LENGTH 100 +# define CT_R_LOG_CONF_INVALID 109 +# define CT_R_LOG_CONF_INVALID_KEY 110 +# define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 +# define CT_R_LOG_CONF_MISSING_KEY 112 +# define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_INVALID 104 +# define CT_R_SCT_INVALID_SIGNATURE 107 +# define CT_R_SCT_LIST_INVALID 105 +# define CT_R_SCT_LOG_ID_MISMATCH 114 +# define CT_R_SCT_NOT_SET 106 +# define CT_R_SCT_UNSUPPORTED_VERSION 115 +# define CT_R_UNRECOGNIZED_SIGNATURE_NID 101 +# define CT_R_UNSUPPORTED_ENTRY_TYPE 102 +# define CT_R_UNSUPPORTED_VERSION 103 + +# ifdef __cplusplus +} +# endif +# endif +#endif diff --git a/openssl/openssl/des_old.h b/openssl/openssl/des_old.h index f1e1e2cb09..ee7607a241 100644 --- a/openssl/openssl/des_old.h +++ b/openssl/openssl/des_old.h @@ -1,4 +1,4 @@ -/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.h */ /*- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING diff --git a/openssl/openssl/dh.h b/openssl/openssl/dh.h index 0502f1a9cc..a5bd9016aa 100644 --- a/openssl/openssl/dh.h +++ b/openssl/openssl/dh.h @@ -142,7 +142,7 @@ struct dh_st { BIGNUM *p; BIGNUM *g; long length; /* optional */ - BIGNUM *pub_key; /* g^x */ + BIGNUM *pub_key; /* g^x % p */ BIGNUM *priv_key; /* x */ int flags; BN_MONT_CTX *method_mont_p; @@ -174,6 +174,7 @@ struct dh_st { /* DH_check_pub_key error codes */ # define DH_CHECK_PUBKEY_TOO_SMALL 0x01 # define DH_CHECK_PUBKEY_TOO_LARGE 0x02 +# define DH_CHECK_PUBKEY_INVALID 0x04 /* * primes p where (p-1)/2 is prime too are called "safe"; we define this for diff --git a/openssl/openssl/dso.h b/openssl/openssl/dso.h index 7c4a1dc4a6..c9013f5cea 100644 --- a/openssl/openssl/dso.h +++ b/openssl/openssl/dso.h @@ -1,4 +1,4 @@ -/* dso.h -*- mode:C; c-file-style: "eay" -*- */ +/* dso.h */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. diff --git a/openssl/openssl/ec.h b/openssl/openssl/ec.h index 6d3178f609..81e6faf6c5 100644 --- a/openssl/openssl/ec.h +++ b/openssl/openssl/ec.h @@ -106,7 +106,7 @@ typedef enum { /** the point is encoded as z||x, where the octet z specifies * which solution of the quadratic equation y is */ POINT_CONVERSION_COMPRESSED = 2, - /** the point is encoded as z||x||y, where z is the octet 0x02 */ + /** the point is encoded as z||x||y, where z is the octet 0x04 */ POINT_CONVERSION_UNCOMPRESSED = 4, /** the point is encoded as z||x||y, where the octet z specifies * which solution of the quadratic equation y is */ diff --git a/openssl/openssl/ecdsa.h b/openssl/openssl/ecdsa.h index c4016ac3e1..a6f0930f82 100644 --- a/openssl/openssl/ecdsa.h +++ b/openssl/openssl/ecdsa.h @@ -233,7 +233,7 @@ void *ECDSA_get_ex_data(EC_KEY *d, int idx); * \return pointer to a ECDSA_METHOD structure or NULL if an error occurred */ -ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method); +ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method); /** frees a ECDSA_METHOD structure * \param ecdsa_method pointer to the ECDSA_METHOD structure diff --git a/openssl/openssl/kdf.h b/openssl/openssl/kdf.h new file mode 100644 index 0000000000..9f87f788b2 --- /dev/null +++ b/openssl/openssl/kdf.h @@ -0,0 +1,75 @@ +/* + * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_KDF_H +# define HEADER_KDF_H + +#ifdef __cplusplus +extern "C" { +#endif + +# define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL) +# define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1) +# define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2) +# define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3) +# define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4) +# define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5) +# define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6) + +# define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_TLS_MD, 0, (void *)md) + +# define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)sec) + +# define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)seed) + +# define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_HKDF_MD, 0, (void *)md) + +# define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)salt) + +# define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)key) + +# define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \ + EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ + EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)info) + +/* BEGIN ERROR CODES */ +/* + * The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + +int ERR_load_KDF_strings(void); + +/* Error codes for the KDF functions. */ + +/* Function codes. */ +# define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100 +# define KDF_F_PKEY_TLS1_PRF_DERIVE 101 + +/* Reason codes. */ +# define KDF_R_INVALID_DIGEST 100 +# define KDF_R_MISSING_PARAMETER 101 +# define KDF_R_VALUE_MISSING 102 + +# ifdef __cplusplus +} +# endif +#endif diff --git a/openssl/openssl/kssl.h b/openssl/openssl/kssl.h index 9a57672801..ae8a51f472 100644 --- a/openssl/openssl/kssl.h +++ b/openssl/openssl/kssl.h @@ -1,4 +1,4 @@ -/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ +/* ssl/kssl.h */ /* * Written by Vern Staats for the OpenSSL project * 2000. project 2000. diff --git a/openssl/openssl/md2.h b/openssl/openssl/md2.h new file mode 100644 index 0000000000..7faf8e3d65 --- /dev/null +++ b/openssl/openssl/md2.h @@ -0,0 +1,44 @@ +/* + * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_MD2_H +# define HEADER_MD2_H + +# include + +# ifndef OPENSSL_NO_MD2 +# include +# ifdef __cplusplus +extern "C" { +# endif + +typedef unsigned char MD2_INT; + +# define MD2_DIGEST_LENGTH 16 +# define MD2_BLOCK 16 + +typedef struct MD2state_st { + unsigned int num; + unsigned char data[MD2_BLOCK]; + MD2_INT cksm[MD2_BLOCK]; + MD2_INT state[MD2_BLOCK]; +} MD2_CTX; + +const char *MD2_options(void); +int MD2_Init(MD2_CTX *c); +int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); +int MD2_Final(unsigned char *md, MD2_CTX *c); +unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md); + +# ifdef __cplusplus +} +# endif +# endif + +#endif diff --git a/openssl/openssl/opensslconf.h b/openssl/openssl/opensslconf.h index 1f6a1ded2f..a8b64c1e8f 100644 --- a/openssl/openssl/opensslconf.h +++ b/openssl/openssl/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -95,12 +101,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif /* crypto/opensslconf.h.in */ @@ -110,8 +122,8 @@ extern "C" { #if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ #if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) -#define ENGINESDIR "/tmp/openssl-1.0.2d-x86_64/lib/engines" -#define OPENSSLDIR "/tmp/openssl-1.0.2d-x86_64" +#define ENGINESDIR "/Users/peter/build/OpenSSL-for-iPhone/bin/iPhoneSimulator10.0-x86_64.sdk/lib/engines" +#define OPENSSLDIR "/Users/peter/build/OpenSSL-for-iPhone/bin/iPhoneSimulator10.0-x86_64.sdk" #endif #endif @@ -225,7 +237,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/openssl/openssl/opensslv.h b/openssl/openssl/opensslv.h index c06b13ac6b..13fe440231 100644 --- a/openssl/openssl/opensslv.h +++ b/openssl/openssl/opensslv.h @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000204fL +# define OPENSSL_VERSION_NUMBER 0x1000208fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h-fips 3 May 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d 9 Jul 2015" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h 3 May 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT diff --git a/openssl/openssl/rc5.h b/openssl/openssl/rc5.h new file mode 100644 index 0000000000..793f88e4e8 --- /dev/null +++ b/openssl/openssl/rc5.h @@ -0,0 +1,63 @@ +/* + * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_RC5_H +# define HEADER_RC5_H + +# include + +# ifndef OPENSSL_NO_RC5 +# ifdef __cplusplus +extern "C" { +# endif + +# define RC5_ENCRYPT 1 +# define RC5_DECRYPT 0 + +# define RC5_32_INT unsigned int + +# define RC5_32_BLOCK 8 +# define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */ + +/* + * This are the only values supported. Tweak the code if you want more The + * most supported modes will be RC5-32/12/16 RC5-32/16/8 + */ +# define RC5_8_ROUNDS 8 +# define RC5_12_ROUNDS 12 +# define RC5_16_ROUNDS 16 + +typedef struct rc5_key_st { + /* Number of rounds */ + int rounds; + RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)]; +} RC5_32_KEY; + +void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, + int rounds); +void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out, + RC5_32_KEY *key, int enc); +void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key); +void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key); +void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out, + long length, RC5_32_KEY *ks, unsigned char *iv, + int enc); +void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, RC5_32_KEY *schedule, + unsigned char *ivec, int *num, int enc); +void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, RC5_32_KEY *schedule, + unsigned char *ivec, int *num); + +# ifdef __cplusplus +} +# endif +# endif + +#endif diff --git a/openssl/openssl/srp.h b/openssl/openssl/srp.h index d072536fec..028892a1ff 100644 --- a/openssl/openssl/srp.h +++ b/openssl/openssl/srp.h @@ -82,16 +82,21 @@ typedef struct SRP_gN_cache_st { DECLARE_STACK_OF(SRP_gN_cache) typedef struct SRP_user_pwd_st { + /* Owned by us. */ char *id; BIGNUM *s; BIGNUM *v; + /* Not owned by us. */ const BIGNUM *g; const BIGNUM *N; + /* Owned by us. */ char *info; } SRP_user_pwd; DECLARE_STACK_OF(SRP_user_pwd) +void SRP_user_pwd_free(SRP_user_pwd *user_pwd); + typedef struct SRP_VBASE_st { STACK_OF(SRP_user_pwd) *users_pwd; STACK_OF(SRP_gN_cache) *gN_cache; @@ -115,7 +120,12 @@ DECLARE_STACK_OF(SRP_gN) SRP_VBASE *SRP_VBASE_new(char *seed_key); int SRP_VBASE_free(SRP_VBASE *vb); int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); + +/* This method ignores the configured seed and fails for an unknown user. */ SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); +/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ +SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); + char *SRP_create_verifier(const char *user, const char *pass, char **salt, char **verifier, const char *N, const char *g); int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, diff --git a/openssl/openssl/ssl.h b/openssl/openssl/ssl.h index 6fe1a2474d..5ef56faa50 100644 --- a/openssl/openssl/ssl.h +++ b/openssl/openssl/ssl.h @@ -338,7 +338,7 @@ extern "C" { * The following cipher list is used by default. It also is substituted when * an application-defined cipher list string starts with 'DEFAULT'. */ -# define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!aNULL:!eNULL:!SSLv2" +# define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!LOW:!aNULL:!eNULL:!SSLv2" /* * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always * starts with a reasonable order, and all we have to do for DEFAULT is @@ -625,7 +625,7 @@ struct ssl_session_st { # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L /* If set, always create a new key when using tmp_ecdh parameters */ # define SSL_OP_SINGLE_ECDH_USE 0x00080000L -/* If set, always create a new key when using tmp_dh parameters */ +/* Does nothing: retained for compatibility */ # define SSL_OP_SINGLE_DH_USE 0x00100000L /* Does nothing: retained for compatibiity */ # define SSL_OP_EPHEMERAL_RSA 0x0 @@ -2092,7 +2092,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -2345,7 +2345,7 @@ const char *SSL_get_version(const SSL *s); /* This sets the 'default' SSL version that SSL_new() will create */ int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth); -# ifndef OPENSSL_NO_SSL2 +# ifndef OPENSSL_NO_SSL2_METHOD const SSL_METHOD *SSLv2_method(void); /* SSLv2 */ const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */ const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */ @@ -2681,6 +2681,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292 # define SSL_F_SSL3_ENC 134 # define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 +# define SSL_F_SSL3_GENERATE_MASTER_SECRET 388 # define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 # define SSL_F_SSL3_GET_CERT_STATUS 289 # define SSL_F_SSL3_GET_CERT_VERIFY 136 @@ -2846,8 +2847,11 @@ void ERR_load_SSL_strings(void); # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 # define SSL_R_BAD_DECOMPRESSION 107 # define SSL_R_BAD_DH_G_LENGTH 108 +# define SSL_R_BAD_DH_G_VALUE 375 # define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 # define SSL_R_BAD_DH_P_LENGTH 110 +# define SSL_R_BAD_DH_P_VALUE 395 # define SSL_R_BAD_DIGEST_LENGTH 111 # define SSL_R_BAD_DSA_SIGNATURE 112 # define SSL_R_BAD_ECC_CERT 304 @@ -3052,6 +3056,7 @@ void ERR_load_SSL_strings(void); # define SSL_R_SERVERHELLO_TLSEXT 275 # define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 # define SSL_R_SHORT_READ 219 +# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407 # define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 # define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 # define SSL_R_SRP_A_CALC 361 diff --git a/openssl/openssl/tls1.h b/openssl/openssl/tls1.h index 5929607ff8..7e237d0631 100644 --- a/openssl/openssl/tls1.h +++ b/openssl/openssl/tls1.h @@ -231,13 +231,12 @@ extern "C" { /* ExtensionType value from RFC5620 */ # define TLSEXT_TYPE_heartbeat 15 -/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */ +/* ExtensionType value from RFC7301 */ # define TLSEXT_TYPE_application_layer_protocol_negotiation 16 /* * ExtensionType value for TLS padding extension. - * http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml - * http://tools.ietf.org/html/draft-agl-tls-padding-03 + * http://tools.ietf.org/html/draft-agl-tls-padding */ # define TLSEXT_TYPE_padding 21 @@ -262,20 +261,19 @@ extern "C" { # define TLSEXT_TYPE_next_proto_neg 13172 # endif -/* NameType value from RFC 3546 */ +/* NameType value from RFC3546 */ # define TLSEXT_NAMETYPE_host_name 0 -/* status request value from RFC 3546 */ +/* status request value from RFC3546 */ # define TLSEXT_STATUSTYPE_ocsp 1 -/* ECPointFormat values from draft-ietf-tls-ecc-12 */ +/* ECPointFormat values from RFC4492 */ # define TLSEXT_ECPOINTFORMAT_first 0 # define TLSEXT_ECPOINTFORMAT_uncompressed 0 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 # define TLSEXT_ECPOINTFORMAT_last 2 -/* Signature and hash algorithms from RFC 5246 */ - +/* Signature and hash algorithms from RFC5246 */ # define TLSEXT_signature_anonymous 0 # define TLSEXT_signature_rsa 1 # define TLSEXT_signature_dsa 2 @@ -430,7 +428,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 /* AES ciphersuites from RFC3268 */ - # define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F # define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 # define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 @@ -595,7 +592,7 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" # define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" -/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ +/* ECC ciphersuites from RFC4492 */ # define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" # define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" # define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" diff --git a/openssl/openssl/ui.h b/openssl/openssl/ui.h index b917edab3a..0dc16330b8 100644 --- a/openssl/openssl/ui.h +++ b/openssl/openssl/ui.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/openssl/openssl/ui_compat.h b/openssl/openssl/ui_compat.h index 42fb9ff650..bf541542c0 100644 --- a/openssl/openssl/ui_compat.h +++ b/openssl/openssl/ui_compat.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/openssl/openssl/x509.h b/openssl/openssl/x509.h index 99337b849a..fc613ce635 100644 --- a/openssl/openssl/x509.h +++ b/openssl/openssl/x509.h @@ -1305,6 +1305,7 @@ void ERR_load_X509_strings(void); # define X509_R_LOADING_CERT_DIR 103 # define X509_R_LOADING_DEFAULTS 104 # define X509_R_METHOD_NOT_SUPPORTED 124 +# define X509_R_NAME_TOO_LONG 134 # define X509_R_NEWER_CRL_NOT_NEWER 132 # define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 105 # define X509_R_NO_CRL_NUMBER 130 diff --git a/openssl/openssl/x509_vfy.h b/openssl/openssl/x509_vfy.h index bd8613c62b..2663e1c0a3 100644 --- a/openssl/openssl/x509_vfy.h +++ b/openssl/openssl/x509_vfy.h @@ -313,7 +313,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) # define X509_V_OK 0 -/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */ +# define X509_V_ERR_UNSPECIFIED 1 # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 # define X509_V_ERR_UNABLE_TO_GET_CRL 3 diff --git a/thirdparty/AFNetworking/AFHTTPClient.m b/thirdparty/AFNetworking/AFHTTPClient.m index 753bab67ae..8ac818423b 100644 --- a/thirdparty/AFNetworking/AFHTTPClient.m +++ b/thirdparty/AFNetworking/AFHTTPClient.m @@ -277,7 +277,7 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) { #if __IPHONE_OS_VERSION_MIN_REQUIRED // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 - [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (%@, %@ %@, %@, Scale/%f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey], @"unknown", [[UIDevice currentDevice] systemName], [[UIDevice currentDevice] systemVersion], [[UIDevice currentDevice] model], ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0)]]; + [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (%@, %@ %@, %@, Scale/%f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey], @"unknown", @"iOS", @"unknown", @"iOS", (2.0)]]; #elif __MAC_OS_X_VERSION_MIN_REQUIRED [self setDefaultHeader:@"User-Agent" value:[NSString stringWithFormat:@"%@/%@ (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey], @"unknown"]]; #endif diff --git a/thirdparty/AsyncSocket/GCDAsyncSocket.m b/thirdparty/AsyncSocket/GCDAsyncSocket.m index 1f404d618b..2f199a686e 100755 --- a/thirdparty/AsyncSocket/GCDAsyncSocket.m +++ b/thirdparty/AsyncSocket/GCDAsyncSocket.m @@ -10,7 +10,7 @@ #import "GCDAsyncSocket.h" -#import +#import "MTLogging.h" #if TARGET_OS_IPHONE #import