@@ -2517,6 +2517,8 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2517
2517
Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into( ) ) ,
2518
2518
Attribute :: Sign ( true ) ,
2519
2519
Attribute :: Verify ( true ) ,
2520
+ Attribute :: Encrypt ( false ) ,
2521
+ Attribute :: Decrypt ( false ) ,
2520
2522
] ,
2521
2523
vec ! [
2522
2524
Attribute :: Token ( true ) ,
@@ -2525,6 +2527,8 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2525
2527
Attribute :: KeyType ( KeyType :: GENERIC_SECRET ) ,
2526
2528
Attribute :: ValueLen ( 1 . into( ) ) ,
2527
2529
Attribute :: Derive ( true ) ,
2530
+ Attribute :: Encrypt ( false ) ,
2531
+ Attribute :: Decrypt ( false ) ,
2528
2532
] ,
2529
2533
] ;
2530
2534
@@ -2601,6 +2605,8 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2601
2605
Attribute :: Sign ( true ) ,
2602
2606
Attribute :: Verify ( true ) ,
2603
2607
Attribute :: Derive ( false ) ,
2608
+ Attribute :: Encrypt ( false ) ,
2609
+ Attribute :: Decrypt ( false ) ,
2604
2610
] ,
2605
2611
vec ! [
2606
2612
Attribute :: Class ( ObjectClass :: SECRET_KEY ) ,
@@ -2611,14 +2617,19 @@ fn kbkdf_additional_keys_counter_mode() -> TestResult {
2611
2617
Attribute :: Sign ( false ) ,
2612
2618
Attribute :: Verify ( false ) ,
2613
2619
Attribute :: Derive ( true ) ,
2620
+ Attribute :: Encrypt ( false ) ,
2621
+ Attribute :: Decrypt ( false ) ,
2614
2622
] ,
2615
2623
] ;
2616
2624
2617
2625
for ( key, wanted_attributes) in derived_keys. iter ( ) . zip ( wanted_attributes. iter ( ) . cycle ( ) ) {
2618
2626
let have_attributes = session. get_attributes ( * key, & attributes_to_check) ?;
2619
2627
2620
2628
for ( value_wanted, value_have) in wanted_attributes. iter ( ) . zip ( have_attributes. iter ( ) ) {
2621
- assert_eq ! ( value_wanted, value_have) ;
2629
+ assert_eq ! (
2630
+ value_wanted, value_have,
2631
+ "The generated key {key} has unexpected attribute value"
2632
+ ) ;
2622
2633
}
2623
2634
}
2624
2635
@@ -2673,6 +2684,8 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2673
2684
Attribute :: ValueLen ( ( AES128_BLOCK_SIZE as u64 ) . into( ) ) ,
2674
2685
Attribute :: Sign ( true ) ,
2675
2686
Attribute :: Verify ( true ) ,
2687
+ Attribute :: Encrypt ( false ) ,
2688
+ Attribute :: Decrypt ( false ) ,
2676
2689
] ,
2677
2690
vec ! [
2678
2691
Attribute :: Token ( true ) ,
@@ -2681,6 +2694,8 @@ fn kbkdf_additional_keys_feedback_mode() -> TestResult {
2681
2694
Attribute :: KeyType ( KeyType :: GENERIC_SECRET ) ,
2682
2695
Attribute :: ValueLen ( 1 . into( ) ) ,
2683
2696
Attribute :: Derive ( true ) ,
2697
+ Attribute :: Encrypt ( false ) ,
2698
+ Attribute :: Decrypt ( false ) ,
2684
2699
] ,
2685
2700
] ;
2686
2701
0 commit comments