Skip to content

Commit b0c0611

Browse files
committed
new APIs for setting RSA keys by file
1 parent c308ca9 commit b0c0611

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/iperf_api.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,12 @@ iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_
746746
ipt->settings->client_rsa_pubkey = load_pubkey_from_base64(client_rsa_pubkey_base64);
747747
}
748748

749+
void
750+
iperf_set_test_client_rsa_pubkey_from_file(struct iperf_test *ipt, const char *client_rsa_pubkey_file)
751+
{
752+
ipt->settings->client_rsa_pubkey = load_pubkey_from_file(client_rsa_pubkey_file);
753+
}
754+
749755
void
750756
iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users)
751757
{
@@ -763,6 +769,12 @@ iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa
763769
{
764770
ipt->server_rsa_private_key = load_privkey_from_base64(server_rsa_privkey_base64);
765771
}
772+
773+
void
774+
iperf_set_test_server_rsa_privkey_from_file(struct iperf_test *ipt, const char *server_rsa_privkey_file)
775+
{
776+
ipt->server_rsa_private_key = load_privkey_from_file(server_rsa_privkey_file);
777+
}
766778
#endif // HAVE_SSL
767779

768780
void

src/iperf_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@ void iperf_set_on_test_finish_callback(struct iperf_test* ipt, void (*callbac
225225
void iperf_set_test_client_username(struct iperf_test *ipt, const char *client_username);
226226
void iperf_set_test_client_password(struct iperf_test *ipt, const char *client_password);
227227
void iperf_set_test_client_rsa_pubkey(struct iperf_test *ipt, const char *client_rsa_pubkey_base64);
228+
void iperf_set_test_client_rsa_pubkey_from_file(struct iperf_test *ipt, const char *client_rsa_pubkey_file);
228229
void iperf_set_test_server_authorized_users(struct iperf_test *ipt, const char *server_authorized_users);
229230
void iperf_set_test_server_skew_threshold(struct iperf_test *ipt, int server_skew_threshold);
230231
void iperf_set_test_server_rsa_privkey(struct iperf_test *ipt, const char *server_rsa_privkey_base64);
232+
void iperf_set_test_server_rsa_privkey_from_file(struct iperf_test *ipt, const char *server_rsa_privkey_file);
231233
#endif // HAVE_SSL
232234

233235
void iperf_set_test_connect_timeout(struct iperf_test *ipt, int ct);

0 commit comments

Comments
 (0)