Skip to content

Commit

Permalink
Revert "Add some debug logging to debug windows runner failure."
Browse files Browse the repository at this point in the history
This reverts commit 4899ebf.
  • Loading branch information
ni4 committed Jul 24, 2024
1 parent 4899ebf commit c284481
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/tests/key-protect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ TEST_F(rnp_tests, test_key_protect_load_pgp)

TEST_F(rnp_tests, test_key_protect_sec_data)
{
RNP_LOG("Here 0");
rnp_keygen_primary_desc_t pri_desc = {};
pri_desc.crypto.key_alg = PGP_PKA_RSA;
pri_desc.crypto.rsa.modulus_bit_len = 1024;
Expand All @@ -244,7 +243,6 @@ TEST_F(rnp_tests, test_key_protect_sec_data)
sub_desc.crypto.ctx = &global_ctx;

/* generate raw unprotected keypair */
RNP_LOG("Here 1");
pgp_key_t skey, pkey, ssub, psub;
pgp_password_provider_t prov = {};
assert_true(pgp_generate_primary_key(pri_desc, true, skey, pkey, PGP_KEY_STORE_GPG));
Expand All @@ -263,10 +261,8 @@ TEST_F(rnp_tests, test_key_protect_sec_data)
memcpy(raw_ssub, ssub.pkt().sec_data, 32);
pgp_key_pkt_t *skeypkt;
pgp_key_pkt_t *ssubpkt;
RNP_LOG("Here 2");
#if defined(__has_feature)
#if !__has_feature(address_sanitizer)
RNP_LOG("Here 3");
/* copy keys and delete, making sure secret data is wiped*/
pgp_key_t *skeycp = new pgp_key_t(skey);
pgp_key_t *ssubcp = new pgp_key_t(ssub);
Expand Down Expand Up @@ -294,7 +290,7 @@ TEST_F(rnp_tests, test_key_protect_sec_data)
raw_ssub_ptr = ssub.pkt().sec_data;
#endif
#endif
RNP_LOG("Here 4");

/* protect key and subkey */
pgp_password_provider_t pprov(string_copy_password_callback, (void *) "password");
rnp_key_protection_params_t prot = {};
Expand All @@ -304,12 +300,10 @@ TEST_F(rnp_tests, test_key_protect_sec_data)
assert_int_not_equal(memcmp(raw_ssub, ssub.pkt().sec_data, 32), 0);
#if defined(__has_feature)
#if !__has_feature(address_sanitizer)
RNP_LOG("Here 5");
assert_int_not_equal(memcmp(raw_skey, raw_skey_ptr, 32), 0);
assert_int_not_equal(memcmp(raw_ssub, raw_ssub_ptr, 32), 0);
#endif
#endif
RNP_LOG("Here 6");
/* make sure rawpkt is also protected */
skeypkt = new pgp_key_pkt_t();
pgp_source_t memsrc = {};
Expand All @@ -328,7 +322,6 @@ TEST_F(rnp_tests, test_key_protect_sec_data)
assert_int_not_equal(memcmp(raw_ssub, ssubpkt->sec_data, 32), 0);
assert_int_equal(ssubpkt->sec_protection.s2k.specifier, PGP_S2KS_ITERATED_AND_SALTED);
delete ssubpkt;
RNP_LOG("Here 7");

/* unlock and make sure sec_data is not decrypted */
assert_true(skey.unlock(pprov));
Expand All @@ -353,7 +346,6 @@ TEST_F(rnp_tests, test_key_protect_sec_data)
assert_true(skey.lock());
assert_true(ssub.lock());
/* make sure rawpkt is also protected */
RNP_LOG("Here 8");
skeypkt = new pgp_key_pkt_t();
assert_rnp_success(
init_mem_src(&memsrc, skey.rawpkt().raw.data(), skey.rawpkt().raw.size(), false));
Expand Down

0 comments on commit c284481

Please sign in to comment.