@@ -283,7 +283,7 @@ struct FipsMechanism {
283
283
/// Struct that holds FIPS properties for keys and mechanisms
284
284
struct FipsChecks {
285
285
keys : [ FipsKeyType ; 17 ] ,
286
- mechs : [ FipsMechanism ; 91 ] ,
286
+ mechs : [ FipsMechanism ; 93 ] ,
287
287
}
288
288
289
289
/// A constant instantiation of FIPS properties with a list
@@ -552,6 +552,19 @@ const FIPS_CHECKS: FipsChecks = FipsChecks {
552
552
restrictions : [ restrict ! ( CKK_EC ) , restrict ! ( ) ] ,
553
553
genflags : 0 ,
554
554
} ,
555
+ /* EDDSA */
556
+ FipsMechanism {
557
+ mechanism : CKM_EC_EDWARDS_KEY_PAIR_GEN ,
558
+ operations : CKF_GENERATE_KEY_PAIR ,
559
+ restrictions : [ restrict ! ( CKK_EC_EDWARDS ) , restrict ! ( ) ] ,
560
+ genflags : CKF_SIGN | CKF_VERIFY ,
561
+ } ,
562
+ FipsMechanism {
563
+ mechanism : CKM_EDDSA ,
564
+ operations : CKF_SIGN | CKF_VERIFY ,
565
+ restrictions : [ restrict ! ( CKK_EC_EDWARDS ) , restrict ! ( ) ] ,
566
+ genflags : 0 ,
567
+ } ,
555
568
/* AES */
556
569
FipsMechanism {
557
570
mechanism : CKM_AES_KEY_GEN ,
@@ -1315,6 +1328,17 @@ pub fn is_key_approved(key: &Object, op: CK_FLAGS) -> bool {
1315
1328
check_key ( key, op, None , None )
1316
1329
}
1317
1330
1331
+ /// Adds validation flag to the object, if it is not yet present
1332
+ /// and if the object passes validation rules.
1333
+ pub fn add_missing_validation_flag ( key : & mut Object ) {
1334
+ if let Ok ( _) = key. get_attr_as_ulong ( CKA_OBJECT_VALIDATION_FLAGS ) {
1335
+ return ;
1336
+ }
1337
+ if is_key_approved ( key, CK_UNAVAILABLE_INFORMATION ) {
1338
+ add_fips_flag ( key) ;
1339
+ }
1340
+ }
1341
+
1318
1342
/// Helper to check if an operation is approved
1319
1343
///
1320
1344
/// Applies key checks as well as mechanism checks according to the
0 commit comments