New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Ubuntu 14.04 and OpenSSL 1.0.1 #17
Conversation
.swiftlint.yml
Outdated
- trailing_newline | ||
- force_cast | ||
- function_body_length | ||
- variable_name | ||
- indentifier_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely identifier_name
?
@@ -467,7 +499,12 @@ class CryptorRSATests: XCTestCase { | |||
// JWT also does base64url encoding, so make the proper replacements so its proper base64 encoding | |||
sig = sig.replacingOccurrences(of: "-", with: "+") | |||
sig = sig.replacingOccurrences(of: "_", with: "/") | |||
let sigData = Data(base64Encoded: sig)! | |||
|
|||
guard let sigData: Data = Data(base64Encoded: sig) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to let the compiler infer the type I think.
@@ -445,11 +476,12 @@ class CryptorRSATests: XCTestCase { | |||
-----END PUBLIC KEY----- | |||
""" | |||
|
|||
let tokenPublicKey = try? CryptorRSA.createPublicKey(withPEM: certificatePEM) | |||
let tokenPublicKey = try CryptorRSA.createPublicKey(withPEM: certificatePEM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to guard let
this, XCTFail(); return
in the else
, and remove the XCTAssertNotNil()
below.
@KyeMaloy97: Are you still working on this? The CI checks are failing. Thanks. |
@billabt Yea I am still working on it, I am working on removing force unwraps in the Test suite to get the Swift Linter to pass |
Cool, I’ll take a look either later today or first thing in the morning. |
There is an issue where systems using an older version of OpenSSL are not able to build, due to a type mismatch. The PR links to a branch I have made of the OpenSSL module map which now has a wrapper around the method in question (EVP_DigestVerifyFinal) to stop Swift complaining due to a type mismatch.
When the OpenSSL branch is merged into master, I will update this PR to point to the release that contains the fix, rather than the branch. Opening this now so Travis can do some testing.