Skip to content

Commit

Permalink
Fixed deploying to iOS 12 - added weak framework CryptoTokenKit to po…
Browse files Browse the repository at this point in the history
…dspec - thanks @Jeroenbb94

Fixed crash in getNextTag when not enough data is present (happens with some passports) - thanks @Benny-iPhone
  • Loading branch information
AndyQ committed Jul 29, 2021
1 parent 909f0e5 commit 420ba74
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
V1.1.6
Fixed tag in DG11 - Thanks @Jusstas.
Fixed deploying to iOS 12 - added weak framework CryptoTokenKit to podspec - thanks @Jeroenbb94
Fixed crash in getNextTag when not enough data is present (happens with some passports) - thanks @Benny-iPhone


V1.1.5
Fixed potential issue when checking for invalid ECDSA signatures. Now rather than assuming if both BigNums
have a zero prefix, we actually check the bignums for validity.
Expand Down
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- NFCPassportReader (1.1.5):
- NFCPassportReader (1.1.6):
- OpenSSL-Universal (= 1.1.180)
- OpenSSL-Universal (1.1.180)
- QKMRZParser (1.0.1)
Expand All @@ -24,7 +24,7 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
NFCPassportReader: 23e2bd953d4a564859589d5168d517f6f192066c
NFCPassportReader: 98329180c6f7199ca52f15a81bd3344588e2b1bc
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b
QKMRZParser: 07921dbffa7e4064406113731bc0f1f5e6210bce
QKMRZScanner: 6c755fa2c36ec70179a1f94cb4b179223fa68ef8
Expand Down
5 changes: 2 additions & 3 deletions NFCPassportReader.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = "NFCPassportReader"
spec.version = "1.1.5"
spec.version = "1.1.6"
spec.summary = "This package handles reading an NFC Enabled passport using iOS 13 CoreNFC APIS"

spec.homepage = "https://github.com/AndyQ/NFCPassportReader"
Expand All @@ -17,8 +17,7 @@ Pod::Spec.new do |spec|
spec.swift_version = "5.0"

spec.dependency "OpenSSL-Universal", '1.1.180'
spec.xcconfig = { 'OTHER_LDFLAGS' => '-weak_framework CryptoKit -weak_framework CoreNFC',
'ENABLE_BITCODE' => '"NO' }
spec.xcconfig = { 'OTHER_LDFLAGS' => '-weak_framework CryptoKit -weak_framework CoreNFC -weak_framework CryptoTokenKit' }

spec.pod_target_xcconfig = {
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64'
Expand Down
6 changes: 6 additions & 0 deletions Sources/NFCPassportReader/DataGroups/DataGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ public class DataGroup {

func getNextTag() throws -> Int {
var tag = 0

// Fix for some passports that may have invalid data - ensure that we do have data!
guard data.count > pos else {
throw NFCPassportReaderError.TagNotValid
}

if binToHex(data[pos]) & 0x0F == 0x0F {
tag = Int(binToHex(data[pos..<pos+2]))
pos += 2
Expand Down

0 comments on commit 420ba74

Please sign in to comment.