Skip to content

Commit

Permalink
Merge pull request #482 from doronz88/feature/opack
Browse files Browse the repository at this point in the history
core_device_tunnel: use python opack library for creating opack buffer
  • Loading branch information
doronz88 authored Jul 12, 2023
2 parents c5c9606 + 5b3aa55 commit 6b660a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pymobiledevice3/remote/core_device_tunnel_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey, X25519PublicKey
from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from opack import dumps
from srptools import SRPClientSession, SRPContext
from srptools.constants import PRIME_3072, PRIME_3072_GEN

Expand Down Expand Up @@ -268,10 +269,15 @@ def _save_pair_record_on_peer(self) -> Mapping:

self.signature = self.ed25519_private_key.sign(signbuf)

# TODO: use opack when its done
device_info = b'\xe7FaltIRK\x80\xe9\xe8-\xc0jIykVoT\x00\x19\xb1\xc7{FbtAddrQ11:22:33:44:55:66Cmacv\x14\x98wi' \
b'\rq[remotepairing_serial_numberLAAAAAAAAAAAAIaccountIDa$11111111-1111-1111-1111-111111111111' \
b'EmodelJMacmini9,1DnameQUser\xe2\x80\x99s Mac mini'
device_info = dumps({
'altIRK': b'\xe9\xe8-\xc0jIykVoT\x00\x19\xb1\xc7{',
'btAddr': '11:22:33:44:55:66',
'mac': b'\x11\x22\x33\x44\x55\x66',
'remotepairing_serial_number': 'AAAAAAAAAAAA',
'accountID': self.identifier,
'model': 'computer-model',
'name': platform.node()
})

tlv = PairingDataComponentTLVBuf.build([
{'type': PairingDataComponentType.IDENTIFIER, 'data': self.identifier.encode()},
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ hyperframe
srptools
aioquic
developer_disk_image>=0.0.2
opack

0 comments on commit 6b660a6

Please sign in to comment.