Skip to content

Commit 969b50b

Browse files
Version 5.1.0
1 parent f266c3c commit 969b50b

File tree

43 files changed

+99
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+99
-45
lines changed

Cartfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
github "gematik/ref-GemCommonsKit" ~> 1.3
2-
github "gematik/asn1kit" ~> 1.1
3-
github "gematik/OpenSSL-Swift" ~> 3.0
2+
github "gematik/ASN1Kit" ~> 1.1
3+
github "gematik/OpenSSL-Swift" ~> 4.0
44
github "SwiftCommon/DataKit" ~> 1.0

Cartfile.resolved

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
github "gematik/asn1kit" "1.1.0"
2-
github "gematik/ref-GemCommonsKit" "1.3.0"
31
github "Quick/Nimble" "v9.2.1"
42
github "SwiftCommon/DataKit" "1.1.0"
5-
github "gematik/OpenSSL-Swift" "3.0.3"
3+
github "gematik/ASN1Kit" "1.1.0"
4+
github "gematik/OpenSSL-Swift" "4.0.0"
5+
github "gematik/ref-GemCommonsKit" "1.3.0"
66
github "hectr/swift-stream-reader" "0.3.0"
77
github "swiftsocket/SwiftSocket" "2e6ba27140a29fae8a6331ba4463312e0c71a6b0"
88
github "tadija/AEXML" "4.6.1"

OpenHealthCardKit.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4445,7 +4445,7 @@
44454445
repositoryURL = "https://github.com/pointfreeco/swift-snapshot-testing";
44464446
requirement = {
44474447
kind = upToNextMajorVersion;
4448-
minimumVersion = 1.9.0;
4448+
minimumVersion = 1.10.0;
44494449
};
44504450
};
44514451
/* End XCRemoteSwiftPackageReference section */

ReleaseNotes.md

Lines changed: 12 additions & 0 deletions

Sources/HealthCardAccess/CardObjects/ApplicationIdentifier.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ extension ApplicationIdentifier {
101101
- Parameter value: The StringLiteral to be used as rawValue
102102
*/
103103
public init(stringLiteral value: StringLiteralType) {
104-
try! self.init(hex: value) // swiftlint:disable:this force_try
104+
do {
105+
try self.init(hex: value)
106+
} catch {
107+
preconditionFailure(error.localizedDescription)
108+
}
105109
}
106110
}

Sources/HealthCardControl/Authentication/HealthCardType+ChangeReferenceData.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Foundation
1919
import HealthCardAccess
2020
import Helper
2121

22+
@frozen
2223
public enum ChangeReferenceDataResponse: Equatable {
2324
/// Reset successful
2425
case success

Sources/HealthCardControl/Authentication/HealthCardType+ResetRetryCounter.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Foundation
1919
import HealthCardAccess
2020
import Helper
2121

22+
@frozen
2223
public enum ResetRetryCounterResponse: Equatable {
2324
/// Reset successful
2425
case success

Sources/HealthCardControl/Operations/HealthCardType+ReadFile.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ extension HealthCardType {
9191
.eraseToAnyPublisher()
9292
} else {
9393
// Done
94-
return Just(responseData).mapError { $0 as Error }.eraseToAnyPublisher()
94+
return Just(responseData).setFailureType(to: Error.self).eraseToAnyPublisher()
9595
}
9696
}
9797
}

Sources/HealthCardControl/SecureMessaging/KeyAgreement.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public enum KeyAgreement { // swiftlint:disable:this type_body_length
6767
/// Negotiate a common key with a `HealthCard` given its `CardAccessNumber`
6868
///
6969
/// - Parameters:
70-
/// - channel: the channel to negotiate a session key with
70+
/// - card: the card to negotiate a session key with
7171
/// - can: the `CardAccessNumber` of the `HealthCard`
7272
/// - writeTimeout: timeout in seconds. time <= 0 is no timeout
7373
/// - readTimeout: timeout in seconds. time <= 0 is no timeout
@@ -174,9 +174,7 @@ public enum KeyAgreement { // swiftlint:disable:this type_body_length
174174
readTimeout: TimeInterval
175175
) -> AnyPublisher<Data, Swift.Error> {
176176
Just(HealthCardCommand.PACE.step1a())
177-
.mapError {
178-
$0 as Swift.Error
179-
}
177+
.setFailureType(to: Swift.Error.self)
180178
.flatMap {
181179
$0.publisher(for: card, writeTimeout: writeTimeout, readTimeout: readTimeout)
182180
}
@@ -206,15 +204,15 @@ public enum KeyAgreement { // swiftlint:disable:this type_body_length
206204
) -> AnyPublisher<(BrainpoolP256r1.KeyExchange.PublicKey, BrainpoolP256r1.KeyExchange.PrivateKey), Swift.Error> {
207205
Deferred { () -> AnyPublisher<BrainpoolP256r1.KeyExchange.PrivateKey, Swift.Error> in
208206
do {
209-
return Just(try BrainpoolP256r1.KeyExchange.generateKey(compactRepresentable: false))
207+
return Just(try BrainpoolP256r1.KeyExchange.generateKey())
210208
.setFailureType(to: Swift.Error.self)
211209
.eraseToAnyPublisher()
212210
} catch {
213211
return Fail(error: error).eraseToAnyPublisher()
214212
}
215213
}
216214
.tryMap { keyPair1 in
217-
let command = try HealthCardCommand.PACE.step2a(publicKey: keyPair1.publicKey.x962Value)
215+
let command = try HealthCardCommand.PACE.step2a(publicKey: keyPair1.publicKey.x962Value())
218216
return (keyPair1, command)
219217
}
220218
.flatMap { (keyPair1: BrainpoolP256r1.KeyExchange.PrivateKey, command: HealthCardCommandType) in
@@ -244,7 +242,7 @@ public enum KeyAgreement { // swiftlint:disable:this type_body_length
244242
) -> AnyPublisher<(BrainpoolP256r1.KeyExchange.PublicKey, AES128PaceKey), Swift.Error> {
245243
Just(pk2Pcd)
246244
.tryMap { pk2Pcd -> HealthCardCommandType in
247-
try HealthCardCommand.PACE.step3a(publicKey: pk2Pcd.x962Value)
245+
try HealthCardCommand.PACE.step3a(publicKey: pk2Pcd.x962Value())
248246
}
249247
.flatMap {
250248
$0.publisher(for: card, writeTimeout: writeTimeout, readTimeout: readTimeout)
@@ -275,7 +273,7 @@ public enum KeyAgreement { // swiftlint:disable:this type_body_length
275273
let algorithm = Algorithm.idPaceEcdhGmAesCbcCmac128
276274
return Just(algorithm)
277275
.tryMap { algorithm -> HealthCardCommandType in
278-
let macPcd = try KeyAgreement.deriveMac(publicKeyX509: pk2Picc.x962Value,
276+
let macPcd = try KeyAgreement.deriveMac(publicKeyX509: pk2Picc.x962Value(),
279277
sessionKeyMac: paceKey.mac,
280278
algorithm: algorithm)
281279
let macPcdToken = macPcd.prefix(algorithm.macTokenPrefixSize)
@@ -292,7 +290,7 @@ public enum KeyAgreement { // swiftlint:disable:this type_body_length
292290
throw Error.unexpectedFormedAnswerFromCard
293291
}
294292
let macPiccData = try extractPrimitive(constructedAsn1: macPiccResponseData)
295-
let verifyMacPiccData = try deriveMac(publicKeyX509: pk2Pcd.x962Value,
293+
let verifyMacPiccData = try deriveMac(publicKeyX509: pk2Pcd.x962Value(),
296294
sessionKeyMac: paceKey.mac,
297295
algorithm: algorithm)
298296

Sources/NFCCardReaderProvider/Reader/CoreNFCError.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import CoreNFC
1818
import Foundation
1919

20+
@frozen
2021
public enum CoreNFCError: Swift.Error {
2122
case tagConnectionLost(NFCReaderError)
2223
case sessionTimeout(NFCReaderError)

0 commit comments

Comments
 (0)