Skip to content

Commit bb95742

Browse files
committed
address comments
1 parent 8e3063f commit bb95742

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

examples/linux/nat20test/test/nat20_integration_test.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,18 @@ static void test_level3(void) {
11181118
TEST_PASS();
11191119
}
11201120

1121+
static void test_promote_1_to_2(void) {
1122+
TEST_BEGIN("Promote from level 1 to level 2");
1123+
ASSERT(do_promote(compressed_input, sizeof(compressed_input)), "Promote failed");
1124+
TEST_PASS();
1125+
}
1126+
1127+
static void test_promote_2_to_3(void) {
1128+
TEST_BEGIN("Promote from level 2 to level 3");
1129+
ASSERT(do_promote(compressed_input, sizeof(compressed_input)), "Promote failed");
1130+
TEST_PASS();
1131+
}
1132+
11211133
int main(void) {
11221134
printf("nat20 integration test suite\n");
11231135
printf("============================\n\n");
@@ -1133,9 +1145,9 @@ int main(void) {
11331145

11341146
/* Full parameterized chain test (promote is irreversible — runs once) */
11351147
test_level1();
1136-
do_promote(compressed_input, sizeof(compressed_input));
1148+
test_promote_1_to_2();
11371149
test_level2();
1138-
do_promote(compressed_input, sizeof(compressed_input));
1150+
test_promote_2_to_3();
11391151
test_level3();
11401152

11411153
printf("\n============================\n");

examples/linux/nat20test/test/test_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ n20_error_t test_compress_cdi_input(uint8_t const* code_hash,
6666
*
6767
* @param cert_der DER-encoded certificate
6868
* @param cert_der_size Size of the certificate
69-
* @param issuer_pubkey Raw public key (x||y for EC, compressed for Ed25519)
69+
* @param issuer_pubkey Raw public key (0x04||x||y for EC, compressed for Ed25519)
7070
* @param issuer_pubkey_size Size of the public key
7171
* @param key_type Key type of the issuer
7272
* @return true if signature is valid

0 commit comments

Comments
 (0)