Skip to content

Commit

Permalink
Merge pull request #691 from Mellanox/master_devel
Browse files Browse the repository at this point in the history
Master devel 4.22
  • Loading branch information
tomer540 authored Oct 31, 2022
2 parents 3cc3b72 + 593fe14 commit b47b67c
Show file tree
Hide file tree
Showing 132 changed files with 149,824 additions and 8,839 deletions.
8 changes: 5 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

dnl Process this file with autoconf to produce a configure script.

AC_INIT(mstflint, 4.21.0, [email protected])
AC_INIT(mstflint, 4.22.0, [email protected])

AC_DEFINE_UNQUOTED([PROJECT], ["mstflint"], [Define the project name.])
AC_SUBST([PROJECT])

AC_DEFINE_UNQUOTED([VERSION], ["4.21.0"], [Define the project version.])
AC_DEFINE_UNQUOTED([VERSION], ["4.22.0"], [Define the project version.])
AC_SUBST([VERSION])

AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -431,9 +431,11 @@ else
AC_CONFIG_FILES(mtcr_ul/Makefile)
fi

AM_CONDITIONAL(LINUX_BUILD, [test "x$OS" = "xLinux"])
AC_SUBST(LINUX_BUILD)

AC_OUTPUT( Makefile common/Makefile mft_utils/Makefile mft_utils/hsmclient/Makefile mtcr_py/Makefile ext_libs/Makefile ext_libs/sqlite/Makefile ext_libs/muparser/Makefile ext_libs/json/Makefile ext_libs/minixz/Makefile dev_mgt/Makefile \
tools_layouts/Makefile reg_access/Makefile cmdif/Makefile libmfa/Makefile pldmlib/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mlxconfig/mlxconfig_dbs/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile \
flint/Makefile small_utils/Makefile small_utils/mlxfwresetlib/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile mvpd/Makefile \
fw_comps_mgr/Makefile mad_ifc/Makefile tracers/Makefile tracers/fwtrace/Makefile resourcedump/Makefile resourceparse/Makefile )
fw_comps_mgr/Makefile mad_ifc/Makefile tracers/Makefile tracers/fwtrace/Makefile resourcedump/Makefile resourcedump/resourcedump_lib/Makefile resourceparse/Makefile )

6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
mstflint (4.22.0-1) unstable; urgency=low

* Updated from MFT-4.22.0

-- Alex Blago <[email protected]> Thu, 8 Sep 2022 00:00:00 +0000

mstflint (4.21.0-1) unstable; urgency=low

* Updated from MFT-4.21.0
Expand Down
2 changes: 1 addition & 1 deletion ext_libs/iniParser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ You should consider trying the following rules too :
## III - License

This software is released under MIT License.
See LICENSE for full informations
See LICENSE for full information

## IV - Versions

Expand Down
2 changes: 1 addition & 1 deletion ext_libs/iniParser/dictionary.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This module implements a simple dictionary object, i.e. a list
of string/string associations. This object is useful to store e.g.
informations retrieved from a configuration file (ini files).
information retrieved from a configuration file (ini files).
*/
/*--------------------------------------------------------------------------*/

Expand Down
2 changes: 1 addition & 1 deletion ext_libs/iniParser/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This module implements a simple dictionary object, i.e. a list
of string/string associations. This object is useful to store e.g.
informations retrieved from a configuration file (ini files).
information retrieved from a configuration file (ini files).
*/
/*--------------------------------------------------------------------------*/

Expand Down
2 changes: 1 addition & 1 deletion ext_libs/iniParser/iniparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ typedef enum _line_status_
@param in String to convert.
@param out Output buffer.
@param len Size of the out buffer.
@return ptr to the out buffer or NULL if an error occured.
@return ptr to the out buffer or NULL if an error occurred.
This function convert a string into lowercase.
At most len - 1 elements of the input string will be converted.
Expand Down
4 changes: 2 additions & 2 deletions ext_libs/sqlite/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -109831,7 +109831,7 @@ static RenameToken *renameColumnTokenNext(RenameCtx *pCtx){
}

/*
** An error occured while parsing or otherwise processing a database
** An error occurred while parsing or otherwise processing a database
** object (either pParse->pNewTable, pNewIndex or pNewTrigger) as part of an
** ALTER TABLE RENAME COLUMN program. The error message emitted by the
** sub-routine is currently stored in pParse->zErrMsg. This function
Expand Down Expand Up @@ -214381,7 +214381,7 @@ static int sessionBindRow(
** iterator pIter points to to the SELECT and attempts to seek to the table
** entry. If a row is found, the SELECT statement left pointing at the row
** and SQLITE_ROW is returned. Otherwise, if no row is found and no error
** has occured, the statement is reset and SQLITE_OK is returned. If an
** has occurred, the statement is reset and SQLITE_OK is returned. If an
** error occurs, the statement is reset and an SQLite error code is returned.
**
** If this function returns SQLITE_ROW, the caller must eventually reset()
Expand Down
107 changes: 39 additions & 68 deletions flint/cmd_line_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ SubCmdMetaData::SubCmdMetaData()
_sCmds.push_back(new SubCmd("ir", "image_reactivation", SC_Image_Reactivation));
_sCmds.push_back(new SubCmd("bc", "binary_compare", SC_Binary_Compare));
_sCmds.push_back(new SubCmd("", "rsa_sign", SC_RSA_Sign));
_sCmds.push_back(new SubCmd("", "import_hsm_key", SC_Import_Hsm_Key));
_sCmds.push_back(new SubCmd("", "export_public_key", SC_Export_Public_Key));
}

Expand Down Expand Up @@ -232,11 +231,6 @@ FlagMetaData::FlagMetaData()
_flags.push_back(new Flag("", "activate_delay_sec", 1));
_flags.push_back(new Flag("", "downstream_device_ids", 1));
_flags.push_back(new Flag("", "download_transfer", 0));
#ifndef __WIN__
_flags.push_back(new Flag("", "private_key_label", 1));
_flags.push_back(new Flag("", "public_key_label", 1));
_flags.push_back(new Flag("", "hsm", 0));
#endif
_flags.push_back(new Flag("", "openssl_engine", 1));
_flags.push_back(new Flag("", "openssl_key_id", 1));
#ifdef __WIN__
Expand Down Expand Up @@ -784,8 +778,6 @@ void Flint::initCmdParser()

AddOptions("ocr", ' ', "", "another flag for override cache replacement", true);

AddOptions("hsm", ' ', "", "flag for the sign command", true);

AddOptions("private_key", ' ', "<key_file>", "path to PEM formatted private key to be used by the sign command");

AddOptions("public_key", ' ', "<key_file>", "path to PEM formatted public key to be used by the sign command");
Expand Down Expand Up @@ -821,65 +813,61 @@ void Flint::initCmdParser()
AddOptions("linkx_auto_update", ' ', "", "Use this flag while burning all cable devices connected to host.", false,
false, 1);

AddOptions(
"activate",
' ',
"",
"Use this flag to apply the activation of all cable devices connected to host. By default, the activation is not performed.",
false,
false,
1);
AddOptions("activate",
' ',
"",
"Use this flag to apply the activation of all cable devices connected to host. By default, the "
"activation is not performed.",
false,
false,
1);

AddOptions(
"activate_delay_sec",
' ',
"<timeout in seconds>",
"Use this flag to activate all cable devices connected to host with delay, acceptable values are between 0 and 255 (default - 1). Important: 'activate' flag must be set. This flag is relevant only for cable components.",
"Use this flag to activate all cable devices connected to host with delay, acceptable values are between 0 and "
"255 (default - 1). Important: 'activate' flag must be set. This flag is relevant only for cable components.",
false,
false,
1);

AddOptions(
"download_transfer",
' ',
"",
"Use this flag to perform the download and transfer of all cable data for cables. By default, the download and transfer are not performed . This flag is relevant only for cable components.",
false,
false,
1);

AddOptions(
"downstream_device_ids",
' ',
"<list of ports>",
"Use this flag to specify the LNKX ports to perform query. List must be only comma-separated numbers, without spaces.",
false,
false,
1);
AddOptions("download_transfer",
' ',
"",
"Use this flag to perform the download and transfer of all cable data for cables. By default, the "
"download and transfer are not performed . This flag is relevant only for cable components.",
false,
false,
1);

#ifndef __WIN__
AddOptions("public_key_label", ' ', "<string>", "public key label to be used by the sign --hsm command");
AddOptions("downstream_device_ids",
' ',
"<list of ports>",
"Use this flag to specify the LNKX ports to perform query. List must be only comma-separated numbers, "
"without spaces.",
false,
false,
1);

AddOptions("private_key_label", ' ', "<string>", "private key label to be used by the sign --hsm command");
#endif
AddOptions(
"openssl_engine",
' ',
"<string>",
"Name of the OpenSSL engine to used by the sign/rsa_sign commands to work with the HSM hardware via OpenSSL API");
AddOptions(
"openssl_key_id",
' ',
"<string>",
"Key identification string to be used by the sign/rsa_sign commands to work with the HSM hardware via OpenSSL API");
AddOptions("openssl_key_id",
' ',
"<string>",
"Key identification string to be used by the sign/rsa_sign commands to work with the HSM hardware via "
"OpenSSL API");
AddOptions("output_file", ' ', "<string>", "output file name for exporting the public key from PEM/BIN");
AddOptions("user_password", ' ', "<string>", "the HSM user password string in order to work with HSM device");
#ifdef __WIN__
AddOptions(
"cpu_util",
' ',
"<CPU_UTIL>",
"Use this flag to reduce CPU utilization while burning, Windows only. Legal values are from 1 (lowest CPU) to 5 (highest CPU)");
AddOptions("cpu_util",
' ',
"<CPU_UTIL>",
"Use this flag to reduce CPU utilization while burning, Windows only. Legal values are from 1 (lowest "
"CPU) to 5 (highest CPU)");
#endif
AddOptions(
"cert_chain_index",
Expand All @@ -906,9 +894,9 @@ void Flint::initCmdParser()

AddOptionalSectionData("RETURN VALUES", "0", "Successful completion.");
AddOptionalSectionData("RETURN VALUES", "1", "An error has occurred.");
AddOptionalSectionData(
"RETURN VALUES", "7",
"For burn command - burning new firmware option was not chosen by the user when prompted, thus the firmware burning process was aborted.");
AddOptionalSectionData("RETURN VALUES", "7",
"For burn command - burning new firmware option was not chosen by the user when prompted, "
"thus the firmware burning process was aborted.");

for (map_sub_cmd_t_to_subcommand::iterator it = _subcommands.begin(); it != _subcommands.end(); it++)
{
Expand Down Expand Up @@ -1207,17 +1195,14 @@ ParseStatus Flint::HandleOption(string name, string value)
}
else if (name == "private_key")
{
_flintParams.privkey_specified = true;
_flintParams.privkey_file = value;
}
else if (name == "public_key")
{
_flintParams.pubkey_specified = true;
_flintParams.pubkey_file = value;
}
else if (name == "key_uuid")
{
_flintParams.uuid_specified = true;
_flintParams.privkey_uuid = value;
}
else if (name == "hmac_key")
Expand Down Expand Up @@ -1263,10 +1248,6 @@ ParseStatus Flint::HandleOption(string name, string value)
}
_flintParams.cpu_percent = (int)cpu_percent;
}
else if (name == "hsm")
{
_flintParams.hsm_specified = true;
}
else if (name == "openssl_engine")
{
_flintParams.openssl_engine_usage_specified = true;
Expand All @@ -1277,16 +1258,6 @@ ParseStatus Flint::HandleOption(string name, string value)
_flintParams.openssl_engine_usage_specified = true;
_flintParams.openssl_key_id = value;
}
else if (name == "private_key_label")
{
_flintParams.private_key_label_specified = true;
_flintParams.private_key_label = value;
}
else if (name == "public_key_label")
{
_flintParams.public_key_label_specified = true;
_flintParams.public_key_label = value;
}
else if (name == "output_file")
{
_flintParams.output_file_specified = true;
Expand Down
28 changes: 6 additions & 22 deletions flint/err_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ typedef enum
#define FLINT_CLEAR_SEM_CMD_ERROR "No command is allowed when -clear_semaphore flag is given.\n"
#define FLINT_COMMAND_FLAGS_ERROR "For %s command, Please specify %s.\n"
#define FLINT_COMMAND_INCORRECT_FLAGS_ERROR "For %s command, %s.\n"
#define FLINT_PARSE_MEM_ERROR "Failed to allocate memory for parsing.\n "
#define FLINT_NO_OPTIONS_FOUND_ERROR "No options found. "
#define FLINT_INVALID_COMMAD_ERROR "Invalid command: %s\n"
#define FLINT_TOO_MANY_ARGS_ERROR "Too many arguments. Expected: %d , Received: %d\n"
Expand All @@ -85,8 +84,9 @@ typedef enum
#define FLINT_INVALID_FLAG_WITHOUT_FLAG_ERROR "\"%s\" flag must be specified with \"%s\" flag.\n"
#define FLINT_INVALID_FLAG_WITH_CMD_ERROR "Cannot specify flag: %s with Command: %s\n"
#define FLINT_CMD_VERIFY_ERROR "FW image verification failed: %s. AN HCA DEVICE CAN NOT BOOT FROM THIS IMAGE.\n"
#define FLINT_CMD_VERIFY_ERROR_1 \
"FW image verification failed: No valid FS4 image found.Check the flash parameters, if specified..AN HCA DEVICE CAN NOT BOOT FROM THIS IMAGE"
#define FLINT_CMD_VERIFY_ERROR_1 \
"FW image verification failed: No valid FS4 image found.Check the flash parameters, if specified..AN HCA DEVICE " \
"CAN NOT BOOT FROM THIS IMAGE"
#define FLINT_FAILED_QUERY_ERROR "Failed to query %s: %s. %s\n"
#define FLINT_COMMAND_DEVICE_IMAGE_ERROR "Command \"%s\" requires both image and device to be specified.\n"
#define FLINT_COMMAND_DEVICE_ERROR "Command \"%s\" requires device, but an image file was given.\n"
Expand All @@ -109,7 +109,6 @@ typedef enum
#define FLINT_IMAGE_READ_ERROR "Failed to read image. %s\n"
#define FLINT_READ_ERROR "Failed to read from %s. %s\n"
#define FLINT_READ_FILE_ERROR "Failed to read from %s.\n"
#define FLINT_WIN_NOT_SUPP_ERROR "Command \"%s\" is not supported in windows.\n"
#define FLINT_WIN_ONLY_SUPP_ERROR "Command \"%s\" is supported only in windows.\n"
#define FLINT_GEN_COMMAND_ERROR "Failed to execute command %s. %s\n"
#define FLINT_FS3_BB_ERROR \
Expand Down Expand Up @@ -138,14 +137,12 @@ typedef enum
#define FLINT_WB_FILE_ERROR "failed to open file: %s. %s\n"
#define FLINT_WB_ERROR "write Block Failed. %s\n"
#define FLINT_NO_ZLIB_ERROR "Executable was compiled with \"dump files\" option disabled.\n"
#define FLINT_FLAG_WITH_FLAG_ERROR "\"%s\" flag must be specified with \"%s\" flag.\n"
#define FLINT_INVALID_PASSWORD "Invalid Password.\n"
#define FLINT_NO_GUID_MAC_FLAGS_ERROR "Can not set GUIDs/MACs: please run with -uid/-guid/-mac flag.\n"
#define FLINT_NOT_SUPP_UID_FLAG_ERROR \
"Can not set GUIDs/MACs: %s flag is not supported for this device.\nPlease run with -uid/-guid/-mac flag.\n"
#define FLINT_NO_UID_FLAG_ERROR "Can not set GUIDs/MACs: uid is not specified, please run with -uid flag.\n"
#define FLINT_CHECKSUM_ERROR "Failed to calculate checksum on %s: %s\n"
#define FLINT_CHECKSUM_MISMATCH_ERROR "Given checksum: %s does not match the checksum calculated on device FW: %s.\n"
#define FLINT_CHECKSUM_PARSE_ERROR "Failed to parse given checksum.\n"
#define FLINT_CHECKSUM_LEN_ERROR "MD5 checksum should be exactly 16 bytes long.\n"
#define FLINT_CHECKSUM_HEX_ERROR "MD5 checksum should contain only hexadecimal digits.\n"
Expand All @@ -169,34 +166,21 @@ typedef enum
#define UNCOMPRESSS_ERROR "Failed uncompressing FW configuration section. uncompress returns %d"
#define OPEN_WRITE_FILE_ERROR "Can not open file %s for write: %s."
#define IMAGE_SIGN_TYPE_ERROR "Image signing is applicable only for selected FW images. Please check your image type.\n"
#define HSM_INIT_ERROR "HSM init has failed! Please check if the HSM card installed and configured properly.\n"
#define HSM_PRIVATE_KEY_DUPLICATE "Creating HSM signature has failed - the private key label is duplicated.\n"
#define HSM_PUBLIC_KEY_DUPLICATE "Creating HSM signature has failed - the public key label is duplicated.\n"
#define HSM_SIGNATURE_CREATION_FAILED "Creating HSM signature has failed\n"
#define HSM_UUID_MISSING "To Sign the image with RSA you must provide UUID with HSM sign.\n"
#define HSM_PRIVATE_KEY_LABEL_MISSING "Must supply private key label for sign with HSM sign.\n"
#define HSM_PASSWORD_MISSING "Must supply HSM user password for sign with HSM sign.\n"
#define SIGN_PRIVATE_KEY_NOT_FOUND "Can't find private key file %s \n"
#define SIGN_PUBLIC_KEY_NOT_FOUND "Can't find public key file %s \n"
#define HSM_BOOT_SIGNATURE_CREATION_FAILED "Creating HSM BOOT signature has failed\n"
#define HSM_CRITICAL_SIGNATURE_CREATION_FAILED "Creating HSM critical signature has failed\n"
#define HSM_NON_CRITICAL_SIGNATURE_CREATION_FAILED "Creating HSM non-critical signature has failed\n"
#define HSM_SECURE_BOOT_SIGNATURE_FAILED "Inserting secure BOOT signatures has failed : %s.\n"
#define HSM_SECURE_FW_SIGNATURE_FAILED "Creation secured FW signatures has failed.\n"
#define LINKX_QUERY_DEVICE_NOT_SUPPORTED "Linkx query for device %s is not supported.\n"
#define LINKX_BURN_DEVICE_NOT_SUPPORTED "Linkx burn for device %s is not supported.\n"
/**************************
* Flint Warning Messages
*************************/
#define FLINT_QQ_WARRNING "-W- Running quick query - Skipping full image integrity checks.\n"
#define FLINT_NOT_MLNX_FW_WARNING "-W- Not a Mellanox FW image (vendor_id = 0x%04x). VSD and PSID are not displayed.\n"
#define FLINT_BLANK_GUIDS_WARNING "-W- GUIDs/MACs values and their CRC are not set.\n"
#define FLINT_MULTI_BIT_WARNING "Multicast bit (bit 40) is set."
#define FLINT_MORE_48_BITS_WARNING "More than 48 bits are used."
#define FLINT_BAD_MAC_ADRESS_WARNING "\n-W- Bad mac address ( %4.4x%8.8x ): %s\n"
#define FLINT_MAC_ENTRIES_WARNING \
"-W- Cannot get MAC address: Expecting %d entries in guid section, got %d. Probably an old FW image. Please update.\n"
#define FLINT_INTERRUPT_WARRNING "\n-W- An internal error occurred. This program cannot be interrupted.\n"
#define FLINT_MAC_ENTRIES_WARNING \
"-W- Cannot get MAC address: Expecting %d entries in guid section, got %d. Probably an old FW image. Please " \
"update.\n"
#define FLINT_SET_GUIDS_WARRNING "-W- GUIDs are already set, re-burning image with the new GUIDs ...\n"
#define FLINT_OCR_WARRNING \
"\n-W- Firmware flash cache access is enabled. Running in this mode may cause the firmware to hang.\n"
Expand Down
3 changes: 1 addition & 2 deletions flint/flint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ map_sub_cmd_t_to_subcommand Flint::initSubcommandMap()
cmdMap[SC_Image_Reactivation] = new ImageReactivationSubCommand();
cmdMap[SC_RSA_Sign] = new SignRSASubCommand();
cmdMap[SC_Binary_Compare] = new BinaryCompareSubCommand();
cmdMap[SC_Import_Hsm_Key] = new ImportHsmKeySubCommand();
#ifndef NO_OPEN_SSL
cmdMap[SC_Export_Public_Key] = new ExportPublicSubCommand();
#endif
Expand Down Expand Up @@ -271,7 +270,7 @@ FlintStatus Flint::run(int argc, char* argv[])
if (_subcommands.count(_flintParams.cmd) == 0)
{
// should not be reached
printf("-E- FATAL: command object not found.");
printf("-E- FATAL: command object not found.\n");
return FLINT_FAILED;
}
_subcommands[_flintParams.cmd]->setParams(_flintParams);
Expand Down
Loading

0 comments on commit b47b67c

Please sign in to comment.