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 摘要。