mirror of https://github.com/oxen-io/session-ios
				
				
				
			Clean up ahead of PR.
							parent
							
								
									0cc7f3e00e
								
							
						
					
					
						commit
						d8f72dbec5
					
				@ -1,11 +0,0 @@
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#import "sqlite3.h"
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
NSData *_Nullable ExtractDatabaseKeySpec(sqlite3 *db);
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
@ -1,29 +0,0 @@
 | 
			
		||||
//
 | 
			
		||||
//  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
#import "OWSDatabaseUtils.h"
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_BEGIN
 | 
			
		||||
 | 
			
		||||
extern "C" {
 | 
			
		||||
extern void sqlite3CodecGetKey(sqlite3 *db, int nDb, void **zKey, int *nKey);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NSData *_Nullable ExtractDatabaseKeySpec(sqlite3 *db)
 | 
			
		||||
{
 | 
			
		||||
    char *keySpecBytes = NULL;
 | 
			
		||||
    int keySpecLength = 0;
 | 
			
		||||
    sqlite3CodecGetKey(db, 0, (void **)&keySpecBytes, &keySpecLength);
 | 
			
		||||
    if (!keySpecBytes || keySpecLength < 1) {
 | 
			
		||||
        return nil;
 | 
			
		||||
    }
 | 
			
		||||
    NSData *_Nullable keySpecData = [NSData dataWithBytes:keySpecBytes length:(NSUInteger)keySpecLength];
 | 
			
		||||
    if (!keySpecData) {
 | 
			
		||||
        return nil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return keySpecData;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NS_ASSUME_NONNULL_END
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue