ecdsa, rfc6979: k, k⁻¹ and the RFC 6979 generator state are not zeroized (FIPS 186-5 § 6.4.1)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- cryptography, security
調査の方向性
Start with src/hazmat.rs at sign_prehashed and sign_prehashed_rfc6979, then inspect rfc6979's src/hmac_drbg.rs and its feature setup. Trace how k, k_inv, k_bytes, the private key encoding, and generator state are held, and check the existing zeroize dependency and feature conventions. Done means the secret material is zeroized as proposed and the relevant tests cover the changes.
索引モデルが issue の本文から書いたものです。
説明
FIPS 186-5 § 6.4.1: step 10 of signature generation orders k and k⁻¹ to be destroyed
("Securely destroy"), and the same section requires d, k and k⁻¹ to be "protected from
unauthorized disclosure and modification".
In ecdsa 0.17.0:
hazmat::sign_prehashed(src/hazmat.rs l. 52-91):k_invand the copies ofkare not
zeroized.NonZeroScalarimplementsZeroize(elliptic-curve 0.14.1,
src/scalar/nonzero.rs l. 384-396) but isCopy(l. 124), so it cannot zeroize on drop.hazmat::sign_prehashed_rfc6979(l. 102-124):k_bytesandd.to_repr(), a copy of the
private key handed toKGenerator::new, are not zeroized.
In rfc6979 0.6.0,HmacDrbgkeepskandv(src/hmac_drbg.rs l. 16 and 19), derived from
the private key, and the crate does not depend onzeroize.
Since s = k⁻¹·(z + r·d) is published,kfrom a single signature yields d. The ecdsa lines are
unchanged on the default branch at cf99f5ebe36954026fdc86d2a2b372e6c97d04fb.
Proposal: zeroize k_bytes, the key encoding, k and k_inv explicitly in hazmat (ecdsa
already depends on zeroize), and implement ZeroizeOnDrop for HmacDrbg/KGenerator behind
a zeroize feature of rfc6979.
We know of no practical exploit: the residue matters once the key itself is gone, in a memory
dump or a swapped page. We searched the tracker first; the closest reports concern keys only
(#1020, #883, #937).
- 主要言語
- Rust
- スター
- 672
- フォーク
- 213
- 平均マージ
- 23時間 39分
- マージ済み PR(30日)
- 19
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/signatures のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
RustCrypto/signatures#1491 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
RustCrypto/signatures#1498 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
RustCrypto/signatures#1479 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RustCrypto/signatures#1460 · コメント 8 件 ·
メンテナーはふだん 1 日以内に返信
-
xmss: XMSS^MT height-40 keys never return `KeyExhausted`; signing after exhaustion returns `Ok` with an invalid signature対応中かも @choksi2212 が 35 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
RustCrypto/signatures#1453 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
RustCrypto/signatures の issue をすべて見る
似ている issue
-
benchmark-review
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
area:filesystem bug need-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Captions panel does not offer to show an existing transcript対応中かも @thedavidweng が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
CapSoftware/Cap#4276 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
libracoder/kiri#364 ·
メンテナーはふだん 1 日以内に返信