setFips() / setEngine do not evict ciphers cache
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
> require('crypto').getCiphers().length
130
> require('crypto').setFips(true)
undefined
> require('crypto').getCiphers().length
130
but
> require('crypto').setFips(true)
undefined
> require('crypto').getCiphers().length
0
Also (unverified):
getCiphersmemoizes the cipher name list forever (cachedResult(() => filterDuplicateStrings(_getCiphers()))). WhensetEngine(id, flags)(also exported from this module) successfully loads an OpenSSL engine that registers additional ciphers, those new ciphers are not reflected in subsequentgetCiphers()results because the cache is never invalidated. Similarly, on BoringSSL builds the cache is force-populated during module initialization viaconditionalAlgorithms(the'ChaCha20-Poly1305'probe callsgetCiphers()), freezing the answer before any user code runs. The sibling_hashCachehelper in the same file explicitly clears on snapshot build / dynamic-link scenarios viaaddSerializeCallback;getCiphershas no such mechanism.
getHashesreturns a permanently-cached list from_getHashes()(viacachedResult). After a successfulsetEngine(id, flags)call (exported from this same module) loads an OpenSSL engine that registers new digest algorithms,getHashes()will continue to return the pre-engine snapshot. Downstream consumers — including this file's ownconditionalAlgorithmsgates forcSHAKE*/SHA3-*/ChaCha20-Poly1305 (evaluated once at module-load, so already locked in) and any external callers usingcrypto.getHashes()— will not observe engine-provided hashes. Contrast with the siblinggetHashCache(line 81–91) which is explicitly designed to be refreshed.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
cachedResult、setFips、setEngine、conditionalAlgorithms、および 81–91 行目の getHashCache ヘルパーを含む crypto モジュールのファイルを特定します。getCiphers と getHashes がどのようにキャッシュされるか、また既存のキャッシュ更新動作がどのように機能するかを追跡します。完了条件は、成功した FIPS または engine の変更が、その後のアルゴリズム一覧の結果に反映されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- security
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100