Skip to content

Commit

Permalink
Swiftlint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Pivovarov committed Apr 9, 2019
1 parent e354e0d commit 2e23386
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ opt_in_rules:
- explicit_acl
- explicit_enum_raw_value
- explicit_init
- explicit_top_level_acl
- extension_access_modifier
- file_header
- first_where
Expand Down
18 changes: 9 additions & 9 deletions Source/Crypto/KeyknoxCrypto.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,28 @@ extension KeyknoxCrypto: KeyknoxCryptoProtocol {
guard !data.isEmpty else {
throw KeyknoxCryptoError.emptyData
}

let signature = try self.crypto.generateSignature(of: data, using: privateKey)

let aesGcm = Aes256Gcm()
let cipher = RecipientCipher()

cipher.setEncryptionCipher(encryptionCipher: aesGcm)
cipher.setRandom(random: self.crypto.rng)

publicKeys.forEach {
cipher.addKeyRecipient(recipientId: $0.identifier, publicKey: $0.publicKey)
}

cipher.customParams().addData(key: VirgilCrypto.CustomParamKeySignature, value: signature)
cipher.customParams().addData(key: VirgilCrypto.CustomParamKeySignerId, value: privateKey.identifier)

try cipher.startEncryption()

let meta = cipher.packMessageInfo()

var encryptedData = try cipher.processEncryption(data: data)

encryptedData += try cipher.finishEncryption()

return (meta, encryptedData)
Expand Down
5 changes: 3 additions & 2 deletions Source/SyncKeyStorage/SyncKeyStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ import VirgilCrypto
internal let keychainUtils: KeychainUtils

private let queue = DispatchQueue(label: "SyncKeyStorageQueue")

/// Creates local key storage instance, to read keys withoud connecting to the Cloud
///
/// - Parameters:
/// - identity: User's identity to separate keys in Keychain
/// - keychainStorage: KeychainStorageProtocol implementation
/// - Returns: returns KeychainStorageProtocol
public static func makeLocalStorage(identity: String, keychainStorage: KeychainStorageProtocol) -> KeychainStorageProtocol {
public static func makeLocalStorage(identity: String,
keychainStorage: KeychainStorageProtocol) -> KeychainStorageProtocol {
return SandboxedKeychainStorage(identity: identity, keychainStorage: keychainStorage)
}

Expand Down
12 changes: 0 additions & 12 deletions VirgilSDKKeyknox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1316,9 +1316,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "KeyknoxTestApp iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1327,7 +1325,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.virgilsecurity.KeyknoxTestApp-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -1337,9 +1334,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "KeyknoxTestApp iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -1348,7 +1343,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.virgilsecurity.KeyknoxTestApp-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -1357,9 +1351,7 @@
42011E9B20CE8FE400B84755 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand All @@ -1372,7 +1364,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.virgilsecurity.VirgilSDKKeyknox-AppTests-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/KeyknoxTestApp iOS.app/KeyknoxTestApp iOS";
Expand All @@ -1382,9 +1373,7 @@
42011E9C20CE8FE400B84755 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
Expand All @@ -1397,7 +1386,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "com.virgilsecurity.VirgilSDKKeyknox-AppTests-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/KeyknoxTestApp iOS.app/KeyknoxTestApp iOS";
Expand Down

0 comments on commit 2e23386

Please sign in to comment.