Skip to content
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

Typealias CryptoKitError #285

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ What this means for you is that you should depend on Swift Crypto with a version
In SwiftPM that can be easily done specifying for example `from: "1.0.0"` meaning that you support Swift Crypto in every version starting from 1.0.0 up to (excluding) 2.0.0.
SemVer and Swift Crypto's Public API guarantees should result in a working program without having to worry about testing every single version for compatibility.

Swift Crypto 2.0.0 was released in September 2021. The only breaking change between Swift Crypto 2.0.0 and 1.0.0 was the addition of new cases in the `CryptoKitError` enumeration. For most users, then, it's safe to depend on either the 1.0.0 _or_ 2.0.0 series of releases.
Swift Crypto 2.0.0 was released in September 2021. The only breaking change between Swift Crypto 2.0.0 and 1.0.0 was the addition of new cases in the `CryptoError` enumeration. For most users, then, it's safe to depend on either the 1.0.0 _or_ 2.0.0 series of releases.

To do so, please use the following dependency in your `Package.swift`:

Expand Down
4 changes: 2 additions & 2 deletions Sources/Crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_library(Crypto
"ASN1/PKCS8PrivateKey.swift"
"ASN1/SEC1PrivateKey.swift"
"ASN1/SubjectPublicKeyInfo.swift"
"CryptoKitErrors.swift"
"CryptoErrors.swift"
"Digests/BoringSSL/Digest_boring.swift"
"Digests/Digest.swift"
"Digests/Digests.swift"
Expand Down Expand Up @@ -84,7 +84,7 @@ add_library(Crypto
"Signatures/ECDSA.swift"
"Signatures/Ed25519.swift"
"Signatures/Signature.swift"
"Util/BoringSSL/CryptoKitErrors_boring.swift"
"Util/BoringSSL/CryptoErrors_boring.swift"
"Util/BoringSSL/RNG_boring.swift"
"Util/BoringSSL/SafeCompare_boring.swift"
"Util/BoringSSL/Zeroization_boring.swift"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ public enum CryptoKitASN1Error: Equatable, Error, Hashable {
case invalidPEMDocument
}
#endif

public typealias CryptoError = CryptoKitError
@available(iOS 14, macOS 11, tvOS 14, watchOS 7, *)
public typealias CryptoASN1Error = CryptoKitASN1Error
2 changes: 1 addition & 1 deletion Sources/CryptoBoringWrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

add_library(CryptoBoringWrapper STATIC
"AEAD/BoringSSLAEAD.swift"
"CryptoKitErrors_boring.swift"
"CryptoErrors_boring.swift"
"EC/EllipticCurve.swift"
"EC/EllipticCurvePoint.swift"
"Util/ArbitraryPrecisionInteger.swift"
Expand Down
2 changes: 1 addition & 1 deletion Sources/_CryptoExtras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ add_library(_CryptoExtras
"RSA/RSA_boring.swift"
"RSA/RSA_security.swift"
"Util/BoringSSLHelpers.swift"
"Util/CryptoKitErrors_boring.swift"
"Util/CryptoErrors_boring.swift"
"Util/DigestType.swift"
"Util/Error.swift"
"Util/PEMDocument.swift"
Expand Down
4 changes: 2 additions & 2 deletions Sources/_CryptoExtras/RSA/RSA+BlindSigning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ extension _RSA.BlindSigning.PublicKey {
extension _RSA.BlindSigning {
/// Errors defined in the RSA Blind Signatures protocol.
///
/// - NOTE: This type does not conform to `Swift.Error`, it is used to construct a `CryptoKitError`.
/// - NOTE: This type does not conform to `Swift.Error`, it is used to construct a `CryptoError`.
///
/// - Seealso: [RFC 9474: Errors](https://www.rfc-editor.org/rfc/rfc9474.html#name-errors).
enum ProtocolError {
Expand All @@ -490,7 +490,7 @@ extension _RSA.BlindSigning {
}

extension CryptoKitError {
/// Map an error from the RSA Blind Signatures protocol to a CryptoKitError.
/// Map an error from the RSA Blind Signatures protocol to a CryptoError.
init(_ error: _RSA.BlindSigning.ProtocolError) {
switch error {
case .messageTooLong:
Expand Down