Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
fix openssl 1.0 / 1.1 error
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Jun 15, 2020
1 parent 5b020d1 commit 105c2f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
Package.pins
Package.resolved
DerivedData
.swiftpm

8 changes: 4 additions & 4 deletions Sources/Crypto/RSA/RSAKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ final class CRSAKey {
throw CryptoError.openssl(identifier: "rsax509", reason: "Certificate decoding failed")
}

guard let x509 = derDecoded.withByteBuffer({ bufferPointer -> UnsafeMutablePointer<X509>? in
guard let x509 = derDecoded.withByteBuffer({ bufferPointer -> OpaquePointer? in
var base = bufferPointer.baseAddress
let count = bufferPointer.count
return d2i_X509(nil, &base, count)
return d2i_X509(nil, &base, count)?.convert()
}) else {
throw CryptoError.openssl(identifier: "rsax509", reason: "Key creation from certificate failed")
}

defer { X509_free(x509) }
maybePkey = X509_get_pubkey(x509)?.convert()
defer { X509_free(x509.convert()) }
maybePkey = X509_get_pubkey(x509.convert())?.convert()
} else if x509 {
guard let x509 = PEM_read_bio_X509(bio, nil, nil, nil) else {
throw CryptoError.openssl(identifier: "rsax509", reason: "Key creation from certificate failed")
Expand Down
5 changes: 0 additions & 5 deletions test.Dockerfile

This file was deleted.

0 comments on commit 105c2f8

Please sign in to comment.