ehn-dcc-development / ehn-sign-verify-python-trivial

Extremely minimal python implementation of the eHN-S protocol.
European Union Public License 1.2
76 stars 41 forks source link

hc1_verify.py argument "--xy" doesn't work, tries to load certificate from file instead #17

Closed Jakub-KK closed 2 years ago

Jakub-KK commented 2 years ago

When using "--xy" argument to provide X,Y elliptic curve point (public key) for hc1_verify.py to use when verifying signature of DCC, the program outputs an error (in fresh repo without dsc-worker.pem file):

Traceback (most recent call last):
  File "hc1_verify.py", line 203, in <module>
    with open(args.cert, "rb") as file:
FileNotFoundError: [Errno 2] No such file or directory: 'dsc-worker.pem'

What should happen is that instead of trying to load public from certificate located in the file (which doesn't exist in repo and must be manually created to be present, as action not needed for signature validation of DCC generated by official means), the program should accept given argument --xy as public key and use it to verify DCC signature.

Note: using only --xy option to provide public key is not sufficient, per hc1_verify.py usage one must also provide key id (KID) using --kid argument or request that KID is ignored using --ignore-kid. At present using those arguments also results in erroneous behavior described above.