Decryption panics when importing invalid key components

未关闭 适合新手
#79 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@P4suta 已经在做这个了。

开始于 2026年11月15日。

  • #80 来自 @P4suta —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust

调研方向

panic 来自 backend-openssl 代码路径,因此从该 backend 模块开始,并追踪 decrypt 和 legacy::decrypt_aesgcm 在进行任何解密之前如何导入 EcKeyComponents(尤其是公钥)。把 issue 中的代码片段改成现有解密测试旁边的测试,并在启用 backend-openssl feature 的情况下运行它,以确认 panic 及其源代码行。完成意味着空、截断或错误的密钥通过 Result 返回现有的密钥导入错误,而不是 panic,并且其他 backend 仍然通过。

由索引模型根据 Issue 内容生成。

描述

In 2.4.2, decrypt and legacy::decrypt_aesgcm panic on invalid key import with the backend-openssl feature.
An empty, truncated, or invalidly encoded public key reproduces the panic while the other inputs remain valid.

let (key, auth) = ece::generate_keypair_and_auth_secret().unwrap();
let components = key.raw_components().unwrap();
let ciphertext = ece::encrypt(components.public_key(), &auth, b"message").unwrap();
let invalid = ece::EcKeyComponents::new(components.private_key().to_vec(), vec![]);
assert!(ece::decrypt(&invalid, &auth, &ciphertext).is_err());

Expected: return the key-import error through the existing Result.

主要语言
Rust
星标
29
派生
14
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mozilla/rust-ece 的其他 Issue

查看 mozilla/rust-ece 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。