Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

Adds standard way of verifying and validating json object #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bugobliterator
Copy link
Member

No description provided.

@bugobliterator bugobliterator requested review from mnihalm and abrbhat and removed request for mnihalm November 30, 2019 06:59
Copy link
Collaborator

@mnihalm mnihalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ive added some comments, please resolve them before we proceed.

@@ -6,16 +6,9 @@
"title": "Flight Log schema for Digital Sky",
"description": "This is the flight log schema for digital sky flight logs. One file that follows this schema should be generated for every permission artefact",
"required": [
"signature",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the signature removed? it was added in the schema, and is a mandatory attribute

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me this signature should be removed since it is already present in the final jws body.

@@ -12,6 +12,9 @@
from Cryptodome.Signature import pkcs1_15
from lxml import etree

from authlib import jose
import jsonschema
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a seperate method for jsonschema here -

def check_log_schema(logfile, schemafile=LOG_SCHEMA):

@@ -116,24 +119,26 @@ def verify_xml_signature(xml_file, certificate_path):

def verify_flight_log_signature_objs(log_object, public_key_obj):
"""
Verify the signature of the Flight log_object against a public key.
Verify the signature of the Flight log_object against a public key
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to keep schema and signature verification seperate. see

def check_log_schema(logfile, schemafile=LOG_SCHEMA):

@@ -0,0 +1,9 @@
-----BEGIN PUBLIC KEY-----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not use the public key already present in the sample? do we need another key?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not seem like it is being used anywhere

@mnihalm mnihalm self-assigned this Dec 3, 2019
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Jd95zBE883a98IVhxlLa1whVRVENTvDq1tpCKaQ7cSym9PZj-OsMCDL_u5jBji1bwtwp_ut9xt_uMi4R20G6_CXJaaJnn2tE_LVA5Kcv3t3-mkB1VzdkV_Ji1JYtX2VqeoNe_Jr1g"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the drone public key here? How is the trust chain established if this needs to be validated at Digital Sky? @sidhantgoel

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants