@@ -1647,14 +1647,20 @@ exit:
1647
1647
/* END_CASE */
1648
1648
1649
1649
/* BEGIN_CASE */
1650
- void check_key_policy( int type_arg, int bits_arg,
1651
- int usage_arg, int alg_arg )
1650
+ void effective_key_attributes( int type_arg, int expected_type_arg,
1651
+ int bits_arg, int expected_bits_arg,
1652
+ int usage_arg, int expected_usage_arg,
1653
+ int alg_arg, int expected_alg_arg )
1652
1654
{
1653
1655
psa_key_handle_t handle = 0;
1654
1656
psa_key_type_t key_type = type_arg;
1657
+ psa_key_type_t expected_key_type = expected_type_arg;
1655
1658
size_t bits = bits_arg;
1659
+ size_t expected_bits = expected_bits_arg;
1656
1660
psa_algorithm_t alg = alg_arg;
1661
+ psa_algorithm_t expected_alg = expected_alg_arg;
1657
1662
psa_key_usage_t usage = usage_arg;
1663
+ psa_key_usage_t expected_usage = expected_usage_arg;
1658
1664
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
1659
1665
1660
1666
PSA_ASSERT( psa_crypto_init( ) );
@@ -1668,10 +1674,10 @@ void check_key_policy( int type_arg, int bits_arg,
1668
1674
psa_reset_key_attributes( &attributes );
1669
1675
1670
1676
PSA_ASSERT( psa_get_key_attributes( handle, &attributes ) );
1671
- TEST_EQUAL( psa_get_key_type( &attributes ), key_type );
1672
- TEST_EQUAL( psa_get_key_bits( &attributes ), bits );
1673
- TEST_EQUAL( psa_get_key_usage_flags( &attributes ), usage );
1674
- TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
1677
+ TEST_EQUAL( psa_get_key_type( &attributes ), expected_key_type );
1678
+ TEST_EQUAL( psa_get_key_bits( &attributes ), expected_bits );
1679
+ TEST_EQUAL( psa_get_key_usage_flags( &attributes ), expected_usage );
1680
+ TEST_EQUAL( psa_get_key_algorithm( &attributes ), expected_alg );
1675
1681
1676
1682
exit:
1677
1683
psa_destroy_key( handle );
@@ -1680,6 +1686,16 @@ exit:
1680
1686
}
1681
1687
/* END_CASE */
1682
1688
1689
+ /* BEGIN_CASE */
1690
+ void check_key_policy( int type_arg, int bits_arg,
1691
+ int usage_arg, int alg_arg )
1692
+ {
1693
+ test_effective_key_attributes( type_arg, type_arg, bits_arg, bits_arg,
1694
+ usage_arg, usage_arg, alg_arg, alg_arg );
1695
+ goto exit;
1696
+ }
1697
+ /* END_CASE */
1698
+
1683
1699
/* BEGIN_CASE */
1684
1700
void key_attributes_init( )
1685
1701
{
0 commit comments