Skip to content

Commit

Permalink
Added QR code bytes amount limitation: admin-ch/CovidCertificate-App-…
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrsarapulovgl authored Jul 27, 2021
1 parent 63dc692 commit f259cea
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@ class VerificationViewModel @Inject constructor(

val plainInput = prefixValidationService.decode(code, verificationResult)
val compressedCose = base45Service.decode(plainInput, verificationResult)
val cose = compressorService.decode(compressedCose, verificationResult)
val cose: ByteArray? = compressorService.decode(compressedCose, verificationResult)

if (cose == null) {
Timber.d("Verification failed: Too many bytes read")
return InnerVerificationResult(
greenCertificateData = greenCertificateData,
isApplicableCode = isApplicableCode
)
}

val coseData = coseService.decode(cose, verificationResult)
if (coseData == null) {
Expand Down

0 comments on commit f259cea

Please sign in to comment.