mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Fix missing-prototype errors in sample programs
Signed-off-by: Michael Schuster <michael@schuster.ms>
This commit is contained in:
committed by
Minos Galanakis
parent
e708e86a9b
commit
8db8d6182f
@@ -111,12 +111,12 @@ const char buf_ln_err[] = "Buffer does not have enough data to complete the pars
|
||||
/*
|
||||
* Basic printing functions
|
||||
*/
|
||||
void print_version(void)
|
||||
static void print_version(void)
|
||||
{
|
||||
printf("%s v%d.%d\n", PROG_NAME, VER_MAJOR, VER_MINOR);
|
||||
}
|
||||
|
||||
void print_usage(void)
|
||||
static void print_usage(void)
|
||||
{
|
||||
print_version();
|
||||
printf("\nThis program is used to deserialize an Mbed TLS SSL session from the base64 code provided\n"
|
||||
@@ -138,7 +138,7 @@ void print_usage(void)
|
||||
);
|
||||
}
|
||||
|
||||
void printf_dbg(const char *str, ...)
|
||||
static void printf_dbg(const char *str, ...)
|
||||
{
|
||||
if (debug) {
|
||||
va_list args;
|
||||
@@ -151,7 +151,7 @@ void printf_dbg(const char *str, ...)
|
||||
}
|
||||
|
||||
MBEDTLS_PRINTF_ATTRIBUTE(1, 2)
|
||||
void printf_err(const char *str, ...)
|
||||
static void printf_err(const char *str, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, str);
|
||||
@@ -165,7 +165,7 @@ void printf_err(const char *str, ...)
|
||||
/*
|
||||
* Exit from the program in case of error
|
||||
*/
|
||||
void error_exit(void)
|
||||
static void error_exit(void)
|
||||
{
|
||||
if (NULL != b64_file) {
|
||||
fclose(b64_file);
|
||||
@@ -176,7 +176,7 @@ void error_exit(void)
|
||||
/*
|
||||
* This function takes the input arguments of this program
|
||||
*/
|
||||
void parse_arguments(int argc, char *argv[])
|
||||
static void parse_arguments(int argc, char *argv[])
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
@@ -223,7 +223,7 @@ void parse_arguments(int argc, char *argv[])
|
||||
/*
|
||||
* This function prints base64 code to the stdout
|
||||
*/
|
||||
void print_b64(const uint8_t *b, size_t len)
|
||||
static void print_b64(const uint8_t *b, size_t len)
|
||||
{
|
||||
size_t i = 0;
|
||||
const uint8_t *end = b + len;
|
||||
@@ -247,7 +247,7 @@ void print_b64(const uint8_t *b, size_t len)
|
||||
* /p in_line number of bytes in one line
|
||||
* /p prefix prefix for the new lines
|
||||
*/
|
||||
void print_hex(const uint8_t *b, size_t len,
|
||||
static void print_hex(const uint8_t *b, size_t len,
|
||||
const size_t in_line, const char *prefix)
|
||||
{
|
||||
size_t i = 0;
|
||||
@@ -271,7 +271,7 @@ void print_hex(const uint8_t *b, size_t len,
|
||||
/*
|
||||
* Print the value of time_t in format e.g. 2020-01-23 13:05:59
|
||||
*/
|
||||
void print_time(const uint64_t *time)
|
||||
static void print_time(const uint64_t *time)
|
||||
{
|
||||
#if defined(MBEDTLS_HAVE_TIME)
|
||||
char buf[20];
|
||||
@@ -292,7 +292,7 @@ void print_time(const uint64_t *time)
|
||||
/*
|
||||
* Print the input string if the bit is set in the value
|
||||
*/
|
||||
void print_if_bit(const char *str, int bit, int val)
|
||||
static void print_if_bit(const char *str, int bit, int val)
|
||||
{
|
||||
if (bit & val) {
|
||||
printf("\t%s\n", str);
|
||||
@@ -302,7 +302,7 @@ void print_if_bit(const char *str, int bit, int val)
|
||||
/*
|
||||
* Return pointer to hardcoded "enabled" or "disabled" depending on the input value
|
||||
*/
|
||||
const char *get_enabled_str(int is_en)
|
||||
static const char *get_enabled_str(int is_en)
|
||||
{
|
||||
return (is_en) ? "enabled" : "disabled";
|
||||
}
|
||||
@@ -310,7 +310,7 @@ const char *get_enabled_str(int is_en)
|
||||
/*
|
||||
* Return pointer to hardcoded MFL string value depending on the MFL code at the input
|
||||
*/
|
||||
const char *get_mfl_str(int mfl_code)
|
||||
static const char *get_mfl_str(int mfl_code)
|
||||
{
|
||||
switch (mfl_code) {
|
||||
case MBEDTLS_SSL_MAX_FRAG_LEN_NONE:
|
||||
@@ -343,7 +343,7 @@ const char *get_mfl_str(int mfl_code)
|
||||
* \retval number of bytes written in to the b64 buffer or 0 in case no more
|
||||
* data was found
|
||||
*/
|
||||
size_t read_next_b64_code(uint8_t **b64, size_t *max_len)
|
||||
static size_t read_next_b64_code(uint8_t **b64, size_t *max_len)
|
||||
{
|
||||
int valid_balance = 0; /* balance between valid and invalid characters */
|
||||
size_t len = 0;
|
||||
@@ -443,7 +443,7 @@ size_t read_next_b64_code(uint8_t **b64, size_t *max_len)
|
||||
* /p ssl pointer to serialized certificate
|
||||
* /p len number of bytes in the buffer
|
||||
*/
|
||||
void print_deserialized_ssl_cert(const uint8_t *ssl, uint32_t len)
|
||||
static void print_deserialized_ssl_cert(const uint8_t *ssl, uint32_t len)
|
||||
{
|
||||
enum { STRLEN = 4096 };
|
||||
mbedtls_x509_crt crt;
|
||||
@@ -509,7 +509,7 @@ void print_deserialized_ssl_cert(const uint8_t *ssl, uint32_t len)
|
||||
* /p len number of bytes in the buffer
|
||||
* /p session_cfg_flag session configuration flags
|
||||
*/
|
||||
void print_deserialized_ssl_session(const uint8_t *ssl, uint32_t len,
|
||||
static void print_deserialized_ssl_session(const uint8_t *ssl, uint32_t len,
|
||||
int session_cfg_flag)
|
||||
{
|
||||
const struct mbedtls_ssl_ciphersuite_t *ciphersuite_info;
|
||||
@@ -746,7 +746,7 @@ void print_deserialized_ssl_session(const uint8_t *ssl, uint32_t len,
|
||||
* /p ssl pointer to serialized session
|
||||
* /p len number of bytes in the buffer
|
||||
*/
|
||||
void print_deserialized_ssl_context(const uint8_t *ssl, size_t len)
|
||||
static void print_deserialized_ssl_context(const uint8_t *ssl, size_t len)
|
||||
{
|
||||
const uint8_t *end = ssl + len;
|
||||
uint32_t session_len;
|
||||
|
Reference in New Issue
Block a user