summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2009-10-26 14:45:39 +0100
committerSimon Josefsson <simon@josefsson.org>2009-10-26 14:45:39 +0100
commit1b98628dfbecc2b6ad6f4c04181956176506cd1e (patch)
treeff92dfe234c15ce25ffa834530f787b8167554c6 /lib
parent05f02b46b6195f35d5bf48f55da7e1a027128906 (diff)
downloadgnutls-1b98628dfbecc2b6ad6f4c04181956176506cd1e.tar.gz
Fix code style so it compiles with gcc 4.4 with warnings.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnutls_cipher.c2
-rw-r--r--lib/gnutls_handshake.c101
2 files changed, 53 insertions, 50 deletions
diff --git a/lib/gnutls_cipher.c b/lib/gnutls_cipher.c
index 5f2ed62060..7519821cf9 100644
--- a/lib/gnutls_cipher.c
+++ b/lib/gnutls_cipher.c
@@ -217,7 +217,7 @@ mac_init (digest_hd_st * td, gnutls_mac_algorithm_t mac, opaque * secret,
return ret;
}
-inline static void
+static void
mac_deinit (digest_hd_st * td, opaque * res, int ver)
{
if (ver == GNUTLS_SSL3)
diff --git a/lib/gnutls_handshake.c b/lib/gnutls_handshake.c
index 7d5a820165..4183122f9d 100644
--- a/lib/gnutls_handshake.c
+++ b/lib/gnutls_handshake.c
@@ -78,21 +78,26 @@ _gnutls_handshake_hash_add_recvd (gnutls_session_t session,
void
_gnutls_handshake_hash_buffers_clear (gnutls_session_t session)
{
- if (session->security_parameters.handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_10)
+ if (session->security_parameters.
+ handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_10)
{
- _gnutls_hash_deinit (&session->internals.handshake_mac_handle.tls10.md5, NULL);
- _gnutls_hash_deinit (&session->internals.handshake_mac_handle.tls10.sha, NULL);
+ _gnutls_hash_deinit (&session->internals.
+ handshake_mac_handle.tls10.md5, NULL);
+ _gnutls_hash_deinit (&session->internals.
+ handshake_mac_handle.tls10.sha, NULL);
}
- else if (session->security_parameters.handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_12)
+ else if (session->security_parameters.
+ handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_12)
{
- _gnutls_hash_deinit (&session->internals.handshake_mac_handle.tls12.mac, NULL);
+ _gnutls_hash_deinit (&session->internals.
+ handshake_mac_handle.tls12.mac, NULL);
}
session->security_parameters.handshake_mac_handle_type = 0;
session->internals.handshake_mac_handle_init = 0;
_gnutls_handshake_buffer_clear (session);
}
-/* this will copy the required values for resuming to
+/* this will copy the required values for resuming to
* internals, and to security_parameters.
* this will keep as less data to security_parameters.
*/
@@ -150,7 +155,7 @@ _gnutls_set_client_random (gnutls_session_t session, uint8_t * rnd)
GNUTLS_RANDOM_SIZE);
}
-/* Calculate The SSL3 Finished message
+/* Calculate The SSL3 Finished message
*/
#define SSL3_CLIENT_MSG "CLNT"
#define SSL3_SERVER_MSG "SRVR"
@@ -164,25 +169,25 @@ _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
const char *mesg;
int rc;
- if (session->security_parameters.handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_10)
+ if (session->security_parameters.
+ handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_10)
{
- rc =
- _gnutls_hash_copy (&td_md5, &session->internals.handshake_mac_handle.tls10.md5);
+ rc = _gnutls_hash_copy (&td_md5, &session->internals.
+ handshake_mac_handle.tls10.md5);
if (rc < 0)
- {
- gnutls_assert ();
- return rc;
- }
+ {
+ gnutls_assert ();
+ return rc;
+ }
- rc =
- _gnutls_hash_copy (&td_sha, &session->internals.handshake_mac_handle.tls10.sha);
+ rc = _gnutls_hash_copy (&td_sha, &session->internals.
+ handshake_mac_handle.tls10.sha);
if (rc < 0)
- {
- gnutls_assert ();
- _gnutls_hash_deinit (&td_md5, NULL);
- return rc;
- }
-
+ {
+ gnutls_assert ();
+ _gnutls_hash_deinit (&td_md5, NULL);
+ return rc;
+ }
}
else
{
@@ -190,7 +195,6 @@ _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
return GNUTLS_E_INTERNAL_ERROR;
}
-
if (type == GNUTLS_SERVER)
{
mesg = SSL3_SERVER_MSG;
@@ -213,7 +217,7 @@ _gnutls_ssl3_finished (gnutls_session_t session, int type, opaque * ret)
return 0;
}
-/* Hash the handshake messages as required by TLS 1.0
+/* Hash the handshake messages as required by TLS 1.0
*/
#define SERVER_MSG "server finished"
#define CLIENT_MSG "client finished"
@@ -223,52 +227,51 @@ _gnutls_finished (gnutls_session_t session, int type, void *ret)
{
const int siz = TLS_MSG_LEN;
opaque concat[MAX_HASH_SIZE+16/*MD5*/];
- size_t len;
+ size_t len = 20 + 16;
const char *mesg;
digest_hd_st td_md5;
digest_hd_st td_sha;
- gnutls_protocol_t ver = gnutls_protocol_get_version (session);
int rc;
- if (session->security_parameters.handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_10)
+ if (session->security_parameters.
+ handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_10)
{
rc =
- _gnutls_hash_copy (&td_md5,
- &session->internals.handshake_mac_handle.tls10.md5);
+ _gnutls_hash_copy (&td_md5, &session->internals.
+ handshake_mac_handle.tls10.md5);
if (rc < 0)
{
gnutls_assert ();
return rc;
}
- rc =
- _gnutls_hash_copy (&td_sha, &session->internals.handshake_mac_handle.tls10.sha);
+ rc = _gnutls_hash_copy (&td_sha, &session->internals.
+ handshake_mac_handle.tls10.sha);
if (rc < 0)
- {
- gnutls_assert ();
- _gnutls_hash_deinit (&td_md5, NULL);
- return rc;
- }
+ {
+ gnutls_assert ();
+ _gnutls_hash_deinit (&td_md5, NULL);
+ return rc;
+ }
- _gnutls_hash_deinit (&td_md5, concat);
- _gnutls_hash_deinit (&td_sha, &concat[16]);
- len = 20 + 16;
+ _gnutls_hash_deinit (&td_md5, concat);
+ _gnutls_hash_deinit (&td_sha, &concat[16]);
}
- else if (session->security_parameters.handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_12)
+ else if (session->security_parameters.
+ handshake_mac_handle_type == HANDSHAKE_MAC_TYPE_12)
{
- rc =
- _gnutls_hash_copy (&td_sha, &session->internals.handshake_mac_handle.tls12.mac);
+ rc = _gnutls_hash_copy (&td_sha, &session->internals.
+ handshake_mac_handle.tls12.mac);
if (rc < 0)
- {
- gnutls_assert ();
- return rc;
- }
+ {
+ gnutls_assert ();
+ return rc;
+ }
- _gnutls_hash_deinit (&td_sha, concat);
- len = _gnutls_hash_get_algo_len (td_sha.algorithm);
+ _gnutls_hash_deinit (&td_sha, concat);
+ len = _gnutls_hash_get_algo_len (td_sha.algorithm);
}
-
if (type == GNUTLS_SERVER)
{
mesg = SERVER_MSG;