panzi / verify-ehc

Simple Python script to decode and verify an European Health Certificate QR-code
60 stars 17 forks source link

Any changes with the 3rd vaccination? #25

Closed Peonlicious closed 2 years ago

Peonlicious commented 2 years ago

Hello,

Did something change with the implementation of the 3rd vaccination? Whenever i try to read a person's 3rd vac-qr-code, the script throws errors.

looking like this:

Traceback (most recent call last): File "C:\Users\User\Desktop\verify-ehc-main\verify_ehc.py", line 2456, in main() File "C:\Users\User\Desktop\verify-ehc-main\verify_ehc.py", line 2425, in main ehc_msg = decode_ehc(ehc_code) File "C:\Users\User\Desktop\verify-ehc-main\verify_ehc.py", line 1651, in decode_ehc data = zlib.decompress(data) zlib.error: Error -3 while decompressing data: invalid literal/length code

Teststing 1st and 2nd vacc there are no problems. I was under the impression that everything stays the same, no matter the vaccination numbers, only the payload would change accordingly

panzi commented 2 years ago

That is weird and interesting. I haven't tested any 3rd vaccination record myself yet. (I don't have my 3rd vaccination yet.) But it's weird that it fails at the zlib decompression stage! That is several decoding steps before you get to information about the vaccination.What country do your certificates come from? I guess you can't share an example?

Peonlicious commented 2 years ago

It is from Germany, i sent it to the email which you have on your profile

It is from a family member so i would rather not post it in public. If needed i am sure I can sent the qr itself

trasgu82 commented 2 years ago

I also have some family members with 3rd vaccination and the script works as with the 1st and the 2nd ones, no problem at all. It may be a problem of some specific QR codes. Weeks ago I also found a PCR QR code that also gave errors during decoding, but I could not keep it to debug.

panzi commented 2 years ago

I wonder if it could just be a bad scan? I mean, QR-codes do error correction, but who knows? In that example it really looks like the deflate stream is broken. The infgen tool says infgen warning: invalid deflate data -- invalid code.

Peonlicious commented 2 years ago

Thats weird, i get the same problem with 2 different scanners. I will try and read the qr later with my phone and check if i get a different ciphertext

Peonlicious commented 2 years ago

ok it seems to be the hardware, but I wonder what it does. I just scanned the qr with my phone and pasted the cipher into the tool, it is working

edit: the culprit is a single sign:

not working part; $C:H9W

working part: $C0H9W

panzi commented 2 years ago

Great to hear you managed to scan it correctly now! Dumb that the scanner is not working right. ☹️