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

オープン 初心者向け
#138,680 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
83/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp

調査の方向性

ManagedPal.Kem.csを読み、KEM、KDF、キーラップのチェックを、このファイル内のほかのアルゴリズムエラーの呼び出し箇所と比較します。未サポートのアルゴリズムOIDをCryptographicExceptionコンストラクターに渡し、メッセージに「{0}」ではなくアルゴリズム名が表示されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C#
スター
18.5k
フォーク
5.8k
平均マージ
2日 8時間
マージ済み PR(30日)
505

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dotnet/runtime のほかの issue

dotnet/runtime の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。