Skip to content

Commit 2ee213a

Browse files
author
Antoine Lochet
committed
Fixed compilation when ML-DSA is not supported
Fixed compilation for mldsaAlgNameFromParameterSet as a constant
1 parent 579a245 commit 2ee213a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/lib/SoftHSM.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6359,6 +6359,7 @@ CK_RV SoftHSM::C_GenerateKeyPair
63596359
ispublicKeyToken, ispublicKeyPrivate, isprivateKeyToken, isprivateKeyPrivate);
63606360
}
63616361

6362+
#ifdef WITH_ML_DSA
63626363
if (pMechanism->mechanism == CKM_ML_DSA_KEY_PAIR_GEN)
63636364
{
63646365
return this->generateMLDSA(hSession,
@@ -6367,7 +6368,7 @@ CK_RV SoftHSM::C_GenerateKeyPair
63676368
phPublicKey, phPrivateKey,
63686369
ispublicKeyToken, ispublicKeyPrivate, isprivateKeyToken, isprivateKeyPrivate);
63696370
}
6370-
6371+
#endif
63716372
return CKR_GENERAL_ERROR;
63726373
}
63736374

@@ -10077,6 +10078,7 @@ CK_RV SoftHSM::generateED
1007710078
return rv;
1007810079
}
1007910080

10081+
#ifdef WITH_ML_DSA
1008010082
// Generate an MLDSA key pair
1008110083
CK_RV SoftHSM::generateMLDSA
1008210084
(CK_SESSION_HANDLE hSession,
@@ -10335,6 +10337,7 @@ CK_RV SoftHSM::generateMLDSA
1033510337

1033610338
return rv;
1033710339
}
10340+
#endif
1033810341

1033910342
// Generate a DH key pair
1034010343
CK_RV SoftHSM::generateDH

src/lib/crypto/OSSLUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ int OSSL::byteString2oid(const ByteString& byteString)
223223
#ifdef WITH_ML_DSA
224224
const char* OSSL::mldsaParameterSet2Name(unsigned long parameterSet) {
225225

226-
std::map<unsigned long, const char*>::iterator it = mldsaAlgNameFromParameterSet.find(parameterSet);
226+
std::map<unsigned long, const char*>::const_iterator it = mldsaAlgNameFromParameterSet.find(parameterSet);
227227

228228
if (it != mldsaAlgNameFromParameterSet.end()) {
229229
return it->second;

0 commit comments

Comments
 (0)