mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 07:28:10 +00:00
feat(common): add public_key to ECDHSessionKey
This commit is contained in:
parent
ebfd51d818
commit
b2877afa7f
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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),
|
||||||
}
|
}
|
||||||
|
@ -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),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user