Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VCA in exe_conn, to allow use only execute VCA then do KEY_EXCHANGE. #389

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/spdm_emu.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This document describes spdm_requester_emu and spdm_responder_emu tool. It can b
[--save_state <NegotiateStateFileName>]
[--load_state <NegotiateStateFileName>]
[--exe_mode SHUTDOWN|CONTINUE]
[--exe_conn VER_ONLY|DIGEST|CERT|CHAL|MEAS|MEL|GET_CSR|SET_CERT|GET_KEY_PAIR_INFO|SET_KEY_PAIR_INFO]
[--exe_conn VER_ONLY|VCA|DIGEST|CERT|CHAL|MEAS|MEL|GET_CSR|SET_CERT|GET_KEY_PAIR_INFO|SET_KEY_PAIR_INFO]
[--exe_session KEY_EX|PSK|NO_END|KEY_UPDATE|HEARTBEAT|MEAS|DIGEST|CERT|GET_CSR|SET_CERT|APP]
[--pcap <PcapFileName>]
[--priv_key_mode PEM|RAW]
Expand Down Expand Up @@ -85,6 +85,7 @@ This document describes spdm_requester_emu and spdm_responder_emu tool. It can b
The version for responder must be provisioned from ver.
The capabilities for local and peer are from cap|peer_cap.
The negotiated algorithms are from hash|meas_spec|meas_hash|asym|req_asym|dhe|aead|key_schedule|other_param and they shall have at most 1 bit set.
VCA can be used when all other commands are skipped.
DIGEST means send GET_DIGESTS command.
CERT means send GET_CERTIFICATE command.
CHAL means send CHALLENGE command.
Expand Down
11 changes: 5 additions & 6 deletions spdm_emu/spdm_emu_common/spdm_emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void print_usage(const char *name)
printf(" [--save_state <NegotiateStateFileName>]\n");
printf(" [--load_state <NegotiateStateFileName>]\n");
printf(" [--exe_mode SHUTDOWN|CONTINUE]\n");
printf(" [--exe_conn VER_ONLY|DIGEST|CERT|CHAL|MEAS|MEL|GET_CSR|SET_CERT|GET_KEY_PAIR_INFO|SET_KEY_PAIR_INFO]\n");
printf(" [--exe_conn VER_ONLY|VCA|DIGEST|CERT|CHAL|MEAS|MEL|GET_CSR|SET_CERT|GET_KEY_PAIR_INFO|SET_KEY_PAIR_INFO]\n");
printf(" [--exe_session KEY_EX|PSK|NO_END|KEY_UPDATE|HEARTBEAT|MEAS|MEL|DIGEST|CERT|GET_CSR|SET_CERT|GET_KEY_PAIR_INFO|SET_KEY_PAIR_INFO|APP]\n");
printf(" [--pcap <pcap_file_name>]\n");
printf(" [--priv_key_mode PEM|RAW]\n");
Expand Down Expand Up @@ -158,6 +158,7 @@ void print_usage(const char *name)
printf(" The capablities for local and peer are from cap|peer_cap.\n");
printf(
" The negotiated algorithms are from hash|meas_spec|meas_hash|asym|req_asym|dhe|aead|key_schedule|other_param and they shall have at most 1 bit set.\n");
printf(" VCA can be used when all other commands are skipped.\n");
printf(" DIGEST means send GET_DIGESTS command.\n");
printf(" CERT means send GET_CERTIFICATE command.\n");
printf(" CHAL means send CHALLENGE command.\n");
Expand Down Expand Up @@ -408,6 +409,7 @@ value_string_entry_t m_exe_mode_string_table[] = {

value_string_entry_t m_exe_connection_string_table[] = {
{ EXE_CONNECTION_VERSION_ONLY, "VER_ONLY" },
{ 0, "VCA" },
{ EXE_CONNECTION_DIGEST, "DIGEST" },
{ EXE_CONNECTION_CERT, "CERT" },
{ EXE_CONNECTION_CHAL, "CHAL" },
Expand Down Expand Up @@ -481,11 +483,8 @@ bool get_flags_from_name(const value_string_entry_t *table,
*flags |= value;
flag_name = strtok(NULL, ",");
}
if (*flags == 0) {
ret = false;
} else {
ret = true;
}
/* allow *flags to be 0 */
ret = true;
done:
free(local_name);
return ret;
Expand Down
Loading