KemRecipientInfo: CryptographicException shows an unfilled '{0}' for an unsupported KDF or key-wrap algorithm

Đang mở Phù hợp với người mới
#138,680 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
83/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
cryptography, security

Hướng nghiên cứu

Đọc ManagedPal.Kem.cs và so sánh các kiểm tra KEM, KDF và bọc khóa với những vị trí gọi lỗi thuật toán khác trong tệp đó. Truyền OID của thuật toán không được hỗ trợ vào hàm khởi tạo CryptographicException, sau đó xác minh rằng thông báo nêu tên thuật toán thay vì hiển thị “{0}”.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area-System.Security untriaged

On .NET 11.0.0 (SDK 11.0.100, Linux, the dotnet/sdk:11.0 image), EnvelopedCms.Decrypt(KemRecipientInfo, MLKem) on an EnvelopedData whose KEMRecipientInfo uses AES key wrap with padding (id-aes256-wrap-pad, RFC 5649) throws CryptographicException with the message:

Unknown algorithm '{0}'.

In ManagedPal.Kem.cs the KEM, KDF and key-wrap checks of the KEMRecipientInfo create it as new CryptographicException(SR.Cryptography_Cms_UnknownAlgorithm), without the argument, while the other call sites in the same file pass the algorithm with the (string format, string insert) constructor. Passing the OID there (for example KeyEncryptionAlgorithm.Oid.Value) would name the algorithm the recipient does not support.

Not reading AES key wrap with padding is fine by RFC 9936, which makes only AES key wrap mandatory; this is only about the message.

Ngôn ngữ chính
C#
Star
18.5k
Fork
5.8k
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
505

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dotnet/runtime

Tất cả issue của dotnet/runtime

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.