1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

feat(common): add public_key to ECDHSessionKey

This commit is contained in:
Roman Zeyde 2021-03-02 10:57:00 +02:00 committed by Pavol Rusnak
parent ebfd51d818
commit b2877afa7f
3 changed files with 7 additions and 0 deletions

View File

@ -83,6 +83,7 @@ message GetECDHSessionKey {
*/ */
message ECDHSessionKey { message ECDHSessionKey {
required bytes session_key = 1; // ECDH session key required bytes session_key = 1; // ECDH session key
optional bytes public_key = 2; // identity public key
} }
/** /**

View File

@ -17,11 +17,14 @@ class ECDHSessionKey(p.MessageType):
self, self,
*, *,
session_key: bytes, session_key: bytes,
public_key: bytes = None,
) -> None: ) -> None:
self.session_key = session_key self.session_key = session_key
self.public_key = public_key
@classmethod @classmethod
def get_fields(cls) -> Dict: def get_fields(cls) -> Dict:
return { return {
1: ('session_key', p.BytesType, p.FLAG_REQUIRED), 1: ('session_key', p.BytesType, p.FLAG_REQUIRED),
2: ('public_key', p.BytesType, None),
} }

View File

@ -17,11 +17,14 @@ class ECDHSessionKey(p.MessageType):
self, self,
*, *,
session_key: bytes, session_key: bytes,
public_key: bytes = None,
) -> None: ) -> None:
self.session_key = session_key self.session_key = session_key
self.public_key = public_key
@classmethod @classmethod
def get_fields(cls) -> Dict: def get_fields(cls) -> Dict:
return { return {
1: ('session_key', p.BytesType, p.FLAG_REQUIRED), 1: ('session_key', p.BytesType, p.FLAG_REQUIRED),
2: ('public_key', p.BytesType, None),
} }