Adjust spacing in sample programs
Signed-off-by: Michael Schuster <michael@schuster.ms>
diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c
index 4ad1629..83d7b71 100644
--- a/programs/pkey/gen_key.c
+++ b/programs/pkey/gen_key.c
@@ -40,7 +40,7 @@
#define DEV_RANDOM_THRESHOLD 32
static int dev_random_entropy_poll(void *data, unsigned char *output,
- size_t len, size_t *olen)
+ size_t len, size_t *olen)
{
FILE *file;
size_t ret, left = len;
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index c95ff8e..07b72a6 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -598,7 +598,7 @@
#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
static int report_cid_usage(mbedtls_ssl_context *ssl,
- const char *additional_description)
+ const char *additional_description)
{
int ret;
unsigned char peer_cid[MBEDTLS_SSL_CID_OUT_LEN_MAX];
diff --git a/programs/ssl/ssl_context_info.c b/programs/ssl/ssl_context_info.c
index 9577d2b..51e8781 100644
--- a/programs/ssl/ssl_context_info.c
+++ b/programs/ssl/ssl_context_info.c
@@ -248,7 +248,7 @@
* /p prefix prefix for the new lines
*/
static void print_hex(const uint8_t *b, size_t len,
- const size_t in_line, const char *prefix)
+ const size_t in_line, const char *prefix)
{
size_t i = 0;
const uint8_t *end = b + len;
@@ -510,7 +510,7 @@
* /p session_cfg_flag session configuration flags
*/
static void print_deserialized_ssl_session(const uint8_t *ssl, uint32_t len,
- int session_cfg_flag)
+ int session_cfg_flag)
{
const struct mbedtls_ssl_ciphersuite_t *ciphersuite_info;
int ciphersuite_id;
diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index 51167b1..679956c 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -879,7 +879,7 @@
* SNI callback.
*/
static int sni_callback(void *p_info, mbedtls_ssl_context *ssl,
- const unsigned char *name, size_t name_len)
+ const unsigned char *name, size_t name_len)
{
const sni_entry *cur = (const sni_entry *) p_info;
@@ -1028,7 +1028,7 @@
* PSK callback
*/
static int psk_callback(void *p_info, mbedtls_ssl_context *ssl,
- const unsigned char *name, size_t name_len)
+ const unsigned char *name, size_t name_len)
{
psk_entry *cur = (psk_entry *) p_info;
@@ -1106,10 +1106,10 @@
} ssl_async_key_context_t;
static int ssl_async_set_key(ssl_async_key_context_t *ctx,
- mbedtls_x509_crt *cert,
- mbedtls_pk_context *pk,
- int pk_take_ownership,
- unsigned delay)
+ mbedtls_x509_crt *cert,
+ mbedtls_pk_context *pk,
+ int pk_take_ownership,
+ unsigned delay)
{
if (ctx->slots_used >= sizeof(ctx->slots) / sizeof(*ctx->slots)) {
return -1;
@@ -1333,7 +1333,7 @@
#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID)
static int report_cid_usage(mbedtls_ssl_context *ssl,
- const char *additional_description)
+ const char *additional_description)
{
int ret;
unsigned char peer_cid[MBEDTLS_SSL_CID_OUT_LEN_MAX];
@@ -1384,8 +1384,8 @@
/* Functions for session ticket tests */
static int dummy_ticket_write(void *p_ticket, const mbedtls_ssl_session *session,
- unsigned char *start, const unsigned char *end,
- size_t *tlen, uint32_t *ticket_lifetime)
+ unsigned char *start, const unsigned char *end,
+ size_t *tlen, uint32_t *ticket_lifetime)
{
int ret;
unsigned char *p = start;
@@ -1411,7 +1411,7 @@
}
static int dummy_ticket_parse(void *p_ticket, mbedtls_ssl_session *session,
- unsigned char *buf, size_t len)
+ unsigned char *buf, size_t len)
{
int ret;
((void) p_ticket);
diff --git a/programs/ssl/ssl_test_common_source.c b/programs/ssl/ssl_test_common_source.c
index 799a882..98fae36 100644
--- a/programs/ssl/ssl_test_common_source.c
+++ b/programs/ssl/ssl_test_common_source.c
@@ -13,12 +13,12 @@
*/
static void eap_tls_key_derivation(void *p_expkey,
- mbedtls_ssl_key_export_type secret_type,
- const unsigned char *secret,
- size_t secret_len,
- const unsigned char client_random[32],
- const unsigned char server_random[32],
- mbedtls_tls_prf_types tls_prf_type)
+ mbedtls_ssl_key_export_type secret_type,
+ const unsigned char *secret,
+ size_t secret_len,
+ const unsigned char client_random[32],
+ const unsigned char server_random[32],
+ mbedtls_tls_prf_types tls_prf_type)
{
eap_tls_keys *keys = (eap_tls_keys *) p_expkey;
@@ -37,12 +37,12 @@
}
static void nss_keylog_export(void *p_expkey,
- mbedtls_ssl_key_export_type secret_type,
- const unsigned char *secret,
- size_t secret_len,
- const unsigned char client_random[32],
- const unsigned char server_random[32],
- mbedtls_tls_prf_types tls_prf_type)
+ mbedtls_ssl_key_export_type secret_type,
+ const unsigned char *secret,
+ size_t secret_len,
+ const unsigned char client_random[32],
+ const unsigned char server_random[32],
+ mbedtls_tls_prf_types tls_prf_type)
{
char nss_keylog_line[200];
size_t const client_random_len = 32;
@@ -107,12 +107,12 @@
#if defined(MBEDTLS_SSL_DTLS_SRTP)
static void dtls_srtp_key_derivation(void *p_expkey,
- mbedtls_ssl_key_export_type secret_type,
- const unsigned char *secret,
- size_t secret_len,
- const unsigned char client_random[32],
- const unsigned char server_random[32],
- mbedtls_tls_prf_types tls_prf_type)
+ mbedtls_ssl_key_export_type secret_type,
+ const unsigned char *secret,
+ size_t secret_len,
+ const unsigned char client_random[32],
+ const unsigned char server_random[32],
+ mbedtls_tls_prf_types tls_prf_type)
{
dtls_srtp_keys *keys = (dtls_srtp_keys *) p_expkey;
@@ -132,7 +132,7 @@
#endif /* MBEDTLS_SSL_DTLS_SRTP */
static int ssl_check_record(mbedtls_ssl_context const *ssl,
- unsigned char const *buf, size_t len)
+ unsigned char const *buf, size_t len)
{
int my_ret = 0, ret_cr1, ret_cr2;
unsigned char *tmp_buf;
@@ -224,7 +224,7 @@
}
static int recv_timeout_cb(void *ctx, unsigned char *buf, size_t len,
- uint32_t timeout)
+ uint32_t timeout)
{
io_ctx_t *io_ctx = (io_ctx_t *) ctx;
int ret;
@@ -320,7 +320,7 @@
* for more info.
*/
static int x509_crt_verify_info(char *buf, size_t size, const char *prefix,
- uint32_t flags)
+ uint32_t flags)
{
#if !defined(MBEDTLS_X509_REMOVE_INFO)
return mbedtls_x509_crt_verify_info(buf, size, prefix, flags);
diff --git a/programs/test/udp_proxy.c b/programs/test/udp_proxy.c
index bf06871..7213f8a 100644
--- a/programs/test/udp_proxy.c
+++ b/programs/test/udp_proxy.c
@@ -664,8 +664,8 @@
#define HOLD_MAX 2
static int handle_message(const char *way,
- mbedtls_net_context *dst,
- mbedtls_net_context *src)
+ mbedtls_net_context *dst,
+ mbedtls_net_context *src)
{
int ret;
packet cur;
diff --git a/programs/util/pem2der.c b/programs/util/pem2der.c
index 4d63478..177365b 100644
--- a/programs/util/pem2der.c
+++ b/programs/util/pem2der.c
@@ -46,7 +46,7 @@
} opt;
static int convert_pem_to_der(const unsigned char *input, size_t ilen,
- unsigned char *output, size_t *olen)
+ unsigned char *output, size_t *olen)
{
int ret;
const unsigned char *s1, *s2, *end = input + ilen;
diff --git a/programs/x509/cert_req.c b/programs/x509/cert_req.c
index 1482cc1..0dc4c97 100644
--- a/programs/x509/cert_req.c
+++ b/programs/x509/cert_req.c
@@ -94,22 +94,22 @@
* global options
*/
struct options {
- const char *filename; /* filename of the key file */
- const char *password; /* password for the key file */
- int debug_level; /* level of debugging */
+ const char *filename; /* filename of the key file */
+ const char *password; /* password for the key file */
+ int debug_level; /* level of debugging */
const char *output_file; /* where to store the constructed key file */
- const char *subject_name; /* subject name for certificate request */
- mbedtls_x509_san_list *san_list; /* subjectAltName for certificate request */
- unsigned char key_usage; /* key usage flags */
- int force_key_usage; /* Force adding the KeyUsage extension */
- unsigned char ns_cert_type; /* NS cert type */
- int force_ns_cert_type; /* Force adding NsCertType extension */
- mbedtls_md_type_t md_alg; /* Hash algorithm used for signature. */
+ const char *subject_name; /* subject name for certificate request */
+ mbedtls_x509_san_list *san_list; /* subjectAltName for certificate request */
+ unsigned char key_usage; /* key usage flags */
+ int force_key_usage; /* Force adding the KeyUsage extension */
+ unsigned char ns_cert_type; /* NS cert type */
+ int force_ns_cert_type; /* Force adding NsCertType extension */
+ mbedtls_md_type_t md_alg; /* Hash algorithm used for signature. */
} opt;
static int write_certificate_request(mbedtls_x509write_csr *req, const char *output_file,
- int (*f_rng)(void *, unsigned char *, size_t),
- void *p_rng)
+ int (*f_rng)(void *, unsigned char *, size_t),
+ void *p_rng)
{
int ret;
FILE *f;
diff --git a/programs/x509/cert_write.c b/programs/x509/cert_write.c
index ec9bf11..f57bd35 100644
--- a/programs/x509/cert_write.c
+++ b/programs/x509/cert_write.c
@@ -205,8 +205,8 @@
} opt;
static int write_certificate(mbedtls_x509write_cert *crt, const char *output_file,
- int (*f_rng)(void *, unsigned char *, size_t),
- void *p_rng)
+ int (*f_rng)(void *, unsigned char *, size_t),
+ void *p_rng)
{
int ret;
FILE *f;
@@ -250,7 +250,7 @@
}
static int parse_serial_decimal_format(unsigned char *obuf, size_t obufmax,
- const char *ibuf, size_t *len)
+ const char *ibuf, size_t *len)
{
unsigned long long int dec;
unsigned int remaining_bytes = sizeof(dec);