Skip to content

Commit

Permalink
Only support byte arrays as KID in production.
Browse files Browse the repository at this point in the history
  • Loading branch information
yspreen committed Apr 16, 2021
1 parent e5e29df commit b2d3d41
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PatientScannerDemo/CBOR.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ struct CBOR {
let kid = protectedMap[COSE_PHDR_KID] ?? .null
switch kid {
case let .utf8String(str):
return str.encode()
case let .byteString(str):
return str
#if DEBUG
print("Warning, CBOR not fully compliant!!")
#else
return nil
#endif
return Data(hexString: str)?.uint
case let .byteString(uint):
return uint
default:
return nil
}
Expand Down

0 comments on commit b2d3d41

Please sign in to comment.