parent
02a20b5308
commit
b9243c9f0b
|
@ -35,8 +35,12 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import __TunnelKitNative
|
||||
|
||||
struct CoreConfiguration {
|
||||
static let identifier = "com.algoritmico.TunnelKit"
|
||||
|
||||
static let version = "1.1.0-dev"
|
||||
|
||||
// MARK: Session
|
||||
|
||||
|
@ -58,8 +62,11 @@ struct CoreConfiguration {
|
|||
|
||||
static let peerInfo = [
|
||||
"IV_VER=2.4",
|
||||
"IV_PLAT=mac",
|
||||
"IV_UI_VER=\(identifier) \(version)",
|
||||
"IV_PROTO=2",
|
||||
"IV_NCP=2",
|
||||
"IV_SSL=\(CryptoBox.version())",
|
||||
""
|
||||
].joined(separator: "\n")
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
@interface CryptoBox : NSObject
|
||||
|
||||
+ (NSString *)version;
|
||||
+ (BOOL)preparePRNGWithSeed:(const uint8_t *)seed length:(NSInteger)length;
|
||||
|
||||
- (instancetype)initWithCipherAlgorithm:(nullable NSString *)cipherAlgorithm
|
||||
|
@ -66,6 +67,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
hmacLength:(NSInteger *)hmacLength
|
||||
error:(NSError **)error;
|
||||
|
||||
|
||||
// encrypt/decrypt are mutually thread-safe
|
||||
- (id<Encrypter>)encrypter;
|
||||
- (id<Decrypter>)decrypter;
|
||||
|
|
|
@ -63,6 +63,11 @@
|
|||
{
|
||||
}
|
||||
|
||||
+ (NSString *)version
|
||||
{
|
||||
return [NSString stringWithCString:OpenSSL_version(OPENSSL_VERSION) encoding:NSASCIIStringEncoding];
|
||||
}
|
||||
|
||||
+ (BOOL)preparePRNGWithSeed:(const uint8_t *)seed length:(NSInteger)length
|
||||
{
|
||||
unsigned char x[1];
|
||||
|
|
Loading…
Reference in New Issue