diff --git a/Example/Podfile.lock b/Example/Podfile.lock index ed8dd2694..dd54b554d 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,7 +1,7 @@ PODS: - - CryptoSwift (1.8.0) + - CryptoSwift (1.8.1) - nRFMeshProvision (4.1.0): - - CryptoSwift (= 1.8.0) + - CryptoSwift (= 1.8.1) DEPENDENCIES: - nRFMeshProvision (from `../`) @@ -15,9 +15,9 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - CryptoSwift: 52aaf3fce7337552863b1d952e408085f0e65030 - nRFMeshProvision: 8594edb22fa5ed7abfe275105acd870ee58da1dc + CryptoSwift: b9c701d6f5011df23794dbf7f2e480a77835d83d + nRFMeshProvision: 26b5b888df3816309166425efba30e124df1ae0d PODFILE CHECKSUM: 798fe4d826703f91673f9c99ff182b2dfa6655f4 -COCOAPODS: 1.13.0 +COCOAPODS: 1.15.2 diff --git a/Example/Pods/CryptoSwift/README.md b/Example/Pods/CryptoSwift/README.md index 4d2cc3bb7..c24c8ffd1 100644 --- a/Example/Pods/CryptoSwift/README.md +++ b/Example/Pods/CryptoSwift/README.md @@ -131,7 +131,7 @@ It is recommended to enable [Whole-Module Optimization](https://swift.org/blog/w You can use [Swift Package Manager](https://swift.org/package-manager/) and specify dependency in `Package.swift` by adding this: ```swift -.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMajor(from: "1.8.0")) +.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMajor(from: "1.8.1")) ``` See: [Package.swift - manual](https://blog.krzyzanowskim.com/2016/08/09/package-swift-manual/) @@ -143,7 +143,7 @@ Notice: Swift Package Manager uses debug configuration for debug Xcode build, th You can use [CocoaPods](https://cocoapods.org/pods/CryptoSwift). ```ruby -pod 'CryptoSwift', '~> 1.8.0' +pod 'CryptoSwift', '~> 1.8.1' ``` Bear in mind that CocoaPods will build CryptoSwift without [Whole-Module Optimization](https://swift.org/blog/whole-module-optimizations/) that may impact performance. You can change it manually after installation, or use [cocoapods-wholemodule](https://github.com/jedlewison/cocoapods-wholemodule) plugin. diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockDecryptor.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockDecryptor.swift index 02052ff4f..505ac362f 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockDecryptor.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockDecryptor.swift @@ -13,6 +13,11 @@ // public class BlockDecryptor: Cryptor, Updatable { + + public enum Error: Swift.Error { + case unsupported + } + @usableFromInline let blockSize: Int @@ -87,7 +92,7 @@ public class BlockDecryptor: Cryptor, Updatable { public func seek(to position: Int) throws { guard var worker = self.worker as? SeekableModeWorker else { - fatalError("Not supported") + throw Error.unsupported } try worker.seek(to: position) diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockEncryptor.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockEncryptor.swift index 12dba2c82..7352d50e7 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockEncryptor.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/BlockEncryptor.swift @@ -14,6 +14,11 @@ @usableFromInline final class BlockEncryptor: Cryptor, Updatable { + + public enum Error: Swift.Error { + case unsupported + } + private let blockSize: Int private var worker: CipherModeWorker private let padding: Padding @@ -57,6 +62,6 @@ final class BlockEncryptor: Cryptor, Updatable { @usableFromInline func seek(to: Int) throws { - fatalError("Not supported") + throw Error.unsupported } } diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/PKCS/PKCS7Padding.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/PKCS/PKCS7Padding.swift index 857358523..2b43ab6ca 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/PKCS/PKCS7Padding.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/PKCS/PKCS7Padding.swift @@ -28,15 +28,8 @@ struct PKCS7Padding: PaddingProtocol { @inlinable func add(to bytes: Array, blockSize: Int) -> Array { let padding = UInt8(blockSize - (bytes.count % blockSize)) - var withPadding = bytes - if padding == 0 { - // If the original data is a multiple of N bytes, then an extra block of bytes with value N is added. - withPadding += Array(repeating: UInt8(blockSize), count: Int(blockSize)) - } else { - // The value of each added byte is the number of bytes that are added - withPadding += Array(repeating: padding, count: Int(padding)) - } - return withPadding + // The value of each added byte is the number of bytes that are added + return bytes + Array(repeating: padding, count: Int(padding)) } @inlinable diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA+Signature.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA+Signature.swift index a20eb68bd..7b1909c4a 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA+Signature.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA+Signature.swift @@ -121,6 +121,12 @@ extension RSA { case message_pkcs1v15_SHA512_224 /// Hashes the raw message using SHA512-256 before signing the data case message_pkcs1v15_SHA512_256 + /// Hashes the raw message using SHA3_256 before signing the data + case message_pkcs1v15_SHA3_256 + /// Hashes the raw message using SHA3_384 before signing the data + case message_pkcs1v15_SHA3_384 + /// Hashes the raw message using SHA3_512 before signing the data + case message_pkcs1v15_SHA3_512 /// This variant isn't supported yet case digest_pkcs1v15_RAW /// This variant expects that the data to be signed is a valid MD5 Hash Digest @@ -139,7 +145,13 @@ extension RSA { case digest_pkcs1v15_SHA512_224 /// This variant expects that the data to be signed is a valid SHA512-256 Hash Digest case digest_pkcs1v15_SHA512_256 - + /// This variant expects that the data to be signed is a valid SHA3-256 Hash Digest + case digest_pkcs1v15_SHA3_256 + /// This variant expects that the data to be signed is a valid SHA3-384 Hash Digest + case digest_pkcs1v15_SHA3_384 + /// This variant expects that the data to be signed is a valid SHA3-512 Hash Digest + case digest_pkcs1v15_SHA3_512 + internal var identifier: Array { switch self { case .raw, .digest_pkcs1v15_RAW: return [] @@ -151,9 +163,12 @@ extension RSA { case .message_pkcs1v15_SHA224, .digest_pkcs1v15_SHA224: return Array(arrayLiteral: 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04) case .message_pkcs1v15_SHA512_224, .digest_pkcs1v15_SHA512_224: return Array(arrayLiteral: 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x05) case .message_pkcs1v15_SHA512_256, .digest_pkcs1v15_SHA512_256: return Array(arrayLiteral: 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x06) + case .message_pkcs1v15_SHA3_256, .digest_pkcs1v15_SHA3_256: return Array(arrayLiteral: 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x08) + case .message_pkcs1v15_SHA3_384, .digest_pkcs1v15_SHA3_384: return Array(arrayLiteral: 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x09) + case .message_pkcs1v15_SHA3_512, .digest_pkcs1v15_SHA3_512: return Array(arrayLiteral: 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x0A) } } - + internal func calculateHash(_ bytes: Array) -> Array { switch self { case .message_pkcs1v15_MD5: @@ -172,20 +187,29 @@ extension RSA { return Digest.sha2(bytes, variant: .sha224) case .message_pkcs1v15_SHA512_256: return Digest.sha2(bytes, variant: .sha256) + case .message_pkcs1v15_SHA3_256: + return Digest.sha3(bytes, variant: .sha256) + case .message_pkcs1v15_SHA3_384: + return Digest.sha3(bytes, variant: .sha384) + case .message_pkcs1v15_SHA3_512: + return Digest.sha3(bytes, variant: .sha512) case .raw, - .digest_pkcs1v15_RAW, - .digest_pkcs1v15_MD5, - .digest_pkcs1v15_SHA1, - .digest_pkcs1v15_SHA224, - .digest_pkcs1v15_SHA256, - .digest_pkcs1v15_SHA384, - .digest_pkcs1v15_SHA512, - .digest_pkcs1v15_SHA512_224, - .digest_pkcs1v15_SHA512_256: - return bytes + .digest_pkcs1v15_RAW, + .digest_pkcs1v15_MD5, + .digest_pkcs1v15_SHA1, + .digest_pkcs1v15_SHA224, + .digest_pkcs1v15_SHA256, + .digest_pkcs1v15_SHA384, + .digest_pkcs1v15_SHA512, + .digest_pkcs1v15_SHA512_224, + .digest_pkcs1v15_SHA512_256, + .digest_pkcs1v15_SHA3_256, + .digest_pkcs1v15_SHA3_384, + .digest_pkcs1v15_SHA3_512: + return bytes } } - + internal func enforceLength(_ bytes: Array, keySizeInBytes: Int) -> Bool { switch self { case .raw, .digest_pkcs1v15_RAW: @@ -196,25 +220,28 @@ extension RSA { return bytes.count <= 20 case .digest_pkcs1v15_SHA224: return bytes.count <= 28 - case .digest_pkcs1v15_SHA256: + case .digest_pkcs1v15_SHA256, .digest_pkcs1v15_SHA3_256: return bytes.count <= 32 - case .digest_pkcs1v15_SHA384: + case .digest_pkcs1v15_SHA384, .digest_pkcs1v15_SHA3_384: return bytes.count <= 48 - case .digest_pkcs1v15_SHA512: + case .digest_pkcs1v15_SHA512, .digest_pkcs1v15_SHA3_512: return bytes.count <= 64 case .digest_pkcs1v15_SHA512_224: return bytes.count <= 28 case .digest_pkcs1v15_SHA512_256: return bytes.count <= 32 case .message_pkcs1v15_MD5, - .message_pkcs1v15_SHA1, - .message_pkcs1v15_SHA224, - .message_pkcs1v15_SHA256, - .message_pkcs1v15_SHA384, - .message_pkcs1v15_SHA512, - .message_pkcs1v15_SHA512_224, - .message_pkcs1v15_SHA512_256: - return true + .message_pkcs1v15_SHA1, + .message_pkcs1v15_SHA224, + .message_pkcs1v15_SHA256, + .message_pkcs1v15_SHA384, + .message_pkcs1v15_SHA512, + .message_pkcs1v15_SHA512_224, + .message_pkcs1v15_SHA512_256, + .message_pkcs1v15_SHA3_256, + .message_pkcs1v15_SHA3_384, + .message_pkcs1v15_SHA3_512: + return true } } diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA.swift index 509545497..7e298e81c 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/RSA/RSA.swift @@ -283,10 +283,11 @@ extension RSA { /// ``` func publicKeyDER() throws -> Array { let mod = self.n.serialize() + let exp = self.e.serialize() let pubKeyAsnNode: ASN1.Node = .sequence(nodes: [ .integer(data: DER.i2ospData(x: mod.bytes, size: self.keySizeBytes)), - .integer(data: DER.i2ospData(x: self.e.serialize().bytes, size: 3)) + .integer(data: DER.i2ospData(x: exp.bytes, size: exp.bytes.count)) ]) return ASN1.Encoder.encode(pubKeyAsnNode) } diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamDecryptor.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamDecryptor.swift index 9ec829450..51171cf08 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamDecryptor.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamDecryptor.swift @@ -15,6 +15,11 @@ @usableFromInline final class StreamDecryptor: Cryptor, Updatable { + @usableFromInline + enum Error: Swift.Error { + case unsupported + } + @usableFromInline internal let blockSize: Int @@ -83,7 +88,7 @@ final class StreamDecryptor: Cryptor, Updatable { @inlinable public func seek(to position: Int) throws { guard var worker = self.worker as? SeekableModeWorker else { - fatalError("Not supported") + throw Error.unsupported } try worker.seek(to: position) diff --git a/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamEncryptor.swift b/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamEncryptor.swift index 73d25d76a..503f3c15b 100644 --- a/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamEncryptor.swift +++ b/Example/Pods/CryptoSwift/Sources/CryptoSwift/StreamEncryptor.swift @@ -15,6 +15,11 @@ @usableFromInline final class StreamEncryptor: Cryptor, Updatable { + @usableFromInline + enum Error: Swift.Error { + case unsupported + } + @usableFromInline internal let blockSize: Int @@ -63,6 +68,6 @@ final class StreamEncryptor: Cryptor, Updatable { @usableFromInline func seek(to: Int) throws { - fatalError("Not supported") + throw Error.unsupported } } diff --git a/Example/Pods/Local Podspecs/nRFMeshProvision.podspec.json b/Example/Pods/Local Podspecs/nRFMeshProvision.podspec.json index a6605e0df..92ea936c1 100644 --- a/Example/Pods/Local Podspecs/nRFMeshProvision.podspec.json +++ b/Example/Pods/Local Podspecs/nRFMeshProvision.podspec.json @@ -32,7 +32,7 @@ "resources": "nRFMeshProvision/Resources/PrivacyInfo.xcprivacy", "dependencies": { "CryptoSwift": [ - "= 1.8.0" + "= 1.8.1" ] }, "frameworks": "CoreBluetooth", diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index ed8dd2694..dd54b554d 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,7 +1,7 @@ PODS: - - CryptoSwift (1.8.0) + - CryptoSwift (1.8.1) - nRFMeshProvision (4.1.0): - - CryptoSwift (= 1.8.0) + - CryptoSwift (= 1.8.1) DEPENDENCIES: - nRFMeshProvision (from `../`) @@ -15,9 +15,9 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - CryptoSwift: 52aaf3fce7337552863b1d952e408085f0e65030 - nRFMeshProvision: 8594edb22fa5ed7abfe275105acd870ee58da1dc + CryptoSwift: b9c701d6f5011df23794dbf7f2e480a77835d83d + nRFMeshProvision: 26b5b888df3816309166425efba30e124df1ae0d PODFILE CHECKSUM: 798fe4d826703f91673f9c99ff182b2dfa6655f4 -COCOAPODS: 1.13.0 +COCOAPODS: 1.15.2 diff --git a/Example/Pods/Target Support Files/CryptoSwift/CryptoSwift-Info.plist b/Example/Pods/Target Support Files/CryptoSwift/CryptoSwift-Info.plist index fdebf4c2e..e446dd0f3 100644 --- a/Example/Pods/Target Support Files/CryptoSwift/CryptoSwift-Info.plist +++ b/Example/Pods/Target Support Files/CryptoSwift/CryptoSwift-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.8.0 + 1.8.1 CFBundleSignature ???? CFBundleVersion diff --git a/nRFMeshProvision.podspec b/nRFMeshProvision.podspec index 9dfede9df..ab4993736 100644 --- a/nRFMeshProvision.podspec +++ b/nRFMeshProvision.podspec @@ -25,6 +25,6 @@ Pod::Spec.new do |s| s.swift_versions = ['5.5', '5.6', '5.7', '5.8', '5.9'] s.source_files = 'nRFMeshProvision/**/*' s.resource = 'nRFMeshProvision/Resources/PrivacyInfo.xcprivacy' - s.dependency 'CryptoSwift', '= 1.8.0' + s.dependency 'CryptoSwift', '= 1.8.1' s.frameworks = 'CoreBluetooth' end