diff --git a/src/tests/cipher.cpp b/src/tests/cipher.cpp index 8cf44370f3..bb8b0c1d03 100644 --- a/src/tests/cipher.cpp +++ b/src/tests/cipher.cpp @@ -1222,4 +1222,12 @@ TEST_F(rnp_tests, test_windows_botan_crash) assert_int_equal(botan_cipher_reset(cipher), 0); assert_int_equal(botan_cipher_destroy(cipher), 0); } + +TEST_F(rnp_tests, test_botan_hex_decode) +{ + std::string str = "BC6709B15C23A4A"; + std::vector res(str.size() / 2 + 2); + size_t len = rnp::hex_decode(str.c_str(), res.data(), res.size()); + res.resize(len); +} #endif diff --git a/src/tests/ffi.cpp b/src/tests/ffi.cpp index 14629660a0..583224c039 100644 --- a/src/tests/ffi.cpp +++ b/src/tests/ffi.cpp @@ -1461,18 +1461,29 @@ TEST_F(rnp_tests, test_ffi_locate_key) { rnp_key_handle_t key = NULL; assert_rnp_failure(rnp_locate_key(NULL, "keyid", "7BC6709B15C23A4A", &key)); + RNP_LOG("1"); assert_rnp_failure(rnp_locate_key(ffi, NULL, "7BC6709B15C23A4A", &key)); + RNP_LOG("2"); assert_rnp_failure(rnp_locate_key(ffi, "keyid", NULL, &key)); + RNP_LOG("3"); assert_rnp_failure(rnp_locate_key(ffi, "keyid", "7BC6709B15C23A4A", NULL)); + RNP_LOG("4"); assert_rnp_failure(rnp_locate_key(ffi, "wrong", "7BC6709B15C23A4A", &key)); + RNP_LOG("5"); assert_rnp_failure(rnp_locate_key(ffi, "keyid", "BC6709B15C23A4A", &key)); + RNP_LOG("6"); assert_rnp_failure(rnp_locate_key(ffi, "keyid", "C6709B15C23A4A", &key)); + RNP_LOG("7"); assert_rnp_failure( rnp_locate_key(ffi, "fingerprint", "5A3CBF583AA80A2CCC53AA7BC6709B15C23A4A", &key)); + RNP_LOG("8"); assert_rnp_failure( rnp_locate_key(ffi, "grip", "D6A0800A3FACDE0C0EB60B16B3669ED380FDFA", &key)); + RNP_LOG("9"); assert_rnp_failure(rnp_locate_key(ffi, "keyid", "0x7BC6 709B\r15C2 3A4A\n", &key)); + RNP_LOG("10"); assert_rnp_success(rnp_locate_key(ffi, "keyid", "0x7BC6 709B\t15C2 3A4A\t", &key)); + RNP_LOG("11"); assert_non_null(key); rnp_key_handle_destroy(key); }