Skip to content

Commit

Permalink
Prepare 1.6.0 (#139)
Browse files Browse the repository at this point in the history
* [1-6] Bump version to 1.6.0

* [1-6] Prepare 1.6.0 for release

* [1-6] Change documentation comment format

* [1-6] Update documenation again

* [1-6] Add missing word

* [1-6] Fix typos and layout of codumentation comment

* Update CHANGELOG.md

Co-Authored-By: daniel-mohemian <[email protected]>
  • Loading branch information
Daniel authored Jan 25, 2019
1 parent 1fc14e4 commit ba1b664
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion JOSESwift.podspec
Original file line number Diff line number Diff line change
@@ -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" => "[email protected]", "Carol Capek" => "[email protected]", "Christoph Gigi Fuchs" => "[email protected]" }
Expand Down
20 changes: 10 additions & 10 deletions JOSESwift/Sources/CryptoImplementation/RSA.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion JOSESwift/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>1.6.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.0</string>
<string>1.6.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down

0 comments on commit ba1b664

Please sign in to comment.