SoftHsm2 does not behave the same on ARM64 compared to X64

未关闭
#803 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp

调研方向

Start by comparing EC public key access on Rocky 9 ARM64 with the working Rocky 8 ARM64 and x86_64 cases, using the secp384r1 and secp521r1 commands in the issue to reproduce the failure. Trace the path that reads a stored EC public key and creates the EVP_PKEY; the issue does not name source files or tests. Done means public key access succeeds on Rocky 9 ARM64 for both curves.

由索引模型根据 Issue 内容生成。

描述

Hello,

I'm currently facing a strange discrepancy when using https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/s/softhsm-2.6.1-5.el8.1.x86_64.rpm and https://dl.fedoraproject.org/pub/epel/8/Everything/aarch64/Packages/s/softhsm-2.6.1-5.el8.1.aarch64.rpm

More precisely, x86_64 version behave as expected regarding EC key generation and public key access whereas aarch64 version allow generation but not public key access:

pkcs11-tool --module /usr/lib64/libsofthsm2.so --token-label test1 --keypairgen --key-type EC:secp521r1 --usage-derive --label test-ec-521 --id 3333333333 --sensitive -l -p 22222222

Key pair generated:
Private Key Object; EC
  label:      test-ec-521
  ID:         3333333333
  Usage:      decrypt, sign, unwrap, derive
  Access:     sensitive, always sensitive, never extractable, local
Public Key Object; EC  EC_POINT 528 bits
  EC_POINT:   048185040074708900a00254ef87ddcc66597a60951357680a245622c8baf5788f45dbeb2e5769aea9e9fa8ada11019a6285adc4734769ff51388fc7c037c18e78873424a014007a43a5ad9232bae4dabf4bc21f4a3b96bce47066b49645ee3d40b3fc166aad5cf3420167bb04840c1781e32de85024f8c0cbae36a63934fd0c48721219dcce7ad4
  EC_PARAMS:  06052b81040023
  label:      test-ec-521
  ID:         3333333333
  Usage:      encrypt, verify, wrap, derive
  Access:     local

pkcs11-tool --module /usr/lib64/libsofthsm2.so --token-label test1 -y pubkey -r --label test-ec-521
error: cannot create EVP_PKEY
Aborting.

pkcs11-tool --module /usr/lib64/libsofthsm2.so --token-label test2 --keypairgen --key-type EC:secp384r1 --usage-derive --label test-ec-384 --id 4444444444 --sensitive -l -p 33333333

Key pair generated:
Private Key Object; EC
  label:      test-ec-384
  ID:         4444444444
  Usage:      decrypt, sign, unwrap, derive
  Access:     sensitive, always sensitive, never extractable, local
Public Key Object; EC  EC_POINT 384 bits
  EC_POINT:   046104d9f8bcd72bc9a344c41d092d967ea9d274903b2b587cba29665607b0d2820c849bf3f28755a2a2f0a904365751f7e74dfa738021ed14e688348ffb86b111cbc69a43649501e10449505153e2f47ba42d4ea4a105916674cfbdcec5cf45688061
  EC_PARAMS:  06052b81040022
  label:      test-ec-384
  ID:         4444444444
  Usage:      encrypt, verify, wrap, derive
  Access:     local

pkcs11-tool --module /usr/lib64/libsofthsm2.so --token-label test2 -y pubkey -r --label test-ec-384
error: cannot create EVP_PKEY
Aborting.

[edit] the above failed behavior is experienced on rocky9 for arm64, but on rocky8 for arm64, it behaves as expected: public EC keys are correctly obtained.

Is there any plan for a fix to allow proper behavior on rocky9 for arm64?

主要语言
C++
星标
1.1k
派生
434
平均合并
12 天 14 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

softhsm/SoftHSMv2 的其他 Issue

查看 softhsm/SoftHSMv2 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。