Skip to content

Stop accessing AesGcm from multiple threads in Aes256GcmRtpSizeEncryption#367

Merged
KubaZ2 merged 1 commit into
mainfrom
fix/aes-256-gcm-encryption-concurrency
Jun 18, 2026
Merged

Stop accessing AesGcm from multiple threads in Aes256GcmRtpSizeEncryption#367
KubaZ2 merged 1 commit into
mainfrom
fix/aes-256-gcm-encryption-concurrency

Conversation

@KubaZ2

@KubaZ2 KubaZ2 commented Jun 18, 2026

Copy link
Copy Markdown
Member

No description provided.

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 the Discord voice RTP-size AES-256-GCM encryption implementation to avoid using the same AesGcm instance for both encryption and decryption, which can otherwise be accessed concurrently from different threads.

Changes:

  • Added a dedicated _decryption AesGcm instance separate from _encryption.
  • Switched Decrypt to use _decryption instead of _encryption.
  • Updated SetKey/Dispose to initialize and dispose the additional AesGcm instance.

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

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

Copy link
Copy Markdown

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

@KubaZ2 KubaZ2 merged commit 5bc0074 into main Jun 18, 2026
2 checks passed
@KubaZ2 KubaZ2 deleted the fix/aes-256-gcm-encryption-concurrency branch June 18, 2026 19:39
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