Fixed forge path issue, #4049

This commit is contained in:
Ylian Saint-Hilaire 2022-05-29 11:50:20 -07:00
parent 6a5ceff0ad
commit a799b9855a

View File

@ -16,7 +16,22 @@
* a separate file pkcs7asn1.js, since those are referenced from other * a separate file pkcs7asn1.js, since those are referenced from other
* PKCS standards like PKCS #12. * PKCS standards like PKCS #12.
*/ */
var forge = require('./node_modules/node-forge/lib/forge'); var forge;
try {
forge = require('../node-forge/lib/forge');
require('../node-forge/lib/aes');
require('../node-forge/lib/asn1');
require('../node-forge/lib/des');
require('../node-forge/lib/oids');
require('../node-forge/lib/pem');
require('../node-forge/lib/pkcs7asn1');
require('../node-forge/lib/random');
require('../node-forge/lib/util');
require('../node-forge/lib/x509'); f
} catch (ex) { }
if (forge == null) {
forge = require('./node_modules/node-forge/lib/forge');
require('./node_modules/node-forge/lib/aes'); require('./node_modules/node-forge/lib/aes');
require('./node_modules/node-forge/lib/asn1'); require('./node_modules/node-forge/lib/asn1');
require('./node_modules/node-forge/lib/des'); require('./node_modules/node-forge/lib/des');
@ -26,6 +41,7 @@ require('./node_modules/node-forge/lib/pkcs7asn1');
require('./node_modules/node-forge/lib/random'); require('./node_modules/node-forge/lib/random');
require('./node_modules/node-forge/lib/util'); require('./node_modules/node-forge/lib/util');
require('./node_modules/node-forge/lib/x509'); require('./node_modules/node-forge/lib/x509');
}
// shortcut for ASN.1 API // shortcut for ASN.1 API
var asn1 = forge.asn1; var asn1 = forge.asn1;