summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-09-16 17:24:55 +0200
committerSimon Josefsson <simon@josefsson.org>2008-09-16 17:24:55 +0200
commit0e7fdf91bd810f400bdd9faa73d47c0c5797a213 (patch)
treedb0ea92eeb0e9649c231ac7bc7662f65476e6416
parent5cff6d578d0c38c56f2c8dfafa7d6dfc3ecbc4db (diff)
downloadgnutls-0e7fdf91bd810f400bdd9faa73d47c0c5797a213.tar.gz
Indent.
-rw-r--r--NEWS2
-rw-r--r--lib/auth_cert.c16
-rw-r--r--lib/auth_rsa.c4
-rw-r--r--lib/ext_cert_type.c4
-rw-r--r--lib/ext_max_record.c4
-rw-r--r--lib/ext_oprfi.c4
-rw-r--r--lib/ext_server_name.c40
-rw-r--r--lib/gnutls_algorithms.c2
-rw-r--r--lib/gnutls_auth.c13
-rw-r--r--lib/gnutls_buffers.c10
-rw-r--r--lib/gnutls_cert.c5
-rw-r--r--lib/gnutls_cipher.c40
-rw-r--r--lib/gnutls_compress.c10
-rw-r--r--lib/gnutls_constate.c118
-rw-r--r--lib/gnutls_extensions.c8
-rw-r--r--lib/gnutls_global.c2
-rw-r--r--lib/gnutls_handshake.c86
-rw-r--r--lib/gnutls_kx.c93
-rw-r--r--lib/gnutls_pk.c4
-rw-r--r--lib/gnutls_record.c17
-rw-r--r--lib/gnutls_session_pack.c58
-rw-r--r--lib/gnutls_sig.c20
-rw-r--r--lib/gnutls_state.c12
-rw-r--r--lib/gnutls_v2_compat.c14
-rw-r--r--lib/gnutls_x509.c8
-rw-r--r--lib/mac-libgcrypt.c4
-rw-r--r--lib/minitasn1/structure.c2
-rw-r--r--lib/opencdk/armor.c64
-rw-r--r--lib/opencdk/read-packet.c65
-rw-r--r--lib/openpgp/pgp.c4
-rw-r--r--lib/x509/common.c2
-rw-r--r--lib/x509/crq.c8
-rw-r--r--lib/x509/pkcs12.c10
-rw-r--r--lib/x509/privkey.c2
-rw-r--r--libextra/gnutls_ia.c8
-rw-r--r--src/printlist.c3
-rw-r--r--src/serv.c11
-rw-r--r--tests/finished.c6
-rw-r--r--tests/openssl.c2
-rw-r--r--tests/pgps2kgnu.c8
-rw-r--r--tests/pkcs12-decode/pkcs12_s2k.c16
-rw-r--r--tests/simple.c7
42 files changed, 404 insertions, 412 deletions
diff --git a/NEWS b/NEWS
index 205ace57b4..108f7697fc 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ See the end for copying conditions.
* Version 2.5.8 (unreleased)
+** Indent code.
+
** API and ABI modifications:
No changes since last version.
diff --git a/lib/auth_cert.c b/lib/auth_cert.c
index 6c2da78a17..358d012186 100644
--- a/lib/auth_cert.c
+++ b/lib/auth_cert.c
@@ -426,19 +426,19 @@ call_get_cert_callback (gnutls_session_t session,
if (session->security_parameters.entity == GNUTLS_SERVER)
{
if (cred->server_get_cert_callback == NULL)
- {
- gnutls_assert();
- return GNUTLS_E_INTERNAL_ERROR;
- }
+ {
+ gnutls_assert ();
+ return GNUTLS_E_INTERNAL_ERROR;
+ }
ret = cred->server_get_cert_callback (session, &st);
}
else
{ /* CLIENT */
if (cred->client_get_cert_callback == NULL)
- {
- gnutls_assert();
- return GNUTLS_E_INTERNAL_ERROR;
- }
+ {
+ gnutls_assert ();
+ return GNUTLS_E_INTERNAL_ERROR;
+ }
ret =
cred->client_get_cert_callback (session,
issuers_dn, issuers_dn_length,
diff --git a/lib/auth_rsa.c b/lib/auth_rsa.c
index 3082906b5a..125f079490 100644
--- a/lib/auth_rsa.c
+++ b/lib/auth_rsa.c
@@ -169,8 +169,8 @@ _gnutls_get_private_rsa_params (gnutls_session_t session,
}
bits =
- _gnutls_mpi_get_nbits (session->internals.
- selected_cert_list[0].params[0]);
+ _gnutls_mpi_get_nbits (session->internals.selected_cert_list[0].
+ params[0]);
if (_gnutls_cipher_suite_get_kx_algo
(&session->security_parameters.current_cipher_suite)
diff --git a/lib/ext_cert_type.c b/lib/ext_cert_type.c
index a99414bd53..6d3e441480 100644
--- a/lib/ext_cert_type.c
+++ b/lib/ext_cert_type.c
@@ -178,8 +178,8 @@ _gnutls_cert_type_send_params (gnutls_session_t session, opaque * data,
for (i = 0; i < len; i++)
{
data[i + 1] =
- _gnutls_cert_type2num (session->internals.priorities.
- cert_type.priority[i]);
+ _gnutls_cert_type2num (session->internals.
+ priorities.cert_type.priority[i]);
}
return len + 1;
}
diff --git a/lib/ext_max_record.c b/lib/ext_max_record.c
index 97e2bcaa40..61f5b3264d 100644
--- a/lib/ext_max_record.c
+++ b/lib/ext_max_record.c
@@ -120,8 +120,8 @@ _gnutls_max_record_send_params (gnutls_session_t session, opaque * data,
}
data[0] =
- (uint8_t) _gnutls_mre_record2num (session->
- internals.proposed_record_size);
+ (uint8_t) _gnutls_mre_record2num (session->internals.
+ proposed_record_size);
return len;
}
diff --git a/lib/ext_oprfi.c b/lib/ext_oprfi.c
index 2003f75ab3..b187684878 100644
--- a/lib/ext_oprfi.c
+++ b/lib/ext_oprfi.c
@@ -180,8 +180,8 @@ oprfi_send_server (gnutls_session_t session, opaque * data, size_t _data_size)
}
DECR_LENGTH_RET (data_size, 2, GNUTLS_E_SHORT_MEMORY_BUFFER);
- _gnutls_write_uint16 (session->security_parameters.extensions.
- oprfi_server_len, p);
+ _gnutls_write_uint16 (session->security_parameters.
+ extensions.oprfi_server_len, p);
p += 2;
DECR_LENGTH_RET (data_size,
diff --git a/lib/ext_server_name.c b/lib/ext_server_name.c
index 82c8fdabbb..12c6fa4493 100644
--- a/lib/ext_server_name.c
+++ b/lib/ext_server_name.c
@@ -117,12 +117,12 @@ _gnutls_server_name_recv_params (gnutls_session_t session,
case 0: /* NAME_DNS */
if (len <= MAX_SERVER_NAME_SIZE)
{
- memcpy (session->security_parameters.
- extensions.server_names[i].name, p, len);
- session->security_parameters.extensions.server_names[i].
- name_length = len;
- session->security_parameters.extensions.server_names[i].
- type = GNUTLS_NAME_DNS;
+ memcpy (session->security_parameters.extensions.
+ server_names[i].name, p, len);
+ session->security_parameters.extensions.
+ server_names[i].name_length = len;
+ session->security_parameters.extensions.
+ server_names[i].type = GNUTLS_NAME_DNS;
break;
}
}
@@ -163,8 +163,8 @@ _gnutls_server_name_send_params (gnutls_session_t session,
/* count the total size
*/
len =
- session->security_parameters.extensions.
- server_names[i].name_length;
+ session->security_parameters.extensions.server_names[i].
+ name_length;
/* uint8_t + uint16_t + size
*/
@@ -183,14 +183,14 @@ _gnutls_server_name_send_params (gnutls_session_t session,
i < session->security_parameters.extensions.server_names_size; i++)
{
- switch (session->security_parameters.extensions.server_names[i].
- type)
+ switch (session->security_parameters.extensions.
+ server_names[i].type)
{
case GNUTLS_NAME_DNS:
len =
- session->security_parameters.extensions.server_names[i].
- name_length;
+ session->security_parameters.extensions.
+ server_names[i].name_length;
if (len == 0)
break;
@@ -208,8 +208,8 @@ _gnutls_server_name_send_params (gnutls_session_t session,
p += 2;
memcpy (p,
- session->security_parameters.extensions.server_names[i].
- name, len);
+ session->security_parameters.extensions.
+ server_names[i].name, len);
p += len;
break;
default:
@@ -269,8 +269,8 @@ gnutls_server_name_get (gnutls_session_t session, void *data,
session->security_parameters.extensions.server_names[indx].name_length)
{
*data_length =
- session->security_parameters.extensions.
- server_names[indx].name_length;
+ session->security_parameters.extensions.server_names[indx].
+ name_length;
memcpy (data,
session->security_parameters.extensions.server_names[indx].name,
*data_length);
@@ -282,8 +282,8 @@ gnutls_server_name_get (gnutls_session_t session, void *data,
else
{
*data_length =
- session->security_parameters.extensions.
- server_names[indx].name_length;
+ session->security_parameters.extensions.server_names[indx].
+ name_length;
return GNUTLS_E_SHORT_MEMORY_BUFFER;
}
@@ -331,8 +331,8 @@ gnutls_server_name_set (gnutls_session_t session,
session->security_parameters.extensions.server_names[server_names -
1].type = type;
- memcpy (session->security_parameters.
- extensions.server_names[server_names - 1].name, name, name_length);
+ memcpy (session->security_parameters.extensions.
+ server_names[server_names - 1].name, name, name_length);
session->security_parameters.extensions.server_names[server_names -
1].name_length =
name_length;
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c
index e023a432d4..124774ffae 100644
--- a/lib/gnutls_algorithms.c
+++ b/lib/gnutls_algorithms.c
@@ -1974,7 +1974,7 @@ gnutls_pk_get_id (const char *name)
{
if (strcasecmp (name, "RSA") == 0)
return GNUTLS_PK_RSA;
- else if (strcasecmp (name, "DSA") == 0)
+ else if (strcasecmp (name, "DSA") == 0)
return GNUTLS_PK_DSA;
return GNUTLS_PK_UNKNOWN;
diff --git a/lib/gnutls_auth.c b/lib/gnutls_auth.c
index 64fbd18d6b..cfd9138bd1 100644
--- a/lib/gnutls_auth.c
+++ b/lib/gnutls_auth.c
@@ -173,9 +173,8 @@ gnutls_auth_get_type (gnutls_session_t session)
return
_gnutls_map_kx_get_cred (_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite),
- server);
+ (&session->security_parameters.
+ current_cipher_suite), server);
}
/**
@@ -194,8 +193,8 @@ gnutls_auth_server_get_type (gnutls_session_t session)
{
return
_gnutls_map_kx_get_cred (_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite), 1);
+ (&session->security_parameters.
+ current_cipher_suite), 1);
}
/**
@@ -214,8 +213,8 @@ gnutls_auth_client_get_type (gnutls_session_t session)
{
return
_gnutls_map_kx_get_cred (_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite), 0);
+ (&session->security_parameters.
+ current_cipher_suite), 0);
}
diff --git a/lib/gnutls_buffers.c b/lib/gnutls_buffers.c
index 06fbaf1753..2058a2765f 100644
--- a/lib/gnutls_buffers.c
+++ b/lib/gnutls_buffers.c
@@ -1027,9 +1027,9 @@ _gnutls_handshake_io_send_int (gnutls_session_t session,
gnutls_assert ();
retval =
- _gnutls_buffer_insert (&session->
- internals.handshake_send_buffer,
- &ptr[n - left], left);
+ _gnutls_buffer_insert (&session->internals.
+ handshake_send_buffer, &ptr[n - left],
+ left);
if (retval < 0)
{
gnutls_assert ();
@@ -1129,8 +1129,8 @@ _gnutls_handshake_io_recv_int (gnutls_session_t session,
gnutls_assert ();
session->internals.handshake_recv_buffer.data =
- gnutls_realloc_fast (session->internals.handshake_recv_buffer.
- data, dsize);
+ gnutls_realloc_fast (session->internals.
+ handshake_recv_buffer.data, dsize);
if (session->internals.handshake_recv_buffer.data == NULL)
{
gnutls_assert ();
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index c884d51f7c..2bd1d530ed 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -757,8 +757,9 @@ _gnutls_get_auth_info_gcert (gnutls_cert * gcert,
case GNUTLS_CRT_OPENPGP:
return _gnutls_openpgp_raw_crt_to_gcert (gcert,
&info->raw_certificate_list[0],
- info->use_subkey ? info->
- subkey_id : NULL);
+ info->
+ use_subkey ? info->subkey_id :
+ NULL);
#endif
default:
gnutls_assert ();
diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
index ee87d319e7..00a97584fd 100644
--- a/lib/gnutls_cipher.c
+++ b/lib/gnutls_cipher.c
@@ -306,15 +306,15 @@ _gnutls_compressed2ciphertext (gnutls_session_t session,
uint8_t type = _type;
uint8_t major, minor;
int hash_size =
- _gnutls_hash_get_algo_len (session->
- security_parameters.write_mac_algorithm);
+ _gnutls_hash_get_algo_len (session->security_parameters.
+ write_mac_algorithm);
gnutls_protocol_t ver;
int blocksize =
- _gnutls_cipher_get_block_size (session->
- security_parameters.write_bulk_cipher_algorithm);
+ _gnutls_cipher_get_block_size (session->security_parameters.
+ write_bulk_cipher_algorithm);
cipher_type_t block_algo =
- _gnutls_cipher_is_block (session->
- security_parameters.write_bulk_cipher_algorithm);
+ _gnutls_cipher_is_block (session->security_parameters.
+ write_bulk_cipher_algorithm);
opaque *data_ptr;
@@ -340,8 +340,8 @@ _gnutls_compressed2ciphertext (gnutls_session_t session,
if (session->security_parameters.write_mac_algorithm != GNUTLS_MAC_NULL)
{ /* actually when the algorithm in not the NULL one */
_gnutls_hmac (&td,
- UINT64DATA (session->
- connection_state.write_sequence_number), 8);
+ UINT64DATA (session->connection_state.
+ write_sequence_number), 8);
_gnutls_hmac (&td, &type, 1);
if (ver >= GNUTLS_TLS1)
@@ -437,16 +437,16 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
uint8_t major, minor;
gnutls_protocol_t ver;
int hash_size =
- _gnutls_hash_get_algo_len (session->
- security_parameters.read_mac_algorithm);
+ _gnutls_hash_get_algo_len (session->security_parameters.
+ read_mac_algorithm);
ver = gnutls_protocol_get_version (session);
minor = _gnutls_version_get_minor (ver);
major = _gnutls_version_get_major (ver);
blocksize =
- _gnutls_cipher_get_block_size (session->
- security_parameters.read_bulk_cipher_algorithm);
+ _gnutls_cipher_get_block_size (session->security_parameters.
+ read_bulk_cipher_algorithm);
/* initialize MAC
*/
@@ -468,9 +468,9 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
{
case CIPHER_STREAM:
if ((ret =
- _gnutls_cipher_decrypt (&session->
- connection_state.read_cipher_state,
- ciphertext.data, ciphertext.size)) < 0)
+ _gnutls_cipher_decrypt (&session->connection_state.
+ read_cipher_state, ciphertext.data,
+ ciphertext.size)) < 0)
{
gnutls_assert ();
return ret;
@@ -487,9 +487,9 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
}
if ((ret =
- _gnutls_cipher_decrypt (&session->
- connection_state.read_cipher_state,
- ciphertext.data, ciphertext.size)) < 0)
+ _gnutls_cipher_decrypt (&session->connection_state.
+ read_cipher_state, ciphertext.data,
+ ciphertext.size)) < 0)
{
gnutls_assert ();
return ret;
@@ -550,8 +550,8 @@ _gnutls_ciphertext2compressed (gnutls_session_t session,
if (session->security_parameters.read_mac_algorithm != GNUTLS_MAC_NULL)
{
_gnutls_hmac (&td,
- UINT64DATA (session->
- connection_state.read_sequence_number), 8);
+ UINT64DATA (session->connection_state.
+ read_sequence_number), 8);
_gnutls_hmac (&td, &type, 1);
if (ver >= GNUTLS_TLS1)
diff --git a/lib/gnutls_compress.c b/lib/gnutls_compress.c
index e177defd16..38570e1ec3 100644
--- a/lib/gnutls_compress.c
+++ b/lib/gnutls_compress.c
@@ -167,9 +167,9 @@ gnutls_compression_get_id (const char *name)
gnutls_compression_method_t ret = GNUTLS_COMP_UNKNOWN;
GNUTLS_COMPRESSION_LOOP (if
- (strcasecmp
- (p->name + sizeof ("GNUTLS_COMP_") - 1,
- name) == 0) ret = p->id);
+ (strcasecmp
+ (p->name + sizeof ("GNUTLS_COMP_") - 1,
+ name) == 0) ret = p->id);
return ret;
}
@@ -277,8 +277,8 @@ _gnutls_supported_compression_methods (gnutls_session_t session,
for (i = j = 0; i < SUPPORTED_COMPRESSION_METHODS; i++)
{
int tmp =
- _gnutls_compression_get_num (session->internals.
- priorities.compression.priority[i]);
+ _gnutls_compression_get_num (session->internals.priorities.
+ compression.priority[i]);
/* remove private compression algorithms, if requested.
*/
diff --git a/lib/gnutls_constate.c b/lib/gnutls_constate.c
index bc724d82ce..12e1719880 100644
--- a/lib/gnutls_constate.c
+++ b/lib/gnutls_constate.c
@@ -88,11 +88,13 @@ _gnutls_set_keys (gnutls_session_t session, int hash_size, int IV_size,
return GNUTLS_E_MEMORY_ERROR;
}
- memcpy (rnd, session->security_parameters.server_random, GNUTLS_RANDOM_SIZE);
+ memcpy (rnd, session->security_parameters.server_random,
+ GNUTLS_RANDOM_SIZE);
memcpy (&rnd[GNUTLS_RANDOM_SIZE],
session->security_parameters.client_random, GNUTLS_RANDOM_SIZE);
- memcpy (rrnd, session->security_parameters.client_random, GNUTLS_RANDOM_SIZE);
+ memcpy (rrnd, session->security_parameters.client_random,
+ GNUTLS_RANDOM_SIZE);
memcpy (&rrnd[GNUTLS_RANDOM_SIZE],
session->security_parameters.server_random, GNUTLS_RANDOM_SIZE);
@@ -503,34 +505,35 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
{
rc = _gnutls_set_read_cipher (session,
_gnutls_cipher_suite_get_cipher_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = _gnutls_set_read_mac (session,
_gnutls_cipher_suite_get_mac_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = _gnutls_set_kx (session,
_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = _gnutls_set_read_compression (session,
- session->
- internals.compression_method);
+ session->internals.
+ compression_method);
if (rc < 0)
return rc;
}
else
{ /* RESUME_TRUE */
_gnutls_cpy_read_security_parameters (&session->security_parameters,
- &session->internals.resumed_security_parameters);
+ &session->internals.
+ resumed_security_parameters);
}
@@ -541,7 +544,8 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
_gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n",
session,
_gnutls_cipher_suite_get_name
- (&session->security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (_gnutls_compression_is_ok
(session->security_parameters.read_compression_algorithm) != 0)
@@ -569,8 +573,8 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
mac_size =
- _gnutls_hash_get_algo_len (session->
- security_parameters.read_mac_algorithm);
+ _gnutls_hash_get_algo_len (session->security_parameters.
+ read_mac_algorithm);
_gnutls_handshake_log
("HSK[%x]: Initializing internal [read] cipher sessions\n", session);
@@ -581,8 +585,8 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
/* initialize cipher session
*/
rc = _gnutls_cipher_init (&session->connection_state.read_cipher_state,
- session->security_parameters.
- read_bulk_cipher_algorithm,
+ session->
+ security_parameters.read_bulk_cipher_algorithm,
&session->cipher_specs.client_write_key,
&session->cipher_specs.client_write_IV);
if (rc < 0
@@ -599,11 +603,10 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
if (mac_size > 0)
{
if (_gnutls_sset_datum (&session->connection_state.read_mac_secret,
- session->
- cipher_specs.client_write_mac_secret.data,
- session->
- cipher_specs.client_write_mac_secret.size) <
- 0)
+ session->cipher_specs.
+ client_write_mac_secret.data,
+ session->cipher_specs.
+ client_write_mac_secret.size) < 0)
{
gnutls_assert ();
return GNUTLS_E_MEMORY_ERROR;
@@ -615,8 +618,8 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
case GNUTLS_CLIENT:
rc = _gnutls_cipher_init (&session->connection_state.read_cipher_state,
- session->security_parameters.
- read_bulk_cipher_algorithm,
+ session->
+ security_parameters.read_bulk_cipher_algorithm,
&session->cipher_specs.server_write_key,
&session->cipher_specs.server_write_IV);
@@ -634,11 +637,10 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
if (mac_size > 0)
{
if (_gnutls_sset_datum (&session->connection_state.read_mac_secret,
- session->
- cipher_specs.server_write_mac_secret.data,
- session->
- cipher_specs.server_write_mac_secret.size) <
- 0)
+ session->cipher_specs.
+ server_write_mac_secret.data,
+ session->cipher_specs.
+ server_write_mac_secret.size) < 0)
{
gnutls_assert ();
return GNUTLS_E_MEMORY_ERROR;
@@ -653,8 +655,8 @@ _gnutls_read_connection_state_init (gnutls_session_t session)
}
session->connection_state.read_compression_state =
- _gnutls_comp_init (session->
- security_parameters.read_compression_algorithm, 1);
+ _gnutls_comp_init (session->security_parameters.
+ read_compression_algorithm, 1);
if (session->connection_state.read_compression_state == GNUTLS_COMP_FAILED)
{
@@ -685,34 +687,35 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
{
rc = _gnutls_set_write_cipher (session,
_gnutls_cipher_suite_get_cipher_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = _gnutls_set_write_mac (session,
_gnutls_cipher_suite_get_mac_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = _gnutls_set_kx (session,
_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (rc < 0)
return rc;
rc = _gnutls_set_write_compression (session,
- session->
- internals.compression_method);
+ session->internals.
+ compression_method);
if (rc < 0)
return rc;
}
else
{ /* RESUME_TRUE */
_gnutls_cpy_write_security_parameters (&session->security_parameters,
- &session->internals.resumed_security_parameters);
+ &session->internals.
+ resumed_security_parameters);
}
rc = _gnutls_set_write_keys (session);
@@ -721,7 +724,8 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
_gnutls_handshake_log ("HSK[%x]: Cipher Suite: %s\n", session,
_gnutls_cipher_suite_get_name
- (&session->security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (_gnutls_compression_is_ok
(session->security_parameters.write_compression_algorithm) != 0)
@@ -751,8 +755,8 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
0);
mac_size =
- _gnutls_hash_get_algo_len (session->
- security_parameters.write_mac_algorithm);
+ _gnutls_hash_get_algo_len (session->security_parameters.
+ write_mac_algorithm);
_gnutls_handshake_log
("HSK[%x]: Initializing internal [write] cipher sessions\n", session);
@@ -763,8 +767,8 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
/* initialize cipher session
*/
rc = _gnutls_cipher_init (&session->connection_state.write_cipher_state,
- session->
- security_parameters.write_bulk_cipher_algorithm,
+ session->security_parameters.
+ write_bulk_cipher_algorithm,
&session->cipher_specs.server_write_key,
&session->cipher_specs.server_write_IV);
@@ -783,11 +787,10 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
if (mac_size > 0)
{
if (_gnutls_sset_datum (&session->connection_state.write_mac_secret,
- session->
- cipher_specs.server_write_mac_secret.data,
- session->
- cipher_specs.server_write_mac_secret.size) <
- 0)
+ session->cipher_specs.
+ server_write_mac_secret.data,
+ session->cipher_specs.
+ server_write_mac_secret.size) < 0)
{
gnutls_assert ();
return GNUTLS_E_MEMORY_ERROR;
@@ -800,8 +803,8 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
case GNUTLS_CLIENT:
rc = _gnutls_cipher_init (&session->connection_state.write_cipher_state,
- session->
- security_parameters.write_bulk_cipher_algorithm,
+ session->security_parameters.
+ write_bulk_cipher_algorithm,
&session->cipher_specs.client_write_key,
&session->cipher_specs.client_write_IV);
@@ -818,11 +821,10 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
if (mac_size > 0)
{
if (_gnutls_sset_datum (&session->connection_state.write_mac_secret,
- session->
- cipher_specs.client_write_mac_secret.data,
- session->
- cipher_specs.client_write_mac_secret.size) <
- 0)
+ session->cipher_specs.
+ client_write_mac_secret.data,
+ session->cipher_specs.
+ client_write_mac_secret.size) < 0)
{
gnutls_assert ();
return GNUTLS_E_MEMORY_ERROR;
@@ -838,8 +840,8 @@ _gnutls_write_connection_state_init (gnutls_session_t session)
session->connection_state.write_compression_state =
- _gnutls_comp_init (session->
- security_parameters.write_compression_algorithm, 0);
+ _gnutls_comp_init (session->security_parameters.
+ write_compression_algorithm, 0);
if (session->connection_state.write_compression_state == GNUTLS_COMP_FAILED)
{
diff --git a/lib/gnutls_extensions.c b/lib/gnutls_extensions.c
index e5716965a2..4686e4fcdb 100644
--- a/lib/gnutls_extensions.c
+++ b/lib/gnutls_extensions.c
@@ -56,8 +56,7 @@ _gnutls_ext_func_recv (uint16_t type, gnutls_ext_parse_type_t parse_type)
for (i = 0; i < extfunc_size; i++)
if (extfunc[i].type == type)
- if (parse_type == GNUTLS_EXT_ANY
- || extfunc[i].parse_type == parse_type)
+ if (parse_type == GNUTLS_EXT_ANY || extfunc[i].parse_type == parse_type)
return extfunc[i].recv_func;
return NULL;
@@ -179,8 +178,9 @@ _gnutls_extension_list_add (gnutls_session_t session, uint16_t type)
{
if (session->internals.extensions_sent_size < MAX_EXT_TYPES)
{
- session->internals.extensions_sent[session->internals.
- extensions_sent_size] = type;
+ session->internals.extensions_sent[session->
+ internals.extensions_sent_size] =
+ type;
session->internals.extensions_sent_size++;
}
else
diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c
index bf2b6e1937..4eda112735 100644
--- a/lib/gnutls_global.c
+++ b/lib/gnutls_global.c
@@ -29,7 +29,7 @@
#include <random.h>
#include <gcrypt.h>
-#include <gnutls_extensions.h> /* for _gnutls_ext_init */
+#include <gnutls_extensions.h> /* for _gnutls_ext_init */
#ifdef HAVE_WINSOCK
# include <winsock2.h>
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 0b45bd35db..ef38a7ed72 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -95,8 +95,8 @@ resume_copy_required_values (gnutls_session_t session)
* hello message.
*/
memcpy (session->security_parameters.current_cipher_suite.suite,
- session->internals.resumed_security_parameters.current_cipher_suite.
- suite, 2);
+ session->internals.resumed_security_parameters.
+ current_cipher_suite.suite, 2);
session->internals.compression_method =
session->internals.resumed_security_parameters.read_compression_algorithm;
@@ -108,8 +108,8 @@ resume_copy_required_values (gnutls_session_t session)
session->internals.resumed_security_parameters.entity;
_gnutls_set_current_version (session,
- session->internals.resumed_security_parameters.
- version);
+ session->internals.
+ resumed_security_parameters.version);
session->security_parameters.cert_type =
session->internals.resumed_security_parameters.cert_type;
@@ -124,13 +124,15 @@ resume_copy_required_values (gnutls_session_t session)
void
_gnutls_set_server_random (gnutls_session_t session, uint8_t * rnd)
{
- memcpy (session->security_parameters.server_random, rnd, GNUTLS_RANDOM_SIZE);
+ memcpy (session->security_parameters.server_random, rnd,
+ GNUTLS_RANDOM_SIZE);
}
void
_gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd)
{
- memcpy (session->security_parameters.client_random, rnd, GNUTLS_RANDOM_SIZE);
+ memcpy (session->security_parameters.client_random, rnd,
+ GNUTLS_RANDOM_SIZE);
}
/* Calculate The SSL3 Finished message
@@ -177,13 +179,11 @@ _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
_gnutls_hash (&td_sha, mesg, siz);
_gnutls_mac_deinit_ssl3_handshake (&td_md5, ret,
- session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE);
_gnutls_mac_deinit_ssl3_handshake (&td_sha, &ret[16],
- session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE);
return 0;
}
@@ -411,8 +411,8 @@ _gnutls_read_client_hello (gnutls_session_t session, opaque * data,
else
{
_gnutls_generate_session_id (session->security_parameters.session_id,
- &session->
- security_parameters.session_id_size);
+ &session->security_parameters.
+ session_id_size);
session->internals.resumed = RESUME_FALSE;
}
@@ -782,9 +782,9 @@ finish:
*/
if (_gnutls_get_kx_cred
(session,
- _gnutls_cipher_suite_get_kx_algo (&session->
- security_parameters.current_cipher_suite),
- &err) == NULL && err != 0)
+ _gnutls_cipher_suite_get_kx_algo (&session->security_parameters.
+ current_cipher_suite), &err) == NULL
+ && err != 0)
{
gnutls_assert ();
return GNUTLS_E_INSUFFICIENT_CREDENTIALS;
@@ -797,8 +797,8 @@ finish:
*/
session->internals.auth_struct =
_gnutls_kx_auth_struct (_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (session->internals.auth_struct == NULL)
{
@@ -847,8 +847,8 @@ _gnutls_server_select_comp_method (gnutls_session_t session,
_gnutls_handshake_log
("HSK[%x]: Selected Compression Method: %s\n", session,
- gnutls_compression_get_name (session->
- internals.compression_method));
+ gnutls_compression_get_name (session->internals.
+ compression_method));
return 0;
@@ -1011,8 +1011,8 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
if (session->internals.handshake_header_buffer.header_size ==
handshake_header_size || (session->internals.v2_hello != 0
&& type == GNUTLS_HANDSHAKE_CLIENT_HELLO
- && session->internals.handshake_header_buffer.
- packet_length > 0))
+ && session->internals.
+ handshake_header_buffer.packet_length > 0))
{
*recv_type = session->internals.handshake_header_buffer.recv_type;
@@ -1063,11 +1063,11 @@ _gnutls_recv_handshake_header (gnutls_session_t session,
_gnutls_handshake_io_recv_int (session, GNUTLS_HANDSHAKE,
type,
&dataptr
- [session->internals.handshake_header_buffer.header_size],
+ [session->internals.
+ handshake_header_buffer.header_size],
HANDSHAKE_HEADER_SIZE -
- session->
- internals.handshake_header_buffer.
- header_size);
+ session->internals.
+ handshake_header_buffer.header_size);
if (ret <= 0)
{
gnutls_assert ();
@@ -1249,11 +1249,10 @@ _gnutls_recv_handshake (gnutls_session_t session, uint8_t ** data,
ret = _gnutls_handshake_hash_add_recvd (session, recv_type,
- session->
- internals.handshake_header_buffer.
- header,
- session->
- internals.handshake_header_buffer.header_size,
+ session->internals.
+ handshake_header_buffer.header,
+ session->internals.
+ handshake_header_buffer.header_size,
dataptr, length32);
if (ret < 0)
{
@@ -1345,7 +1344,8 @@ _gnutls_client_set_ciphersuite (gnutls_session_t session, opaque suite[2])
_gnutls_handshake_log ("HSK[%x]: Selected cipher suite: %s\n", session,
_gnutls_cipher_suite_get_name
- (&session->security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
/* check if the credentials (username, public key etc.) are ok.
@@ -1368,8 +1368,8 @@ _gnutls_client_set_ciphersuite (gnutls_session_t session, opaque suite[2])
*/
session->internals.auth_struct =
_gnutls_kx_auth_struct (_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (session->internals.auth_struct == NULL)
{
@@ -1971,8 +1971,8 @@ _gnutls_send_server_hello (gnutls_session_t session, int again)
pos += 2;
comp =
- (uint8_t) _gnutls_compression_get_num (session->internals.
- compression_method);
+ (uint8_t) _gnutls_compression_get_num (session->
+ internals.compression_method);
data[pos++] = comp;
@@ -2319,11 +2319,13 @@ _gnutls_handshake_client (gnutls_session_t session)
if (session->internals.resumed_security_parameters.session_id_size > 0)
_gnutls_handshake_log ("HSK[%x]: Ask to resume: %s\n", session,
- _gnutls_bin2hex (session->
- internals.resumed_security_parameters.session_id,
- session->
- internals.resumed_security_parameters.session_id_size,
- buf, sizeof (buf)));
+ _gnutls_bin2hex (session->internals.
+ resumed_security_parameters.
+ session_id,
+ session->internals.
+ resumed_security_parameters.
+ session_id_size, buf,
+ sizeof (buf)));
#endif
switch (STATE)
diff --git a/lib/gnutls_kx.c b/lib/gnutls_kx.c
index 088df6909c..d1c985c0b1 100644
--- a/lib/gnutls_kx.c
+++ b/lib/gnutls_kx.c
@@ -65,13 +65,11 @@ generate_normal_master (gnutls_session_t session, int keep_premaster)
_gnutls_bin2hex (PREMASTER.data, PREMASTER.size, buf,
sizeof (buf)));
_gnutls_hard_log ("INT: CLIENT RANDOM[%d]: %s\n", 32,
- _gnutls_bin2hex (session->
- security_parameters.client_random, 32,
- buf, sizeof (buf)));
+ _gnutls_bin2hex (session->security_parameters.
+ client_random, 32, buf, sizeof (buf)));
_gnutls_hard_log ("INT: SERVER RANDOM[%d]: %s\n", 32,
- _gnutls_bin2hex (session->
- security_parameters.server_random, 32,
- buf, sizeof (buf)));
+ _gnutls_bin2hex (session->security_parameters.
+ server_random, 32, buf, sizeof (buf)));
if (gnutls_protocol_get_version (session) == GNUTLS_SSL3)
{
@@ -86,8 +84,8 @@ generate_normal_master (gnutls_session_t session, int keep_premaster)
_gnutls_ssl3_generate_random (PREMASTER.data, PREMASTER.size,
rnd, 2 * GNUTLS_RANDOM_SIZE,
GNUTLS_MASTER_SIZE,
- session->
- security_parameters.master_secret);
+ session->security_parameters.
+ master_secret);
}
else if (session->security_parameters.extensions.oprfi_client_len > 0 &&
@@ -107,24 +105,20 @@ generate_normal_master (gnutls_session_t session, int keep_premaster)
}
_gnutls_hard_log ("INT: CLIENT OPRFI[%d]: %s\n",
- session->security_parameters.extensions.
- oprfi_server_len,
- _gnutls_bin2hex (session->
- security_parameters.extensions.
- oprfi_client,
- session->
- security_parameters.extensions.
- oprfi_client_len, buf,
+ session->security_parameters.
+ extensions.oprfi_server_len,
+ _gnutls_bin2hex (session->security_parameters.
+ extensions.oprfi_client,
+ session->security_parameters.
+ extensions.oprfi_client_len, buf,
sizeof (buf)));
_gnutls_hard_log ("INT: SERVER OPRFI[%d]: %s\n",
- session->security_parameters.extensions.
- oprfi_server_len,
- _gnutls_bin2hex (session->
- security_parameters.extensions.
- oprfi_server,
- session->
- security_parameters.extensions.
- oprfi_server_len, buf,
+ session->security_parameters.
+ extensions.oprfi_server_len,
+ _gnutls_bin2hex (session->security_parameters.
+ extensions.oprfi_server,
+ session->security_parameters.
+ extensions.oprfi_server_len, buf,
sizeof (buf)));
memcpy (rnd, session->security_parameters.client_random,
@@ -175,9 +169,9 @@ generate_normal_master (gnutls_session_t session, int keep_premaster)
return ret;
_gnutls_hard_log ("INT: MASTER SECRET: %s\n",
- _gnutls_bin2hex (session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE, buf, sizeof (buf)));
+ _gnutls_bin2hex (session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE, buf,
+ sizeof (buf)));
return ret;
}
@@ -242,8 +236,8 @@ _gnutls_send_server_certificate_request (gnutls_session_t session, int again)
int data_size = 0;
int ret = 0;
- if (session->internals.
- auth_struct->gnutls_generate_server_certificate_request == NULL)
+ if (session->internals.auth_struct->
+ gnutls_generate_server_certificate_request == NULL)
return 0;
if (session->internals.send_cert_req <= 0)
@@ -255,9 +249,8 @@ _gnutls_send_server_certificate_request (gnutls_session_t session, int again)
if (again == 0)
{
data_size =
- session->internals.
- auth_struct->gnutls_generate_server_certificate_request (session,
- &data);
+ session->internals.auth_struct->
+ gnutls_generate_server_certificate_request (session, &data);
if (data_size < 0)
{
@@ -356,8 +349,8 @@ _gnutls_send_client_certificate_verify (gnutls_session_t session, int again)
if (again == 0)
{
data_size =
- session->internals.
- auth_struct->gnutls_generate_client_cert_vrfy (session, &data);
+ session->internals.auth_struct->
+ gnutls_generate_client_cert_vrfy (session, &data);
if (data_size < 0)
{
gnutls_assert ();
@@ -434,8 +427,8 @@ _gnutls_recv_server_certificate_request (gnutls_session_t session)
int datasize;
int ret = 0;
- if (session->internals.
- auth_struct->gnutls_process_server_certificate_request != NULL)
+ if (session->internals.auth_struct->
+ gnutls_process_server_certificate_request != NULL)
{
ret =
@@ -450,9 +443,8 @@ _gnutls_recv_server_certificate_request (gnutls_session_t session)
return 0; /* ignored */
ret =
- session->internals.
- auth_struct->gnutls_process_server_certificate_request (session, data,
- datasize);
+ session->internals.auth_struct->
+ gnutls_process_server_certificate_request (session, data, datasize);
gnutls_free (data);
if (ret < 0)
return ret;
@@ -523,8 +515,8 @@ _gnutls_send_client_certificate (gnutls_session_t session, int again)
/* TLS 1.0 or SSL 3.0 with a valid certificate
*/
data_size =
- session->internals.
- auth_struct->gnutls_generate_client_certificate (session, &data);
+ session->internals.auth_struct->
+ gnutls_generate_client_certificate (session, &data);
if (data_size < 0)
{
@@ -585,8 +577,8 @@ _gnutls_send_server_certificate (gnutls_session_t session, int again)
if (again == 0)
{
data_size =
- session->internals.
- auth_struct->gnutls_generate_server_certificate (session, &data);
+ session->internals.auth_struct->
+ gnutls_generate_server_certificate (session, &data);
if (data_size < 0)
{
@@ -680,9 +672,8 @@ _gnutls_recv_client_certificate (gnutls_session_t session)
return 0;
}
ret =
- session->internals.
- auth_struct->gnutls_process_client_certificate (session, data,
- datasize);
+ session->internals.auth_struct->
+ gnutls_process_client_certificate (session, data, datasize);
gnutls_free (data);
if (ret < 0 && ret != GNUTLS_E_NO_CERTIFICATE_FOUND)
@@ -726,9 +717,8 @@ _gnutls_recv_server_certificate (gnutls_session_t session)
}
ret =
- session->internals.
- auth_struct->gnutls_process_server_certificate (session, data,
- datasize);
+ session->internals.auth_struct->
+ gnutls_process_server_certificate (session, data, datasize);
gnutls_free (data);
if (ret < 0)
{
@@ -778,9 +768,8 @@ _gnutls_recv_client_certificate_verify_message (gnutls_session_t session)
}
ret =
- session->internals.
- auth_struct->gnutls_process_client_cert_vrfy (session, data,
- datasize);
+ session->internals.auth_struct->
+ gnutls_process_client_cert_vrfy (session, data, datasize);
gnutls_free (data);
if (ret < 0)
return ret;
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c
index 30c0eea0c7..981d63cb2b 100644
--- a/lib/gnutls_pk.c
+++ b/lib/gnutls_pk.c
@@ -568,10 +568,10 @@ _gnutls_pk_params_copy (gnutls_pk_params_st * dst, bigint_t * params,
{
int i, j;
dst->params_nr = 0;
-
+
if (params_len == 0 || params == NULL)
{
- gnutls_assert();
+ gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
}
diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c
index 29b0f762af..091728a351 100644
--- a/lib/gnutls_record.c
+++ b/lib/gnutls_record.c
@@ -371,8 +371,8 @@ _gnutls_send_int (gnutls_session_t session, content_type_t type,
_gnutls_record_log
("REC[%x]: Sending Packet[%d] %s(%d) with length: %d\n", session,
- (int) _gnutls_uint64touint32 (&session->
- connection_state.write_sequence_number),
+ (int) _gnutls_uint64touint32 (&session->connection_state.
+ write_sequence_number),
_gnutls_packet2str (type), type, sizeofdata);
if (sizeofdata > MAX_RECORD_SEND_SIZE)
@@ -939,13 +939,14 @@ begin:
_gnutls_record_log
("REC[%x]: Expected Packet[%d] %s(%d) with length: %d\n", session,
- (int) _gnutls_uint64touint32 (&session->
- connection_state.read_sequence_number),
+ (int) _gnutls_uint64touint32 (&session->connection_state.
+ read_sequence_number),
_gnutls_packet2str (type), type, sizeofdata);
_gnutls_record_log ("REC[%x]: Received Packet[%d] %s(%d) with length: %d\n",
session,
- (int) _gnutls_uint64touint32 (&session->
- connection_state.read_sequence_number),
+ (int)
+ _gnutls_uint64touint32 (&session->connection_state.
+ read_sequence_number),
_gnutls_packet2str (recv_type), recv_type, length);
if (length > MAX_RECV_SIZE)
@@ -1024,8 +1025,8 @@ begin:
_gnutls_record_log
("REC[%x]: Decrypted Packet[%d] %s(%d) with length: %d\n", session,
- (int) _gnutls_uint64touint32 (&session->
- connection_state.read_sequence_number),
+ (int) _gnutls_uint64touint32 (&session->connection_state.
+ read_sequence_number),
_gnutls_packet2str (recv_type), recv_type, decrypted_length);
/* increase sequence number
diff --git a/lib/gnutls_session_pack.c b/lib/gnutls_session_pack.c
index f86aac7c9e..39a7f53578 100644
--- a/lib/gnutls_session_pack.c
+++ b/lib/gnutls_session_pack.c
@@ -1055,9 +1055,8 @@ pack_security_parameters (gnutls_session_t session,
session->security_parameters.extensions.srp_username, len);
pos += len;
- _gnutls_write_uint16 (session->security_parameters.
- extensions.server_names_size,
- &packed_session->data[pos]);
+ _gnutls_write_uint16 (session->security_parameters.extensions.
+ server_names_size, &packed_session->data[pos]);
pos += 2;
for (i = 0; i < session->security_parameters.extensions.server_names_size;
@@ -1065,15 +1064,15 @@ pack_security_parameters (gnutls_session_t session,
{
packed_session->data[pos++] =
session->security_parameters.extensions.server_names[i].type;
- _gnutls_write_uint16 (session->security_parameters.
- extensions.server_names[i].name_length,
+ _gnutls_write_uint16 (session->security_parameters.extensions.
+ server_names[i].name_length,
&packed_session->data[pos]);
pos += 2;
memcpy (&packed_session->data[pos],
session->security_parameters.extensions.server_names[i].name,
- session->security_parameters.extensions.
- server_names[i].name_length);
+ session->security_parameters.extensions.server_names[i].
+ name_length);
pos +=
session->security_parameters.extensions.server_names[i].name_length;
}
@@ -1132,10 +1131,10 @@ unpack_security_parameters (gnutls_session_t session,
packed_session->data[pos++];
session->internals.resumed_security_parameters.write_compression_algorithm =
packed_session->data[pos++];
- session->internals.resumed_security_parameters.
- current_cipher_suite.suite[0] = packed_session->data[pos++];
- session->internals.resumed_security_parameters.
- current_cipher_suite.suite[1] = packed_session->data[pos++];
+ session->internals.resumed_security_parameters.current_cipher_suite.
+ suite[0] = packed_session->data[pos++];
+ session->internals.resumed_security_parameters.current_cipher_suite.
+ suite[1] = packed_session->data[pos++];
session->internals.resumed_security_parameters.cert_type =
packed_session->data[pos++];
@@ -1184,35 +1183,34 @@ unpack_security_parameters (gnutls_session_t session,
/* SRP */
len = packed_session->data[pos++]; /* srp username length */
- memcpy (session->internals.resumed_security_parameters.
- extensions.srp_username, &packed_session->data[pos], len);
- session->internals.resumed_security_parameters.
- extensions.srp_username[len] = 0;
+ memcpy (session->internals.resumed_security_parameters.extensions.
+ srp_username, &packed_session->data[pos], len);
+ session->internals.resumed_security_parameters.extensions.
+ srp_username[len] = 0;
pos += len;
- session->internals.resumed_security_parameters.
- extensions.server_names_size =
- _gnutls_read_uint16 (&packed_session->data[pos]);
+ session->internals.resumed_security_parameters.extensions.
+ server_names_size = _gnutls_read_uint16 (&packed_session->data[pos]);
pos += 2;
for (i = 0;
i <
- session->internals.resumed_security_parameters.
- extensions.server_names_size; i++)
+ session->internals.resumed_security_parameters.extensions.
+ server_names_size; i++)
{
- session->internals.resumed_security_parameters.
- extensions.server_names[i].type = packed_session->data[pos++];
- session->internals.resumed_security_parameters.
- extensions.server_names[i].name_length =
+ session->internals.resumed_security_parameters.extensions.
+ server_names[i].type = packed_session->data[pos++];
+ session->internals.resumed_security_parameters.extensions.
+ server_names[i].name_length =
_gnutls_read_uint16 (&packed_session->data[pos]);
pos += 2;
- memcpy (session->internals.resumed_security_parameters.
- extensions.server_names[i].name, &packed_session->data[pos],
- session->internals.resumed_security_parameters.
- extensions.server_names[i].name_length);
+ memcpy (session->internals.resumed_security_parameters.extensions.
+ server_names[i].name, &packed_session->data[pos],
+ session->internals.resumed_security_parameters.extensions.
+ server_names[i].name_length);
pos +=
- session->internals.resumed_security_parameters.
- extensions.server_names[i].name_length;
+ session->internals.resumed_security_parameters.extensions.
+ server_names[i].name_length;
}
return 0;
}
diff --git a/lib/gnutls_sig.c b/lib/gnutls_sig.c
index df4d586689..5edf8ff3fb 100644
--- a/lib/gnutls_sig.c
+++ b/lib/gnutls_sig.c
@@ -77,9 +77,8 @@ _gnutls_tls_sign_hdata (gnutls_session_t session,
}
_gnutls_mac_deinit_ssl3_handshake (&td_sha, &concat[16],
- session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE);
}
else
_gnutls_hash_deinit (&td_sha, &concat[16]);
@@ -98,9 +97,8 @@ _gnutls_tls_sign_hdata (gnutls_session_t session,
if (ver == GNUTLS_SSL3)
_gnutls_mac_deinit_ssl3_handshake (&td_md5, concat,
- session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE);
else
_gnutls_hash_deinit (&td_md5, concat);
@@ -404,13 +402,11 @@ _gnutls_verify_sig_hdata (gnutls_session_t session, gnutls_cert * cert,
}
_gnutls_mac_deinit_ssl3_handshake (&td_md5, concat,
- session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE);
_gnutls_mac_deinit_ssl3_handshake (&td_sha, &concat[16],
- session->
- security_parameters.master_secret,
- GNUTLS_MASTER_SIZE);
+ session->security_parameters.
+ master_secret, GNUTLS_MASTER_SIZE);
}
else
{
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index f5121e77d5..e42d2f66c4 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -1163,8 +1163,8 @@ gnutls_session_is_resumed (gnutls_session_t session)
session->security_parameters.session_id_size ==
session->internals.resumed_security_parameters.session_id_size
&& memcmp (session->security_parameters.session_id,
- session->internals.
- resumed_security_parameters.session_id,
+ session->internals.resumed_security_parameters.
+ session_id,
session->security_parameters.session_id_size) == 0)
return 1;
}
@@ -1190,8 +1190,8 @@ _gnutls_session_is_export (gnutls_session_t session)
gnutls_cipher_algorithm_t cipher;
cipher =
- _gnutls_cipher_suite_get_cipher_algo (&session->
- security_parameters.current_cipher_suite);
+ _gnutls_cipher_suite_get_cipher_algo (&session->security_parameters.
+ current_cipher_suite);
if (_gnutls_cipher_get_export_flag (cipher) != 0)
return 1;
@@ -1213,8 +1213,8 @@ _gnutls_session_is_psk (gnutls_session_t session)
gnutls_kx_algorithm_t kx;
kx =
- _gnutls_cipher_suite_get_kx_algo (&session->
- security_parameters.current_cipher_suite);
+ _gnutls_cipher_suite_get_kx_algo (&session->security_parameters.
+ current_cipher_suite);
if (kx == GNUTLS_KX_PSK || kx == GNUTLS_KX_DHE_PSK)
return 1;
diff --git a/lib/gnutls_v2_compat.c b/lib/gnutls_v2_compat.c
index d5fee40e0c..0579fd6721 100644
--- a/lib/gnutls_v2_compat.c
+++ b/lib/gnutls_v2_compat.c
@@ -178,9 +178,9 @@ _gnutls_read_client_hello_v2 (gnutls_session_t session, opaque * data,
*/
if (_gnutls_get_kx_cred
(session,
- _gnutls_cipher_suite_get_kx_algo (&session->
- security_parameters.current_cipher_suite),
- &err) == NULL && err != 0)
+ _gnutls_cipher_suite_get_kx_algo (&session->security_parameters.
+ current_cipher_suite), &err) == NULL
+ && err != 0)
{
gnutls_assert ();
return GNUTLS_E_INSUFFICIENT_CREDENTIALS;
@@ -192,8 +192,8 @@ _gnutls_read_client_hello_v2 (gnutls_session_t session, opaque * data,
*/
session->internals.auth_struct =
_gnutls_kx_auth_struct (_gnutls_cipher_suite_get_kx_algo
- (&session->
- security_parameters.current_cipher_suite));
+ (&session->security_parameters.
+ current_cipher_suite));
if (session->internals.auth_struct == NULL)
{
@@ -246,8 +246,8 @@ _gnutls_read_client_hello_v2 (gnutls_session_t session, opaque * data,
else
{
_gnutls_generate_session_id (session->security_parameters.session_id,
- &session->
- security_parameters.session_id_size);
+ &session->security_parameters.
+ session_id_size);
session->internals.resumed = RESUME_FALSE;
}
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index cd668ddeed..faca101f7b 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -218,8 +218,8 @@ _gnutls_check_key_cert_match (gnutls_certificate_credentials_t res)
1].params_size, &kid);
- _gnutls_x509_write_rsa_params (res->
- cert_list[res->ncerts - 1][0].params,
+ _gnutls_x509_write_rsa_params (res->cert_list[res->ncerts - 1][0].
+ params,
res->cert_list[res->ncerts -
1][0].params_size, &cid);
}
@@ -230,8 +230,8 @@ _gnutls_check_key_cert_match (gnutls_certificate_credentials_t res)
res->pkey[res->ncerts -
1].params_size, &kid);
- _gnutls_x509_write_dsa_params (res->
- cert_list[res->ncerts - 1][0].params,
+ _gnutls_x509_write_dsa_params (res->cert_list[res->ncerts - 1][0].
+ params,
res->cert_list[res->ncerts -
1][0].params_size, &cid);
}
diff --git a/lib/mac-libgcrypt.c b/lib/mac-libgcrypt.c
index 16ff410e58..9646965c0f 100644
--- a/lib/mac-libgcrypt.c
+++ b/lib/mac-libgcrypt.c
@@ -74,7 +74,7 @@ wrap_gcry_mac_init (gnutls_mac_algorithm_t algo, void **ctx)
static int
wrap_gcry_md_setkey (void *ctx, const void *key, size_t keylen)
{
- return gcry_md_setkey ((gcry_md_hd_t)ctx, key, keylen);
+ return gcry_md_setkey ((gcry_md_hd_t) ctx, key, keylen);
}
static int
@@ -87,7 +87,7 @@ wrap_gcry_md_write (void *ctx, const void *text, size_t textsize)
static int
wrap_gcry_md_copy (void **bhd, void *ahd)
{
- return gcry_md_copy ((gcry_md_hd_t*)bhd, (gcry_md_hd_t)ahd);
+ return gcry_md_copy ((gcry_md_hd_t *) bhd, (gcry_md_hd_t) ahd);
}
static void
diff --git a/lib/minitasn1/structure.c b/lib/minitasn1/structure.c
index 743e9ba42a..a7a4c623b9 100644
--- a/lib/minitasn1/structure.c
+++ b/lib/minitasn1/structure.c
@@ -409,7 +409,7 @@ _asn1_copy_structure3 (node_asn * source_node)
if (p_s->name)
_asn1_set_name (p_d, p_s->name);
if (p_s->value)
- _asn1_set_value (p_d, p_s->value, p_s->value_len);
+ _asn1_set_value (p_d, p_s->value, p_s->value_len);
move = DOWN;
}
else
diff --git a/lib/opencdk/armor.c b/lib/opencdk/armor.c
index 90dea6980b..8084e89713 100644
--- a/lib/opencdk/armor.c
+++ b/lib/opencdk/armor.c
@@ -51,69 +51,69 @@
static u32 crc_table[] = {
0x000000, 0x864CFB, 0x8AD50D, 0x0C99F6, 0x93E6E1, 0x15AA1A, 0x1933EC,
- 0x9F7F17,
+ 0x9F7F17,
0xA18139, 0x27CDC2, 0x2B5434, 0xAD18CF, 0x3267D8, 0xB42B23, 0xB8B2D5,
- 0x3EFE2E,
+ 0x3EFE2E,
0xC54E89, 0x430272, 0x4F9B84, 0xC9D77F, 0x56A868, 0xD0E493, 0xDC7D65,
- 0x5A319E,
+ 0x5A319E,
0x64CFB0, 0xE2834B, 0xEE1ABD, 0x685646, 0xF72951, 0x7165AA, 0x7DFC5C,
- 0xFBB0A7,
+ 0xFBB0A7,
0x0CD1E9, 0x8A9D12, 0x8604E4, 0x00481F, 0x9F3708, 0x197BF3, 0x15E205,
- 0x93AEFE,
+ 0x93AEFE,
0xAD50D0, 0x2B1C2B, 0x2785DD, 0xA1C926, 0x3EB631, 0xB8FACA, 0xB4633C,
- 0x322FC7,
+ 0x322FC7,
0xC99F60, 0x4FD39B, 0x434A6D, 0xC50696, 0x5A7981, 0xDC357A, 0xD0AC8C,
- 0x56E077,
+ 0x56E077,
0x681E59, 0xEE52A2, 0xE2CB54, 0x6487AF, 0xFBF8B8, 0x7DB443, 0x712DB5,
- 0xF7614E,
+ 0xF7614E,
0x19A3D2, 0x9FEF29, 0x9376DF, 0x153A24, 0x8A4533, 0x0C09C8, 0x00903E,
- 0x86DCC5,
+ 0x86DCC5,
0xB822EB, 0x3E6E10, 0x32F7E6, 0xB4BB1D, 0x2BC40A, 0xAD88F1, 0xA11107,
- 0x275DFC,
+ 0x275DFC,
0xDCED5B, 0x5AA1A0, 0x563856, 0xD074AD, 0x4F0BBA, 0xC94741, 0xC5DEB7,
- 0x43924C,
+ 0x43924C,
0x7D6C62, 0xFB2099, 0xF7B96F, 0x71F594, 0xEE8A83, 0x68C678, 0x645F8E,
- 0xE21375,
+ 0xE21375,
0x15723B, 0x933EC0, 0x9FA736, 0x19EBCD, 0x8694DA, 0x00D821, 0x0C41D7,
- 0x8A0D2C,
+ 0x8A0D2C,
0xB4F302, 0x32BFF9, 0x3E260F, 0xB86AF4, 0x2715E3, 0xA15918, 0xADC0EE,
- 0x2B8C15,
+ 0x2B8C15,
0xD03CB2, 0x567049, 0x5AE9BF, 0xDCA544, 0x43DA53, 0xC596A8, 0xC90F5E,
- 0x4F43A5,
+ 0x4F43A5,
0x71BD8B, 0xF7F170, 0xFB6886, 0x7D247D, 0xE25B6A, 0x641791, 0x688E67,
- 0xEEC29C,
+ 0xEEC29C,
0x3347A4, 0xB50B5F, 0xB992A9, 0x3FDE52, 0xA0A145, 0x26EDBE, 0x2A7448,
- 0xAC38B3,
+ 0xAC38B3,
0x92C69D, 0x148A66, 0x181390, 0x9E5F6B, 0x01207C, 0x876C87, 0x8BF571,
- 0x0DB98A,
+ 0x0DB98A,
0xF6092D, 0x7045D6, 0x7CDC20, 0xFA90DB, 0x65EFCC, 0xE3A337, 0xEF3AC1,
- 0x69763A,
+ 0x69763A,
0x578814, 0xD1C4EF, 0xDD5D19, 0x5B11E2, 0xC46EF5, 0x42220E, 0x4EBBF8,
- 0xC8F703,
+ 0xC8F703,
0x3F964D, 0xB9DAB6, 0xB54340, 0x330FBB, 0xAC70AC, 0x2A3C57, 0x26A5A1,
- 0xA0E95A,
+ 0xA0E95A,
0x9E1774, 0x185B8F, 0x14C279, 0x928E82, 0x0DF195, 0x8BBD6E, 0x872498,
- 0x016863,
+ 0x016863,
0xFAD8C4, 0x7C943F, 0x700DC9, 0xF64132, 0x693E25, 0xEF72DE, 0xE3EB28,
- 0x65A7D3,
+ 0x65A7D3,
0x5B59FD, 0xDD1506, 0xD18CF0, 0x57C00B, 0xC8BF1C, 0x4EF3E7, 0x426A11,
- 0xC426EA,
+ 0xC426EA,
0x2AE476, 0xACA88D, 0xA0317B, 0x267D80, 0xB90297, 0x3F4E6C, 0x33D79A,
- 0xB59B61,
+ 0xB59B61,
0x8B654F, 0x0D29B4, 0x01B042, 0x87FCB9, 0x1883AE, 0x9ECF55, 0x9256A3,
- 0x141A58,
+ 0x141A58,
0xEFAAFF, 0x69E604, 0x657FF2, 0xE33309, 0x7C4C1E, 0xFA00E5, 0xF69913,
- 0x70D5E8,
+ 0x70D5E8,
0x4E2BC6, 0xC8673D, 0xC4FECB, 0x42B230, 0xDDCD27, 0x5B81DC, 0x57182A,
- 0xD154D1,
+ 0xD154D1,
0x26359F, 0xA07964, 0xACE092, 0x2AAC69, 0xB5D37E, 0x339F85, 0x3F0673,
- 0xB94A88,
+ 0xB94A88,
0x87B4A6, 0x01F85D, 0x0D61AB, 0x8B2D50, 0x145247, 0x921EBC, 0x9E874A,
- 0x18CBB1,
+ 0x18CBB1,
0xE37B16, 0x6537ED, 0x69AE1B, 0xEFE2E0, 0x709DF7, 0xF6D10C, 0xFA48FA,
- 0x7C0401,
+ 0x7C0401,
0x42FA2F, 0xC4B6D4, 0xC82F22, 0x4E63D9, 0xD11CCE, 0x575035, 0x5BC9C3,
- 0xDD8538
+ 0xDD8538
};
static const char *armor_begin[] = {
diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c
index 5b423945fa..cc3c40f2ba 100644
--- a/lib/opencdk/read-packet.c
+++ b/lib/opencdk/read-packet.c
@@ -86,15 +86,15 @@ read_s2k (cdk_stream_t inp, cdk_s2k_t s2k)
s2k->mode = cdk_stream_getc (inp);
s2k->hash_algo = cdk_stream_getc (inp);
- if (s2k->mode == CDK_S2K_SIMPLE)
- return 0;
+ if (s2k->mode == CDK_S2K_SIMPLE)
+ return 0;
else if (s2k->mode == CDK_S2K_SALTED || s2k->mode == CDK_S2K_ITERSALTED)
{
if (stream_read (inp, s2k->salt, DIM (s2k->salt), &nread))
return CDK_Inv_Packet;
if (nread != DIM (s2k->salt))
return CDK_Inv_Packet;
-
+
if (s2k->mode == CDK_S2K_ITERSALTED)
s2k->count = cdk_stream_getc (inp);
}
@@ -355,19 +355,21 @@ read_secret_key (cdk_stream_t inp, size_t pktlen, cdk_pkt_seckey_t sk)
rc = read_s2k (inp, sk->protect.s2k);
if (rc)
return rc;
- /* refer to --export-secret-subkeys in gpg(1) */
- if (sk->protect.s2k->mode == CDK_S2K_GNU_EXT)
- sk->protect.ivlen = 0;
- else {
- sk->protect.ivlen = _gnutls_cipher_get_block_size ( sk->protect.algo);
- if (!sk->protect.ivlen)
- return CDK_Inv_Packet;
- rc = stream_read (inp, sk->protect.iv, sk->protect.ivlen, &nread);
- if (rc)
- return rc;
- if (nread != sk->protect.ivlen)
- return CDK_Inv_Packet;
- }
+ /* refer to --export-secret-subkeys in gpg(1) */
+ if (sk->protect.s2k->mode == CDK_S2K_GNU_EXT)
+ sk->protect.ivlen = 0;
+ else
+ {
+ sk->protect.ivlen =
+ _gnutls_cipher_get_block_size (sk->protect.algo);
+ if (!sk->protect.ivlen)
+ return CDK_Inv_Packet;
+ rc = stream_read (inp, sk->protect.iv, sk->protect.ivlen, &nread);
+ if (rc)
+ return rc;
+ if (nread != sk->protect.ivlen)
+ return CDK_Inv_Packet;
+ }
}
else
sk->protect.algo = _pgp_cipher_to_gnutls (sk->s2k_usage);
@@ -422,21 +424,22 @@ read_secret_key (cdk_stream_t inp, size_t pktlen, cdk_pkt_seckey_t sk)
if (stream_read (inp, sk->encdata, sk->enclen, &nread))
return CDK_Inv_Packet;
/* Handle the GNU S2K extensions we know (just gnu-dummy right now): */
- if (sk->protect.s2k->mode == CDK_S2K_GNU_EXT) {
- unsigned char gnumode;
- if ((sk->enclen < strlen("GNU") + 1) ||
- (0 != memcmp("GNU", sk->encdata, strlen("GNU"))))
- return CDK_Inv_Packet;
- gnumode = sk->encdata[strlen("GNU")];
- /* we only handle gnu-dummy (mode 1).
- mode 2 should refer to external smart cards.
- */
- if (gnumode != 1)
- return CDK_Inv_Packet;
- /* gnu-dummy should have no more data */
- if (sk->enclen != strlen("GNU") + 1)
- return CDK_Inv_Packet;
- }
+ if (sk->protect.s2k->mode == CDK_S2K_GNU_EXT)
+ {
+ unsigned char gnumode;
+ if ((sk->enclen < strlen ("GNU") + 1) ||
+ (0 != memcmp ("GNU", sk->encdata, strlen ("GNU"))))
+ return CDK_Inv_Packet;
+ gnumode = sk->encdata[strlen ("GNU")];
+ /* we only handle gnu-dummy (mode 1).
+ mode 2 should refer to external smart cards.
+ */
+ if (gnumode != 1)
+ return CDK_Inv_Packet;
+ /* gnu-dummy should have no more data */
+ if (sk->enclen != strlen ("GNU") + 1)
+ return CDK_Inv_Packet;
+ }
nskey = cdk_pk_get_nskey (sk->pk->pubkey_algo);
if (!nskey)
{
diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c
index 2f0f3014c0..09ae1047c9 100644
--- a/lib/openpgp/pgp.c
+++ b/lib/openpgp/pgp.c
@@ -715,8 +715,8 @@ _gnutls_openpgp_find_key (cdk_kbnode_t knode, uint32_t keyid[2],
|| pkt->pkttype == CDK_PKT_PUBLIC_KEY)) || (priv != 0
&& (pkt->pkttype ==
CDK_PKT_SECRET_SUBKEY
- || pkt->
- pkttype ==
+ || pkt->pkttype
+ ==
CDK_PKT_SECRET_KEY)))
{
if (priv == 0)
diff --git a/lib/x509/common.c b/lib/x509/common.c
index e890987ab2..b399e7244a 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -346,7 +346,7 @@ _gnutls_x509_data2hex (const opaque * data, size_t data_size,
*sizeof_out = size;
return GNUTLS_E_SHORT_MEMORY_BUFFER;
}
- *sizeof_out = size; /* -1 for the null +1 for the '#' */
+ *sizeof_out = size; /* -1 for the null +1 for the '#' */
if (out)
{
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index 206403bbdb..fc02c2f575 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -706,7 +706,7 @@ gnutls_x509_crq_set_key_rsa_raw (gnutls_x509_crq_t crq,
return GNUTLS_E_INVALID_REQUEST;
}
- memset(temp_params, 0, sizeof(temp_params));
+ memset (temp_params, 0, sizeof (temp_params));
siz = m->size;
if (_gnutls_mpi_scan_nz (&temp_params[0], m->data, siz))
@@ -740,9 +740,9 @@ gnutls_x509_crq_set_key_rsa_raw (gnutls_x509_crq_t crq,
ret = 0;
error:
- _gnutls_mpi_release (&temp_params[0]);
- _gnutls_mpi_release (&temp_params[1]);
- return ret;
+ _gnutls_mpi_release (&temp_params[0]);
+ _gnutls_mpi_release (&temp_params[1]);
+ return ret;
}
/**
diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c
index ba00e5adfc..82ee063218 100644
--- a/lib/x509/pkcs12.c
+++ b/lib/x509/pkcs12.c
@@ -1134,12 +1134,10 @@ write_attributes (gnutls_pkcs12_bag_t bag, int elem,
result =
_gnutls_x509_encode_and_write_attribute (KEY_ID_OID, c2, root,
- bag->
- element[elem].local_key_id.
- data,
- bag->
- element[elem].local_key_id.
- size, 1);
+ bag->element[elem].
+ local_key_id.data,
+ bag->element[elem].
+ local_key_id.size, 1);
if (result < 0)
{
gnutls_assert ();
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index 9cf0f19405..82408c6111 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -496,7 +496,7 @@ gnutls_x509_privkey_import_rsa_raw (gnutls_x509_privkey_t key,
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
}
-
+
siz = m->size;
if (_gnutls_mpi_scan_nz (&key->params[0], m->data, siz))
{
diff --git a/libextra/gnutls_ia.c b/libextra/gnutls_ia.c
index ce00b828d3..a538c0ced7 100644
--- a/libextra/gnutls_ia.c
+++ b/libextra/gnutls_ia.c
@@ -176,9 +176,10 @@ _gnutls_ia_prf (gnutls_session_t session,
return GNUTLS_E_MEMORY_ERROR;
}
- memcpy (seed, session->security_parameters.server_random, GNUTLS_RANDOM_SIZE);
- memcpy (seed + GNUTLS_RANDOM_SIZE, session->security_parameters.client_random,
+ memcpy (seed, session->security_parameters.server_random,
GNUTLS_RANDOM_SIZE);
+ memcpy (seed + GNUTLS_RANDOM_SIZE,
+ session->security_parameters.client_random, GNUTLS_RANDOM_SIZE);
memcpy (seed + 2 * GNUTLS_RANDOM_SIZE, extra, extra_size);
ret = _gnutls_PRF (session, session->security_parameters.inner_secret,
@@ -257,7 +258,8 @@ gnutls_ia_generate_challenge (gnutls_session_t session,
void
gnutls_ia_extract_inner_secret (gnutls_session_t session, char *buffer)
{
- memcpy (buffer, session->security_parameters.inner_secret, GNUTLS_MASTER_SIZE);
+ memcpy (buffer, session->security_parameters.inner_secret,
+ GNUTLS_MASTER_SIZE);
}
/**
diff --git a/src/printlist.c b/src/printlist.c
index 0308176350..318b12f453 100644
--- a/src/printlist.c
+++ b/src/printlist.c
@@ -29,7 +29,8 @@
#include <time.h>
#include <common.h>
-int main(void)
+int
+main (void)
{
{
size_t i;
diff --git a/src/serv.c b/src/serv.c
index b90eb2315d..64f19485c6 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -134,12 +134,11 @@ static int wrap_db_delete (void *dbf, gnutls_datum_t key);
#define HTTP_STATE_RESPONSE 2
#define HTTP_STATE_CLOSING 3
-LIST_TYPE_DECLARE (listener_item, char *http_request; char *http_response;
- int request_length; int response_length;
- int response_written; int http_state; int fd;
- gnutls_session_t tls_session;
- int handshake_ok;
- );
+LIST_TYPE_DECLARE (listener_item, char *http_request;
+ char *http_response; int request_length;
+ int response_length; int response_written;
+ int http_state;
+ int fd; gnutls_session_t tls_session; int handshake_ok;);
static const char *
safe_strerror (int value)
diff --git a/tests/finished.c b/tests/finished.c
index 1f5cdbd4f6..4d82cd5403 100644
--- a/tests/finished.c
+++ b/tests/finished.c
@@ -133,8 +133,7 @@ server_push (gnutls_transport_ptr_t tr, const void *data, size_t len)
void
client_finished_callback (gnutls_session_t session,
- const void *finished,
- size_t len)
+ const void *finished, size_t len)
{
success ("client finished (length %d)\n", len);
hexprint (finished, len);
@@ -142,8 +141,7 @@ client_finished_callback (gnutls_session_t session,
void
server_finished_callback (gnutls_session_t session,
- const void *finished,
- size_t len)
+ const void *finished, size_t len)
{
success ("server finished (length %d)\n", len);
hexprint (finished, len);
diff --git a/tests/openssl.c b/tests/openssl.c
index 5cffa25b6c..f2b1e6a444 100644
--- a/tests/openssl.c
+++ b/tests/openssl.c
@@ -36,7 +36,7 @@ doit (void)
MD5_CTX c;
unsigned char md[MD5_DIGEST_LENGTH];
- if (gnutls_global_init() != 0)
+ if (gnutls_global_init () != 0)
fail ("gnutls_global_init\n");
if (!gnutls_check_version (LIBGNUTLS_VERSION))
diff --git a/tests/pgps2kgnu.c b/tests/pgps2kgnu.c
index 739b5ba821..91a5285e59 100644
--- a/tests/pgps2kgnu.c
+++ b/tests/pgps2kgnu.c
@@ -61,8 +61,7 @@ static char dummy_key[] =
"vQP/ZhK+2ly9oI2z7ZcNC/BJRch0/ybQ3haahII8pXXmOThpZohr/LUgoWgCZdXg\n"
"vP6yiszNk2tIs8KphCAw7Lw/qzDC2hEORjWO4f46qk73RAgSqG/GyzI4ltWiDhqn\n"
"vnQCFl3+QFSe4zinqykHnLwGPMXv428d/ZjkIc2ju8dRsn4=\n"
- "=CR5w\n"
- "-----END PGP PRIVATE KEY BLOCK-----\n";
+ "=CR5w\n" "-----END PGP PRIVATE KEY BLOCK-----\n";
/* Test capability of reading the gnu-dummy OpenPGP S2K extension.
See: doc/DETAILS from gnupg
@@ -73,7 +72,8 @@ int
main (void)
{
int rc;
- gnutls_datum_t keydatum = { (unsigned char*)dummy_key, strlen (dummy_key) };
+ gnutls_datum_t keydatum =
+ { (unsigned char *) dummy_key, strlen (dummy_key) };
gnutls_openpgp_privkey_t key;
rc = gnutls_global_init ();
@@ -95,7 +95,7 @@ main (void)
GNUTLS_OPENPGP_FMT_BASE64, NULL, 0);
if (rc)
{
- printf ("gnutls_openpgp_privkey_import rc %d: %s\n",
+ printf ("gnutls_openpgp_privkey_import rc %d: %s\n",
rc, gnutls_strerror (rc));
return 1;
}
diff --git a/tests/pkcs12-decode/pkcs12_s2k.c b/tests/pkcs12-decode/pkcs12_s2k.c
index 31729e261c..03d1c66be9 100644
--- a/tests/pkcs12-decode/pkcs12_s2k.c
+++ b/tests/pkcs12-decode/pkcs12_s2k.c
@@ -42,21 +42,21 @@ char *pw[3] = { "secret1", "verysecret2", "veryverysecret3" };
char *values[] = {
/* 1.0 */
- "85a3c676a66f0960f4807144a28c8d61a0001b81846f301a1ac164289879972f",
+ "85a3c676a66f0960f4807144a28c8d61a0001b81846f301a1ac164289879972f",
/* 1.2 */
- "e659da7d5989733a3d268e0bf7752c35c116e5c75919449a98f6812f82a15b16",
+ "e659da7d5989733a3d268e0bf7752c35c116e5c75919449a98f6812f82a15b16",
/* 1.2 */
- "878b8a88bf6166ce803b7498822205b1ac82870d3aec20807148779375a61f1e",
+ "878b8a88bf6166ce803b7498822205b1ac82870d3aec20807148779375a61f1e",
/* 2.0 */
- "1c845be764371d633c7fd1056967a9940385e110e85b58f826d39ae8561a0019",
+ "1c845be764371d633c7fd1056967a9940385e110e85b58f826d39ae8561a0019",
/* 2.1 */
- "de8dd3ffd59b65d3d5f59a1f71d7add582741f7752a786c045953e727e4465c0",
+ "de8dd3ffd59b65d3d5f59a1f71d7add582741f7752a786c045953e727e4465c0",
/* 2.2 */
- "9dd7f19e5e6aee5c5008b5deefd35889ab7519356f13478ecdee593c5ed689b1",
+ "9dd7f19e5e6aee5c5008b5deefd35889ab7519356f13478ecdee593c5ed689b1",
/* 3.0 */
- "1c165e5a291a1539f3dbcf82a3e6ed566eb9d50ad4b0b3b57b599b08f0531236",
+ "1c165e5a291a1539f3dbcf82a3e6ed566eb9d50ad4b0b3b57b599b08f0531236",
/* 3.1 */
- "5c9abee3cde31656eedfc131b7c2f8061032a3c705961ee2306a826c8b4b1a76",
+ "5c9abee3cde31656eedfc131b7c2f8061032a3c705961ee2306a826c8b4b1a76",
/* 3.2 */ "a9c94e0acdaeaea54d1b1b681c3b64916396a352dea7ffe635fb2c11d8502e98"
};
diff --git a/tests/simple.c b/tests/simple.c
index 3413b973f1..c9c498ff2b 100644
--- a/tests/simple.c
+++ b/tests/simple.c
@@ -78,9 +78,10 @@ doit (void)
{
printf ("sign_list[%d] = %d = %s = %d\n", i, algs[i],
gnutls_sign_algorithm_get_name (algs[i]),
- gnutls_sign_get_id (gnutls_sign_algorithm_get_name (algs[i])));
- if (gnutls_sign_get_id (gnutls_sign_algorithm_get_name (algs[i]))
- != algs[i])
+ gnutls_sign_get_id (gnutls_sign_algorithm_get_name
+ (algs[i])));
+ if (gnutls_sign_get_id (gnutls_sign_algorithm_get_name (algs[i])) !=
+ algs[i])
fail ("gnutls_sign id's doesn't match\n");
}