From 420ba74525f2f322982bd7ff82337816f44111f8 Mon Sep 17 00:00:00 2001 From: AndyQ Date: Thu, 29 Jul 2021 09:28:48 +0100 Subject: [PATCH] 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 --- CHANGELOG | 6 ++++++ Example/Podfile.lock | 4 ++-- NFCPassportReader.podspec | 5 ++--- Sources/NFCPassportReader/DataGroups/DataGroup.swift | 6 ++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 2b19ae22..2deabcb8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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. diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 869729e7..ccac8baf 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -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) @@ -24,7 +24,7 @@ EXTERNAL SOURCES: :path: "../" SPEC CHECKSUMS: - NFCPassportReader: 23e2bd953d4a564859589d5168d517f6f192066c + NFCPassportReader: 98329180c6f7199ca52f15a81bd3344588e2b1bc OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b QKMRZParser: 07921dbffa7e4064406113731bc0f1f5e6210bce QKMRZScanner: 6c755fa2c36ec70179a1f94cb4b179223fa68ef8 diff --git a/NFCPassportReader.podspec b/NFCPassportReader.podspec index a1a0bac7..8d90e199 100644 --- a/NFCPassportReader.podspec +++ b/NFCPassportReader.podspec @@ -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" @@ -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' diff --git a/Sources/NFCPassportReader/DataGroups/DataGroup.swift b/Sources/NFCPassportReader/DataGroups/DataGroup.swift index 6122d3d6..bc279e77 100644 --- a/Sources/NFCPassportReader/DataGroups/DataGroup.swift +++ b/Sources/NFCPassportReader/DataGroups/DataGroup.swift @@ -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..