setFips() / setEngine do not evict ciphers cache
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 122k
- Fork
- 37.4k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 283
Mô tả
> 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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Xác định tệp của mô-đun crypto chứa cachedResult, setFips, setEngine, conditionalAlgorithms và helper getHashCache ở các dòng 81–91. Theo dõi cách getCiphers và getHashes được lưu vào bộ nhớ đệm cũng như cách hoạt động của cơ chế làm mới bộ nhớ đệm hiện có; hoàn thành có nghĩa là các thay đổi FIPS hoặc engine thành công được phản ánh trong kết quả danh sách thuật toán ở các lần tiếp theo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, node.js
- Lĩnh vực
- security
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100