@@ -177,7 +177,7 @@ bool ExportJWKAsymmetricKey(Environment* env,
177
177
// Fall through
178
178
case EVP_PKEY_X448:
179
179
return ExportJWKEdKey (env, key, target);
180
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
180
+ #if OPENSSL_WITH_PQC
181
181
case EVP_PKEY_ML_DSA_44:
182
182
// Fall through
183
183
case EVP_PKEY_ML_DSA_65:
@@ -280,7 +280,7 @@ int GetNidFromName(const char* name) {
280
280
nid = EVP_PKEY_X25519;
281
281
} else if (strcmp (name, " X448" ) == 0 ) {
282
282
nid = EVP_PKEY_X448;
283
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
283
+ #if OPENSSL_WITH_PQC
284
284
} else if (strcmp (name, " ML-DSA-44" ) == 0 ) {
285
285
nid = EVP_PKEY_ML_DSA_44;
286
286
} else if (strcmp (name, " ML-DSA-65" ) == 0 ) {
@@ -620,7 +620,7 @@ Local<Function> KeyObjectHandle::Initialize(Environment* env) {
620
620
SetProtoMethod (isolate, templ, " exportJwk" , ExportJWK);
621
621
SetProtoMethod (isolate, templ, " initECRaw" , InitECRaw);
622
622
SetProtoMethod (isolate, templ, " initEDRaw" , InitEDRaw);
623
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
623
+ #if OPENSSL_WITH_PQC
624
624
SetProtoMethod (isolate, templ, " initMlDsaRaw" , InitMlDsaRaw);
625
625
#endif
626
626
SetProtoMethod (isolate, templ, " initJwk" , InitJWK);
@@ -643,7 +643,7 @@ void KeyObjectHandle::RegisterExternalReferences(
643
643
registry->Register (ExportJWK);
644
644
registry->Register (InitECRaw);
645
645
registry->Register (InitEDRaw);
646
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
646
+ #if OPENSSL_WITH_PQC
647
647
registry->Register (InitMlDsaRaw);
648
648
#endif
649
649
registry->Register (InitJWK);
@@ -838,7 +838,7 @@ void KeyObjectHandle::InitEDRaw(const FunctionCallbackInfo<Value>& args) {
838
838
args.GetReturnValue ().Set (true );
839
839
}
840
840
841
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
841
+ #if OPENSSL_WITH_PQC
842
842
void KeyObjectHandle::InitMlDsaRaw (const FunctionCallbackInfo<Value>& args) {
843
843
Environment* env = Environment::GetCurrent (args);
844
844
KeyObjectHandle* key;
@@ -971,7 +971,7 @@ Local<Value> KeyObjectHandle::GetAsymmetricKeyType() const {
971
971
return env ()->crypto_x25519_string ();
972
972
case EVP_PKEY_X448:
973
973
return env ()->crypto_x448_string ();
974
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
974
+ #if OPENSSL_WITH_PQC
975
975
case EVP_PKEY_ML_DSA_44:
976
976
return env ()->crypto_ml_dsa_44_string ();
977
977
case EVP_PKEY_ML_DSA_65:
@@ -1254,7 +1254,7 @@ void Initialize(Environment* env, Local<Object> target) {
1254
1254
NODE_DEFINE_CONSTANT (target, kWebCryptoKeyFormatJWK );
1255
1255
NODE_DEFINE_CONSTANT (target, EVP_PKEY_ED25519);
1256
1256
NODE_DEFINE_CONSTANT (target, EVP_PKEY_ED448);
1257
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
1257
+ #if OPENSSL_WITH_PQC
1258
1258
NODE_DEFINE_CONSTANT (target, EVP_PKEY_ML_DSA_44);
1259
1259
NODE_DEFINE_CONSTANT (target, EVP_PKEY_ML_DSA_65);
1260
1260
NODE_DEFINE_CONSTANT (target, EVP_PKEY_ML_DSA_87);
0 commit comments