Skip to content

Commit f471891

Browse files
Version 4.1.0
1 parent 71cbbcb commit f471891

File tree

44 files changed

+1413
-220
lines changed

Some content is hidden

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

44 files changed

+1413
-220
lines changed

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ github "SwiftCommon/DataKit" "1.1.0"
55
github "gematik/OpenSSL-Swift" "3.0.3"
66
github "hectr/swift-stream-reader" "0.3.0"
77
github "swiftsocket/SwiftSocket" "2e6ba27140a29fae8a6331ba4463312e0c71a6b0"
8-
github "tadija/AEXML" "4.5.0"
8+
github "tadija/AEXML" "4.5.0"

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,4 @@ RUBY VERSION
308308
ruby 2.6.5p114
309309

310310
BUNDLED WITH
311-
2.3.13
311+
2.3.16
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//
2+
// Copyright (c) 2022 gematik GmbH
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the License);
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an 'AS IS' BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
import HealthCardAccess
19+
@testable import HealthCardControl
20+
import Nimble
21+
import XCTest
22+
23+
final class HealthCardTypeExtResetRetryCounterIntegrationTest: CardSimulationTerminalTestCase {
24+
override class var configFileInput: String {
25+
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml"
26+
}
27+
28+
override class var healthCardStatusInput: HealthCardStatus { .valid(cardType: .egk(generation: .g2_1)) }
29+
30+
func testResetRetryCounterEgk21_success() throws {
31+
let puk = "12345678" as Format2Pin
32+
33+
expect(
34+
try Self.healthCard.resetRetryCounter(
35+
puk: puk,
36+
type: EgkFileSystem.Pin.mrpinHome,
37+
dfSpecific: false
38+
)
39+
.test()
40+
) == ResetRetryCounterResponse.success
41+
}
42+
43+
func testResetRetryCounterWithNewPinEgk21_success() throws {
44+
let puk = "12345678" as Format2Pin
45+
let newPin = "654321" as Format2Pin
46+
47+
expect(
48+
try Self.healthCard.resetRetryCounterAndSetNewPin(
49+
puk: puk,
50+
newPin: newPin,
51+
type: EgkFileSystem.Pin.mrpinHome,
52+
dfSpecific: false
53+
)
54+
.test()
55+
) == ResetRetryCounterResponse.success
56+
}
57+
58+
func testResetRetryCounterWithNewPinEgk21_wrongPasswordLength() throws {
59+
let puk = "12345678" as Format2Pin
60+
let tooLongNewPin = "654112341234" as Format2Pin
61+
62+
expect(
63+
try Self.healthCard.resetRetryCounterAndSetNewPin(
64+
puk: puk,
65+
newPin: tooLongNewPin,
66+
type: EgkFileSystem.Pin.mrpinHome,
67+
dfSpecific: false
68+
)
69+
.test()
70+
) == ResetRetryCounterResponse.wrongPasswordLength
71+
}
72+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
//
2+
// Copyright (c) 2022 gematik GmbH
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the License);
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an 'AS IS' BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
import HealthCardAccess
19+
@testable import HealthCardControl
20+
import Nimble
21+
import XCTest
22+
23+
// Note: This continuation of `HealthCardTypeExtResetRetryCounterIntegrationTest` exists to separate the count dependent
24+
// tests from the other ones.
25+
final class HealthCardTypeExtResetRetryCounterIntegrationTestCont: CardSimulationTerminalTestCase {
26+
override class var configFileInput: String {
27+
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml"
28+
}
29+
30+
override class var healthCardStatusInput: HealthCardStatus { .valid(cardType: .egk(generation: .g2_1)) }
31+
32+
func testResetRetryCounterEgk21_wrongSecretWarning() throws {
33+
let wrongPuk = "9999999" as Format2Pin
34+
let newPin = "654321" as Format2Pin
35+
36+
// With setting a new PIN
37+
expect(
38+
try Self.healthCard.resetRetryCounterAndSetNewPin(
39+
puk: wrongPuk,
40+
newPin: newPin,
41+
type: EgkFileSystem.Pin.mrpinHome,
42+
dfSpecific: false
43+
)
44+
.test()
45+
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 9)
46+
47+
expect(
48+
try Self.healthCard.resetRetryCounterAndSetNewPin(
49+
puk: wrongPuk,
50+
newPin: newPin,
51+
type: EgkFileSystem.Pin.mrpinHome,
52+
dfSpecific: false
53+
)
54+
.test()
55+
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 8)
56+
57+
// Without setting a new PIN
58+
expect(
59+
try Self.healthCard.resetRetryCounter(
60+
puk: wrongPuk,
61+
type: EgkFileSystem.Pin.mrpinHome,
62+
dfSpecific: false
63+
)
64+
.test()
65+
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 7)
66+
67+
expect(
68+
try Self.healthCard.resetRetryCounter(
69+
puk: wrongPuk,
70+
type: EgkFileSystem.Pin.mrpinHome,
71+
dfSpecific: false
72+
)
73+
.test()
74+
) == ResetRetryCounterResponse.wrongSecretWarning(retryCount: 6)
75+
}
76+
}

0 commit comments

Comments
 (0)