Code Monkey home page Code Monkey logo

Comments (14)

fobrs avatar fobrs commented on June 3, 2024

Dank voor de update, maar de check blijft 'valid' voor een qr code die in de proofIdentifierDenylist staat...

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

Oeps, de commit triggert een close van dit ticket. Dat was niet helemaal de bedoeling. :)

Ik heb een nieuwe versie released die overweg kan met de proofIdentifierDenylist. Je kan upgraden door of je docker image opnieuw te pullen of door een pip install --upgrade coronacheck-tools te draaien.

Het is aan te raden om je config te cleanen door een coronacheck-tools clean te draaien, dan weet je zeker dat de config voor de mobilecore verifier up-to-date is, die wordt dan namelijk automatisch opnieuw gedownload. Als je vervolgens een revoked QR code valideert dan krijg je deze output:

$ coronacheck-tools verify json /tmp/testout/dhc_data_000.json 
This is an unofficial tool that is in no way affiliated with CoronaCheck.nl or the Ministry of VWS
Code is invalid Could not verify domestic QR code: The credential identifier was present in the proof identifier denylist

Om de proofIdentifierDenylist uit de config uit te lezen heb ik het config command toegevoegd. Je kan die draaien zonder parameter en dan dumpt het de gehele config, of je kan een key meegeven en dan dumpt het alleen wat onder die key staat in de config. Bijvoorbeeld:

$ coronacheck-tools config proofIdentifierDenylist
This is an unofficial tool that is in no way affiliated with CoronaCheck.nl or the Ministry of VWS
{
  "11JoX+77S9vVjWskiii1Vg==": true,
  "3WdXZa6TgISdEEKQGVTq7A==": true,
  "8rbKvX+ulRBmHxI8tCqwKA==": true,
  "BmNzE2lU15G5yBINksLyrQ==": true,
  "FIT4zH3FVeh5z1PQj7X5bw==": true,
  "HnvtFd2Brb7rIDvXN7LMBg==": true,
  "JyoXN+LkbWEjqBvte11m8w==": true,
  "KNOT40ctHWE8XTekU1vo1w==": true,
  "PLC3+Pz671j+bNtF1ZP7wQ==": true,
  "QkvWtuawgmzD/9sLtooeFw==": true,
  "Rmgd3gvUirnwn8f2HrfvJg==": true,
  "XHQw55X9pMTWxv840FkVjw==": true,
  "ofVzPyvdTc4jcZXzDwzVcA==": true
}

Zoals je in je mail aangaf is het niet te hopen dat voor elke revoked QR code een lijntje aan de config toegevoegd moet worden want dan wordt het snel onhandelbaar.

from coronacheck-tools.

fobrs avatar fobrs commented on June 3, 2024

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

Op dit moment is hier nog geen command voor maar ik kan die wel even inbouwen maar dit wordt dan pas morgen op zijn vroegst.

Hier is alvast een script om 'm te genereren.

from coronacheck_tools import decode_qr
from coronacheck_tools.clitools import deep_get
from coronacheck_tools.verification.verifier import readconfig

import hashlib
import base64


def int_to_bytes(int_input):
    h = hex(int_input).split('x')[1]
    if len(h) == 1:
        h = f'0{h}'

    return bytes.fromhex(h)


config = readconfig()
denylist = deep_get(config, 'proofIdentifierDenylist')

qrdata = decode_qr('/tmp/retracted_qr.png')[0]

c = int_to_bytes(qrdata['c'])

sha256 = hashlib.sha256()
sha256.update(c)

# take the first 128 bits of the sha256 hash
# https://github.com/minvws/nl-covid19-coronacheck-idemix/blob/21fbb94f41510fe23356c42c4888520dd03b1acb/verifier/verifier.go#L136
proof = sha256.hexdigest()[:32]
print('PROOF', proof)

for denied_hash in denylist.keys():
    hash = base64.b64decode(denied_hash).hex()
    if hash == proof:
        print('REVOKED')

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

Het command denylist is toegevoegd. Dit command print de denylist en als je er een qr code aan mee geeft dan checkt het of de qr op de denylist staat en print het de proof van de QR code. Upgraden kan via pip install --upgrade coronacheck-tools of docker pull sikerdebaard/coronacheck-tools:latest.

https://github.com/Sikerdebaard/coronacheck-tools#denylist

from coronacheck-tools.

fobrs avatar fobrs commented on June 3, 2024

Ik heb de tools op een schoon ubuntu systeem gezet en krijg nu dit:

.local/bin/coronacheck-tools Traceback (most recent call last): File ".local/bin/coronacheck-tools", line 5, in <module> from coronacheck_tools.cli import main File "/home/fo/.local/lib/python3.8/site-packages/coronacheck_tools/cli.py", line 7, in <module> from coronacheck_tools.api.denylist import denylist, proof as denylist_proof ModuleNotFoundError: No module named 'coronacheck_tools.api.denylist' fo@ubuntuvm0:~$ cd .local/bin fo@ubuntuvm0:~/.local/bin$ ./coronacheck-tools Traceback (most recent call last): File "./coronacheck-tools", line 5, in <module> from coronacheck_tools.cli import main File "/home/fo/.local/lib/python3.8/site-packages/coronacheck_tools/cli.py", line 7, in <module> from coronacheck_tools.api.denylist import denylist, proof as denylist_proof ModuleNotFoundError: No module named 'coronacheck_tools.api.denylist'

from coronacheck-tools.

fobrs avatar fobrs commented on June 3, 2024

Onder windows:

D:\projects\qrdecode>coronacheck-tools Traceback (most recent call last): File "C:\Users\fo\AppData\Local\Programs\Python\Python39\Scripts\coronacheck-tools-script.py", line 33, in <module> sys.exit(load_entry_point('coronacheck-tools==2', 'console_scripts', 'coronacheck-tools')()) File "C:\Users\fo\AppData\Local\Programs\Python\Python39\Scripts\coronacheck-tools-script.py", line 25, in importlib_load_entry_point return next(matches).load() File "c:\users\fo\appdata\local\programs\python\python39\lib\importlib\metadata.py", line 77, in load module = import_module(match.group('module')) File "c:\users\fo\appdata\local\programs\python\python39\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 790, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "c:\users\fo\appdata\local\programs\python\python39\lib\site-packages\coronacheck_tools\cli.py", line 7, in <module> from coronacheck_tools.api.denylist import denylist, proof as denylist_proof ModuleNotFoundError: No module named 'coronacheck_tools.api.denylist'

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

No module named 'coronacheck_tools.api.denylist' oh snap die zit ook inderdaad niet in de package. Zo te zien ging er iets fout tijdens het builden van de package. Ik heb een nieuwe versie geupload en daar is de module wel included. Als je update met een pip install --upgrade coronacheck-tools==3 dan zou het goed moeten komen.

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

Closing due to inactivity. Feel free to reopen if needed.

from coronacheck-tools.

fobrs avatar fobrs commented on June 3, 2024

Er zijn recent nieuwe codes in de proofIdentifierDenylist lijsten geplaatst. De volgende internationale code wordt door de verify tool als geldig aangemerkt terwijl de offciele scanner app de code ongeldig verkaard.
coronacheck-tools verify -e RAW hc1.raw
hc1.raw attached
hc1.zip

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

In principe valt de internationale QR code buiten de scope van deze library.

Zo te zien is er een update geweest van de mobilecore verifier van MinVWS. Ik ben de coronacheck-tools library aan het rebuilden met de nieuwe versie en update je zodra dit process voltooid is.

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

Er is een nieuwe versie van coronacheck-tools met de updated mobilecore. Upgraden kan door een pip install --upgrade coronacheck-tools te draaien. Wanneer je de hc1.raw hierin verified dan zal de library aangeven dat de QR code op de denylist staat.

De raspberry pi build draait nog op de oude mobilecore versie omdat het builden hiervan problemen geeft. Dit hoop ik in de komende dagen op te lossen en dan zal er een nieuwe release volgen.

from coronacheck-tools.

Bart0110 avatar Bart0110 commented on June 3, 2024

Er is een nieuwe versie van coronacheck-tools met de updated mobilecore. Upgraden kan door een pip install --upgrade coronacheck-tools te draaien. Wanneer je de hc1.raw hierin verified dan zal de library aangeven dat de QR code op de denylist staat.

De raspberry pi build draait nog op de oude mobilecore versie omdat het builden hiervan problemen geeft. Dit hoop ik in de komende dagen op te lossen en dan zal er een nieuwe release volgen.

Lijkt erop dat de denylist command nog niet de ondersteuning heeft om dit te doen: coronacheck-tools denylist raw .\hc1.raw

at C:\Python\lib\site-packages\coronacheck_tools\api\decoder.py:53 in decode_raw
      49│
      50│
      51│ def decode_raw(raw, format='dict', version='auto'):
      52│     if not (raw.startswith('NL') and raw[3] == ':'):
    → 53│         raise ValueError(f'Invalid data. RAW data should start with NLx: {raw}')
      54│
      55│     if version == 'auto':
      56│         version = int(raw[2], 16)
      57│

from coronacheck-tools.

Sikerdebaard avatar Sikerdebaard commented on June 3, 2024

Deze library focust op de domestic DHC QR code. Je probeert hier een internationaal EHC QR code aan het denylist command mee te geven. Dat gaat niet werken.

Het verify command daarintegen kan via de mobilecore library van MinVWS alsnog een EHC verifyen. Dit doe je als volgt: coronacheck-tools verify -e raw hc1.raw

from coronacheck-tools.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.