File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -10064,8 +10064,8 @@ CK_RV SoftHSM::generateMLDSA
1006410064 return CKR_TEMPLATE_INCOMPLETE;
1006510065 }
1006610066
10067- if (paramSet != 1UL && paramSet != 2UL && paramSet != 3UL ) {
10068- INFO_MSG (" Wrong parameterSet : %ld " , paramSet);
10067+ if (paramSet != CKP_ML_DSA_44 && paramSet != CKP_ML_DSA_65 && paramSet != CKP_ML_DSA_87 ) {
10068+ INFO_MSG (" Unsupported parameter set : %lu " , ( unsigned long ) paramSet);
1006910069 return CKR_PARAMETER_SET_NOT_SUPPORTED;
1007010070 }
1007110071
Original file line number Diff line number Diff line change @@ -148,6 +148,16 @@ void OSSLMLDSAPrivateKey::createOSSLKey()
148148 ByteString localValue = getValue ();
149149
150150 const char * name = OSSL::mldsaParameterSet2Name (getParameterSet ());
151+ if (name == NULL )
152+ {
153+ ERROR_MSG (" Unknown ML-DSA parameter set (value length: %zu)" , localValue.size ());
154+ return ;
155+ }
156+ if (localValue.size () == 0 )
157+ {
158+ ERROR_MSG (" Empty ML-DSA private key value; cannot create EVP_PKEY" );
159+ return ;
160+ }
151161
152162 int selection = 0 ;
153163 EVP_PKEY_CTX *ctx = NULL ;
You can’t perform that action at this time.
0 commit comments