Add some more peer-info

- IV_PLAT
- IV_UI_VER
- IV_SSL
This commit is contained in:
Davide De Rosa 2018-09-12 01:17:40 +02:00
parent 02a20b5308
commit b9243c9f0b
3 changed files with 14 additions and 0 deletions

View File

@ -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")

View File

@ -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;

View File

@ -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];