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

feat: voice gateway v8 & xchacha20+aes256 encryption mode #156

Open
wants to merge 20 commits into
base: dev
Choose a base branch
from

Conversation

Snazzah
Copy link
Contributor

@Snazzah Snazzah commented Aug 18, 2024

This is a WIP PR for using voice gateway V8 and using the "AEAD XChaCha20 Poly1305" encryption mode.

Caution

This may deprecate tweetnacl, as that implementation does not have xchacha20.

  • aead_xchacha20_poly1305_rtpsize
    • Audio sending
    • Audio recieving
  • aead_aes256_gcm_rtpsize (using node:crypto)
    • Audio sending
    • Audio recieving
  • Voice Gateway V8
    • Updated payloads
    • Buffered resume

@TTtie TTtie added scope: voice Issues or pull requests related to voice functionality reason: Discord Issues or pull requests related to Discord's API changes type: enhancement New feature or request labels Aug 18, 2024
@TTtie TTtie added this to the 0.2.0 milestone Aug 18, 2024
lib/voice/VoiceConnection.js Outdated Show resolved Hide resolved
@Snazzah
Copy link
Contributor Author

Snazzah commented Aug 19, 2024

A bit of a problem, and a note to myself:
It seems like now after using the XChaCha20 mode, the decrypted packets when receiving seem to have changed how header extensions are given, it seems to follow RFC5285 4.2 without the first 4 bytes, so there isn't a good way of knowing how many one-byte headers there are.

The extension header is outside of the decrypted data because of _rtpsize, I get it now.

lib/voice/VoiceConnection.js Outdated Show resolved Hide resolved
Snazzah and others added 2 commits August 19, 2024 11:22
@Snazzah Snazzah changed the title feat: voice gateway v8 & xchacha20 encryption mode feat: voice gateway v8 & xchacha20+aes256 encryption mode Aug 19, 2024
lib/voice/VoiceConnection.js Outdated Show resolved Hide resolved
@Snazzah Snazzah marked this pull request as ready for review August 22, 2024 00:58
lib/voice/VoiceConnection.js Outdated Show resolved Hide resolved
@TTtie TTtie added the needs testing Additional testing is needed label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing Additional testing is needed reason: Discord Issues or pull requests related to Discord's API changes scope: voice Issues or pull requests related to voice functionality type: enhancement New feature or request
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants