SoftHsm2 does not behave the same on ARM64 compared to X64

Aperta
#803 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
C++
Stelle
1.1k
Fork
434
Merge medio
12g 14h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di softhsm/SoftHSMv2

Tutte le issue di softhsm/SoftHSMv2

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.