CaStore fails if certificates use anything other than RSA

Aperta
#1,119 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript, node.js

Direzione di ricerca

Reproduce the example with pki.createCaStore and trace the path through certificateFromPem, addCertificate, and certificateFromAsn1 in node_modules/node-forge/lib/x509.js. Check how the non-RSA public-key OID is handled and add a regression test for the Windows system certificate case. Done means the CA store is created successfully without the reported error.

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

Descrizione

Issue

CaStore expects all certificates to use RSA. If this is not the case, as on some Windows machines, it breaks.

Code

Run this in the node interactive interpreter.

const { getCACertificates } = await import("tls");
const forge = require('node-forge');
const pki = forge.pki;
let caStore = pki.createCaStore(getCACertificates("system"));

Expected Behavior

caStore is successfully created.

Actual Behavior

Received the following Error:

Uncaught Error: Cannot read public key. OID is not RSA.
    at pki.certificateFromAsn1 (...\node_modules\node-forge\lib\x509.js:1316:11)
    at pki.certificateFromPem (...\node_modules\node-forge\lib\x509.js:822:14)
    at caStore.addCertificate (...\node_modules\node-forge\lib\x509.js:2694:24)
    at pki.createCaStore (...\node_modules\node-forge\lib\x509.js:2834:15)

Additional information

node --version

v22.16.0

systeminfo

OS Name: Microsoft Windows 10 Enterprise LTSC
OS Version: 10.0.19044 N/A Build 19044
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Workstation
OS Build Type: Multiprocessor Free

Lingua principale
JavaScript
Stelle
5.4k
Fork
874
Merge medio
3m
PR unite (30g)
6

Preparare l'ambiente

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 digitalbazaar/forge

Tutte le issue di digitalbazaar/forge

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.