Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRTP Stream #3

Open
3 of 4 tasks
tuxuser opened this issue Sep 29, 2020 · 2 comments
Open
3 of 4 tasks

SRTP Stream #3

tuxuser opened this issue Sep 29, 2020 · 2 comments
Labels
help wanted Extra attention is needed xcloud xhome

Comments

@tuxuser
Copy link
Member

tuxuser commented Sep 29, 2020

Research low level streaming protocol aka Nanov3.

Is it using this?

GET /v4/sessions/home/12D89B40-ACB6-4E1B-8E96-F744E8D05D73/configuration HTTP/1.1

{
    "keepAlivePulseInSeconds": 300,
    "serverDetails": {
        "ipAddress": "10.0.0.174",
        "port": 9002,
        "ipV4Address": "10.0.0.174",
        "ipV4Port": 9002,
        "ipV6Address": null,
        "ipV6Port": 0,
        "iceExchangePath": "v4/sessions/home/12D89B40-ACB6-4E1B-8E96-F744E8D05D73/ice",
        "stunServerAddress": null,
        "srtp": {
            "key": "iq+1DPPH/H+4k/n4wERjqXr4OXYXrwqcDiitbHkz"
        }
    }
}

Or does it use the srtp.key above and negotiated connection/port of ICE (see Issue #2 - ICE: Negotiation) ?

UPDATE (2020/03/03)

  • Yes, srtp.key received in this HTTP response is indeed the per-session MASTER KEY
  • This key is transformed into 3 SESSION KEYS

MS-SRTP follows the basic patterns of RFC3711 with minor differences: (https://docs.microsoft.com/en-us/openspecs/office_protocols/ms-srtp/ac253f1b-e9a7-46d2-8508-e6b3c3641a68)

Plan of action

  • Research master/session key derivation
  • Implement (MS-)SRTP patterns according to RFC3711
    • Find out if there is a library that already provides the required SRTP patterns
    • Research how Nonce for AES-GCM cryptographical context is transformed (from session key 3)

References

MS-SRTP: Secure Real-time Transport Protocol (SRTP) Profile

RFC3711

@tuxuser tuxuser added help wanted Extra attention is needed xcloud xhome labels Sep 29, 2020
@akahmet
Copy link

akahmet commented Feb 16, 2021

Connecting with reconnect srtp key, This={}.
Creating nano stream with args videoConfig.WidthInPixels={}, videoConfig.HeightInPixels={}, videoConfig.MaxStreamCaptureSizeInBytes={}, audioConfig.SampleRateInHz={}, audioConfig.BufferSizeInFrames={}, audioConfig.EnableMicrophone={}
Connecting to session at {}:{}, with SRTP key ={}, This={}.
MicroManager::DisconnectAsync; Reason={}, This={}.
xCloud.Client.SDK.MicroManager.DisconnectAsync

Probably stream use srtp.key above.

@tuxuser
Copy link
Member Author

tuxuser commented Mar 4, 2021

There is pysrtp but it looks unmaintained and just provides the very basic data-level implementation.

Something like aiortc would be better...

Desired features:

  • SRTP Crypto according to RFC3711 / MS-SRTP (AES-GCM128)
  • ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed xcloud xhome
Projects
None yet
Development

No branches or pull requests

2 participants