Skip to content

Conversation

@cppcoffee
Copy link
Contributor

@cppcoffee cppcoffee commented Jun 12, 2025

Replace verbose if-let-else patterns with concise ok_or() calls
for better code readability and consistency across all cipher
suite implementations.

Changes:

  • CipherSuiteAes128Ccm: simplify encrypt/decrypt methods
  • CipherSuiteAes128GcmSha256: simplify encrypt/decrypt methods
  • CipherSuiteAes256CbcSha: simplify encrypt/decrypt methods
  • CipherSuiteChaCha20Poly1305Sha256: simplify encrypt/decrypt methods
  • CipherSuiteTlsPskWithAes128GcmSha256: simplify encrypt/decrypt methods

@cppcoffee cppcoffee changed the title dtls: simplify cipher suite dtls: refactor cipher suite error handling with ok_or() Jun 12, 2025
@cppcoffee
Copy link
Contributor Author

hi @rainliu , can you review this PR?

Replace verbose if-let-else patterns with concise ok_or() calls
for better code readability and consistency across all cipher
suite implementations.

Changes:
- CipherSuiteAes128Ccm: simplify encrypt/decrypt methods
- CipherSuiteAes128GcmSha256: simplify encrypt/decrypt methods
- CipherSuiteAes256CbcSha: simplify encrypt/decrypt methods
- CipherSuiteChaCha20Poly1305Sha256: simplify encrypt/decrypt methods
- CipherSuiteTlsPskWithAes128GcmSha256: simplify encrypt/decrypt methods

Signed-off-by: Xiaobo Liu <[email protected]>
@rainliu rainliu merged commit d75542b into webrtc-rs:master Jun 14, 2025
5 checks passed
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