Poll-based encrypt/decrypt/sign API support in asynchronous and synchronous call
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- cryptography
Research direction
Start with the crypto/cipher/MessageDecrypter trait shown in the issue and review the related rustls crypto API documentation. Trace every encrypt/decrypt call site to determine the poll contract for synchronous and asynchronous callers, then verify that both usage modes are covered.
Written by the indexing model from the issue text.
Description
Checklist
- I've searched the issue tracker for similar requests
https://github.com/rustls/rustls/issues/850#issuecomment-1544457213
https://github.com/rustls/rustls/issues/341
https://github.com/rustls/rustls/pull/1648
https://github.com/rustls/rustls/issues/1808
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
https://docs.rs/rustls/latest/rustls/crypto/cipher/trait.MessageDecrypter.html
convert crypto api to poll based
from
pub trait MessageDecrypter: Send + Sync {
/// Decrypt the given TLS message `msg`, using the sequence number
/// `seq` which can be used to derive a unique [`Nonce`].
fn decrypt<'a>(
&mut self,
msg: InboundOpaqueMessage<'a>,
seq: u64,
) -> Result<InboundPlainMessage<'a>, Error>;
}
to
pub trait MessageDecrypter: Send + Sync {
/// Decrypt the given TLS message `msg`, using the sequence number
/// `seq` which can be used to derive a unique [`Nonce`].
fn decrypt<'a>(
&mut self,
cx: &mut Context<'a>,
msg: InboundOpaqueMessage<'a>,
seq: u64,
) -> Result<InboundPlainMessage<'a>, Error>;
}
so that we can call tokio#poll_read to make encrypt/decrypt async
every encrypt/decrypt should call through trait, so we can hack it
Additional context
rustls only support poll method. user decide whether sync or async. If sync, just do and return Poll::Ready
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 947
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 46
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rustls/rustls
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
rustls/rustls#3409 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rustls/rustls#3373 · 3 comments ·
Maintainers usually reply within 1 day
Similar issues
-
ライブラリを追加Openpriority middle
Difficulty 1/5 Under an hour Newbie friendliness 62/100
KATO-Hiro/AtCoderClans#13015 ·
Maintainers usually reply within 1 day
-
needs-review
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
UCS-Care-Group/mailcraft#1429 ·
Maintainers usually reply within 1 day
-
priority: medium ready
Difficulty 1/5 Under an hour Newbie friendliness 88/100
TusanHomichi/PSIV#646 ·
Maintainers usually reply within 1 day
-
area:tui bug P1
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
agent-of-empires/agent-of-empires#5705 · 1 comment ·
Maintainers usually reply within 1 day
-
bug lab rust-mcp
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day