diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e347d9c..0f379d45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ merge to master and move them to a respective version upon release. Add your changes here. +## [1.6.0] - 2019-01-25 + +- Adds support for RSA-OAEP-256 ([#135](https://github.com/airsidemobile/JOSESwift/pull/135)) + ## [1.5.0] - 2019-01-23 - Changes the way elliptic curve keys are decoded to work around [#86](https://github.com/airsidemobile/JOSESwift/issues/86) until [#120](https://github.com/airsidemobile/JOSESwift/pull/120) is merged ([#137](https://github.com/airsidemobile/JOSESwift/pull/137)) diff --git a/JOSESwift.podspec b/JOSESwift.podspec index 6208130b..7556712a 100644 --- a/JOSESwift.podspec +++ b/JOSESwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "JOSESwift" - s.version = "1.5.0" + s.version = "1.6.0" s.license = "Apache License, Version 2.0" s.summary = "JOSE framework for Swift" s.authors = { "Daniel Egger" => "daniel.egger@airsidemobile.com", "Carol Capek" => "carol.capek@airsidemobile.com", "Christoph Gigi Fuchs" => "christoph.fuchs@airsidemobile.com" } diff --git a/JOSESwift/Sources/CryptoImplementation/RSA.swift b/JOSESwift/Sources/CryptoImplementation/RSA.swift index 2939c1db..75f2b4ce 100644 --- a/JOSESwift/Sources/CryptoImplementation/RSA.swift +++ b/JOSESwift/Sources/CryptoImplementation/RSA.swift @@ -60,22 +60,22 @@ internal extension AsymmetricKeyAlgorithm { } } - /** - This method returns the maximum message length allow for an Asymmetric Algorithm - - parameters: - - publicKey: SecKey the publicKey used to acquire the SecKey block size - - returns: Int the maximum length allowed - discussion: - - RSA1_5: For detailed information about the allowed plain text length for RSAES-PKCS1-v1_5, please refer to the RFC(https://tools.ietf.org/html/rfc3447#section-7.2) - - RSAOAEP256: For detailed information about the allowed plain text length for RSA-OAEP, please refer to the RFC(https://tools.ietf.org/html/rfc3447#section-7.1) - */ + + /// This method returns the maximum message length allowed for an `AsymmetricKeyAlgorithm`. + /// - Parameter publicKey: The publicKey used with the algorithm. + /// - Returns: The maximum message length allowed for use with the algorithm. + /// + /// - RSA1_5: For detailed information about the allowed plain text length for RSAES-PKCS1-v1_5, + /// please refer to [RFC-3447, Section 7.2](https://tools.ietf.org/html/rfc3447#section-7.2). + /// - RSAOAEP256: For detailed information about the allowed plain text length for RSA-OAEP, + /// please refer to [RFC-3447, Section 7.1](https://tools.ietf.org/html/rfc3447#section-7.1). func maxMessageLength(for publicKey: SecKey) -> Int { let k = SecKeyGetBlockSize(publicKey) switch self { case .RSA1_5: return (k - 11) case .RSAOAEP256: - /// hash length calculation based on SHA-256 algorithm + // The maximum plaintext length is based on the hash length of SHA-256. let hLen = 256 / 8 return (k - 2 * hLen - 2) case .direct: return 0 diff --git a/JOSESwift/Support/Info.plist b/JOSESwift/Support/Info.plist index ad178db7..afe8e745 100644 --- a/JOSESwift/Support/Info.plist +++ b/JOSESwift/Support/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.5.0 + 1.6.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Tests/Info.plist b/Tests/Info.plist index 73b43fb5..241d6a38 100644 --- a/Tests/Info.plist +++ b/Tests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.5.0 + 1.6.0 CFBundleVersion 1