AES-GCM tests failing with wycherproof in Fedora

オープン
#844 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

@antoinelochet がすでに取り組んでいます。

2026年11月9日 から。

  • #918 @antoinelochet による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
security

調査の方向性

Start by reproducing the failure with the wycheproof integration test on Fedora and SoftHSM 2.6.9 or 2.7.0; the report identifies test 311 as the likely trigger after test 310. Trace the failing AES-GCM invalid-input case through the SoftHSM code that handles its buffers and compare behavior with the passing Ubuntu CI run. Done means the assertion is resolved and the Wycheproof tests pass.

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

説明

After trying to update rust-cryptoki in Fedora that got softhsm 2.7.0 I started getting some C++ assertions. They fail in one of the wycherproof test rust-cryptoki introduced in recent release:

test aes_gcm_message_wycheproof ... ok
...
✓ Test 310: Valid - Key: 256-bit, Nonce: 10, Tag: 16, AAD: 0, PT: 16
/usr/include/c++/16/bits/stl_vector.h:1253: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = unsigned char; _Alloc = SecureAllocator<unsigned char>; reference = unsigned char&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
error: test failed, to rerun pass `--test wycheproof`

The same is happening in Fedora 43 with softhsm 2.6.9 (but looks like it does not in upstream CI with Ubuntu):

✓ Test 310: Valid - Key: 256-bit, Nonce: 10, Tag: 16, AAD: 0, PT: 16
/usr/include/c++/15/bits/stl_vector.h:1263: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = unsigned char; _Alloc = SecureAllocator<unsigned char>; reference = unsigned char&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

I assume the failing input is the next test we are not getting output for (output from testsuite running against kryoptic):

✓ Test 311: Invalid (expected failure) - Key: 128-bit, Nonce: 0, Tag: 16, AAD: 0, PT: 0

I did not dive deeper into the softhsm code, but it sounds like some buffer overrun that should not be there ...

主要言語
C++
スター
1.1k
フォーク
434
平均マージ
12日 14時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

softhsm/SoftHSMv2 のほかの issue

softhsm/SoftHSMv2 の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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