Skip to content

Detect whether AES GCM encryption is supported before using it and fa…#364

Merged
KubaZ2 merged 1 commit into
mainfrom
feature/aes-gcm-host-support-detection
Jun 18, 2026
Merged

Detect whether AES GCM encryption is supported before using it and fa…#364
KubaZ2 merged 1 commit into
mainfrom
feature/aes-gcm-host-support-detection

Conversation

@KubaZ2

@KubaZ2 KubaZ2 commented Jun 18, 2026

Copy link
Copy Markdown
Member

…llback to XChaCha20Poly1305RtpSizeEncryption if needed

…llback to XChaCha20Poly1305RtpSizeEncryption if needed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates voice encryption selection to avoid using AES-256-GCM RTP size encryption on platforms where AesGcm is unsupported, falling back to XChaCha20-Poly1305 RTP size encryption when appropriate.

Changes:

  • Gate AES-256-GCM selection on AesGcm.IsSupported via a new IsSupported property.
  • Introduce IsSupported on voice encryption implementations and add a corresponding static member on IVoiceEncryption.
  • Update VoiceEncryptionProvider to conditionally choose AES-256-GCM or fall back to XChaCha20-Poly1305.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
NetCord/Gateway/Voice/VoiceEncryptionProvider.cs Updates mode selection logic to prefer AES-GCM only when supported.
NetCord/Gateway/Voice/Encryption/Aes256GcmRtpSizeEncryption.cs Adds IsSupported based on AesGcm.IsSupported.
NetCord/Gateway/Voice/Encryption/XChaCha20Poly1305RtpSizeEncryption.cs Adds IsSupported (currently hardcoded).
NetCord/Gateway/Voice/Encryption/IVoiceEncryption.cs Adds a static interface member for platform support detection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread NetCord/Gateway/Voice/VoiceEncryptionProvider.cs
Comment thread NetCord/Gateway/Voice/Encryption/IVoiceEncryption.cs
@github-actions

Copy link
Copy Markdown

The documentation preview is available at https://preview.netcord.dev/364.

@KubaZ2 KubaZ2 merged commit caca47e into main Jun 18, 2026
2 checks passed
@KubaZ2 KubaZ2 deleted the feature/aes-gcm-host-support-detection branch June 18, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants