Wrong encoding of CKA_EC_POINT for Edwards curve kyes using OpenSSL

Aperta
#824 1 commento 1 reazione 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
Ambito
cryptography

Direzione di ricerca

Read the code that exports and validates CKA_EC_POINT for Edwards curve keys, then trace how the attribute is consumed during signature verification. Compare the exported bytes with the PKCS#11 wording and RFC 8032 encoding described in the issue. Done means the attribute uses the expected encoding and a key created from it can verify a signature.

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

Descrizione

When exporting a public key that was generated using softhsm, the output data of the attribute CKA_EC_POINT is 34 Bytes instead of 32 Bytes,
The first two bytes seem to correspond to the encoding used for DER encoded OCTET STRING. The pkcs11 spec states:

Attribute Data type Meaning
CKA_EC_PARAMS1,3 Byte array DER-encoding of a Parameters value as defined above
CKA_EC_POINT1,4 Byte array DER-encoding of the b-bit public key value in little endian order as defined in RFC 8032

RFC 8032 does not mention a DER encoded OCTET STRING but uses the wording octet string to mean a string of octets.

Furthermore, softhsm does not validate the attribute when creating a public key with C_CreateObject. Only when using the key to verify a signature, the verification fails.

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.