diff options
author | Tom Vrancken <dev@tomvrancken.nl> | 2018-05-19 16:01:01 +0200 |
---|---|---|
committer | Tom Vrancken <dev@tomvrancken.nl> | 2018-10-18 21:39:47 +0200 |
commit | 906a84439c8c331e09a1963304271f92bd021f83 (patch) | |
tree | 2d1b46e419a4e4077547ca387ae3e010fb98c0d7 | |
parent | e5eb26c1db3fae4ebac6964797b7146e022d99cc (diff) | |
download | gnutls-906a84439c8c331e09a1963304271f92bd021f83.tar.gz |
Small fixes for comments and log strings.
Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
-rw-r--r-- | lib/algorithms/ciphersuites.c | 2 | ||||
-rw-r--r-- | lib/algorithms/protocols.c | 2 | ||||
-rw-r--r-- | lib/auth/cert.c | 22 | ||||
-rw-r--r-- | lib/ext/signature.c | 27 |
4 files changed, 24 insertions, 29 deletions
diff --git a/lib/algorithms/ciphersuites.c b/lib/algorithms/ciphersuites.c index 4e840bdd8b..870a6ebbfc 100644 --- a/lib/algorithms/ciphersuites.c +++ b/lib/algorithms/ciphersuites.c @@ -1670,7 +1670,7 @@ _gnutls_get_client_ciphersuites(gnutls_session_t session, } /** - * gnutls_priority_get_cipher_suite: + * gnutls_priority_get_cipher_suite_index: * @pcache: is a #gnutls_prioritity_t type. * @idx: is an index number. * @sidx: internal index of cipher suite to get information about. diff --git a/lib/algorithms/protocols.c b/lib/algorithms/protocols.c index 501cf350c3..ce2ec48fcc 100644 --- a/lib/algorithms/protocols.c +++ b/lib/algorithms/protocols.c @@ -324,7 +324,7 @@ int _gnutls_write_supported_versions(gnutls_session_t session, uint8_t *buffer, at_least_one_new = 1; if (buffer_size > 2) { - _gnutls_debug_log("Advertizing version %x.%x\n", (int)p->major, (int)p->minor); + _gnutls_debug_log("Advertizing version %d.%d\n", (int)p->major, (int)p->minor); buffer[0] = p->major; buffer[1] = p->minor; written_bytes += 2; diff --git a/lib/auth/cert.c b/lib/auth/cert.c index 61a55f0745..88ad807f7f 100644 --- a/lib/auth/cert.c +++ b/lib/auth/cert.c @@ -60,7 +60,7 @@ selected_certs_set(gnutls_session_t session, typedef enum CertificateSigType { RSA_SIGN = 1, DSA_SIGN = 2, ECDSA_SIGN = 64 } CertificateSigType; -/* Moves data from a internal certificate struct (gnutls_pcert_st) to +/* Moves data from a internal certificate struct (gnutls_pcert_st) to * another internal certificate struct (cert_auth_info_t), and deinitializes * the former. */ @@ -118,7 +118,7 @@ check_pk_algo_in_list(const gnutls_pk_algorithm_t * return -1; } -/* Returns the issuer's Distinguished name in odn, of the certificate +/* Returns the issuer's Distinguished name in odn, of the certificate * specified in cert. */ static int cert_get_issuer_dn(gnutls_pcert_st * cert, gnutls_datum_t * odn) @@ -165,7 +165,7 @@ static int cert_get_issuer_dn(gnutls_pcert_st * cert, gnutls_datum_t * odn) /* Locates the most appropriate x509 certificate using the * given DN. If indx == -1 then no certificate was found. * - * That is to guess which certificate to use, based on the + * That is to guess which certificate to use, based on the * CAs and sign algorithms supported by the peer server. */ static int @@ -269,7 +269,7 @@ get_issuers_num(gnutls_session_t session, const uint8_t * data, ssize_t data_siz if (data_size > 0) do { - /* This works like DECR_LEN() + /* This works like DECR_LEN() */ result = GNUTLS_E_UNEXPECTED_PACKET_LENGTH; DECR_LENGTH_COM(data_size, 2, goto error); @@ -507,7 +507,7 @@ _gnutls_select_client_cert(gnutls_session_t session, cred->certs[indx].ocsp_data, cred->certs[indx].ocsp_data_length, cred->certs[indx].pkey, 0, - NULL, 0); + NULL, NULL); } else { selected_certs_set(session, NULL, 0, NULL, 0, NULL, 0, NULL, NULL); @@ -532,7 +532,7 @@ static int gen_x509_crt(gnutls_session_t session, gnutls_buffer_st * data) int apr_cert_list_length; unsigned init_pos = data->length; - /* find the appropriate certificate + /* find the appropriate certificate */ if ((ret = _gnutls_get_selected_cert(session, &apr_cert_list, @@ -553,7 +553,7 @@ static int gen_x509_crt(gnutls_session_t session, gnutls_buffer_st * data) * instead of: * 0B 00 00 00 // empty certificate handshake * - * ( the above is the whole handshake message, not + * ( the above is the whole handshake message, not * the one produced here ) */ @@ -701,7 +701,7 @@ _gnutls_proc_x509_server_crt(gnutls_session_t session, } /* Ok we now allocate the memory to hold the - * certificate list + * certificate list */ peer_certificate_list = @@ -895,7 +895,7 @@ _gnutls_proc_cert_cert_req(gnutls_session_t session, uint8_t * data, DECR_LEN_FINAL(dsize, size); - /* We should reply with a certificate message, + /* We should reply with a certificate message, * even if we have no certificate to send. */ session->internals.hsk_flags |= HSK_CRT_ASKED; @@ -1123,7 +1123,7 @@ _gnutls_gen_cert_server_cert_req(gnutls_session_t session, return data->length - init_pos; } -/* This function will return the appropriate certificate to use. +/* This function will return the appropriate certificate to use. * Fills in the apr_cert_list, apr_cert_list_length and apr_pkey. * The return value is a negative error code on error. * @@ -1148,7 +1148,7 @@ _gnutls_get_selected_cert(gnutls_session_t session, return GNUTLS_E_INSUFFICIENT_CREDENTIALS; } - } else { /* CLIENT SIDE + } else { /* CLIENT SIDE */ /* _gnutls_select_client_cert() must have been called before. */ diff --git a/lib/ext/signature.c b/lib/ext/signature.c index a0e6e20b89..5992efe986 100644 --- a/lib/ext/signature.c +++ b/lib/ext/signature.c @@ -21,7 +21,7 @@ * */ -/* This file contains the code the Certificate Type TLS extension. +/* This file contains the code for the Signature Algorithms TLS extension. * This extension is currently gnutls specific. */ @@ -41,8 +41,7 @@ static int _gnutls_signature_algorithm_recv_params(gnutls_session_t size_t data_size); static int _gnutls_signature_algorithm_send_params(gnutls_session_t session, - gnutls_buffer_st * - extdata); + gnutls_buffer_st * extdata); static void signature_algorithms_deinit_data(gnutls_ext_priv_data_t priv); static int signature_algorithms_pack(gnutls_ext_priv_data_t epriv, gnutls_buffer_st * ps); @@ -161,12 +160,10 @@ _gnutls_sign_algorithm_parse_data(gnutls_session_t session, gnutls_sign_get_name(sig)); if (sig != GNUTLS_SIGN_UNKNOWN) { - if (priv->sign_algorithms_size == - MAX_ALGOS) + if (priv->sign_algorithms_size == MAX_ALGOS) break; priv->sign_algorithms[priv-> - sign_algorithms_size++] = - sig; + sign_algorithms_size++] = sig; } } @@ -204,7 +201,7 @@ _gnutls_signature_algorithm_recv_params(gnutls_session_t session, */ /* return GNUTLS_E_UNEXPECTED_PACKET; */ } else { - /* SERVER SIDE - we must check if the sent cert type is the right one + /* SERVER SIDE */ if (data_size >= 2) { uint16_t len; @@ -263,7 +260,7 @@ _gnutls_signature_algorithm_send_params(gnutls_session_t session, } /* Returns a requested by the peer signature algorithm that - * matches the given certificate's public key algorithm. + * matches the given certificate's public key algorithm. * * When the @client_cert flag is not set, then this function will * also check whether the signature algorithm is allowed to be @@ -370,16 +367,14 @@ _gnutls_session_sign_algo_enabled(gnutls_session_t session, } } - for (i = 0; i < session->internals.priorities->sigalg.size; - i++) { - if (session->internals.priorities->sigalg.entry[i]->id == - sig) { + for (i = 0; i < session->internals.priorities->sigalg.size; i++) { + if (session->internals.priorities->sigalg.entry[i]->id == sig) { return 0; /* ok */ } } disallowed: - _gnutls_handshake_log("signature algorithm %s is not enabled\n", gnutls_sign_algorithm_get_name(sig)); + _gnutls_handshake_log("Signature algorithm %s is not enabled\n", gnutls_sign_algorithm_get_name(sig)); return GNUTLS_E_UNSUPPORTED_SIGNATURE_ALGORITHM; } @@ -493,7 +488,7 @@ gnutls_sign_algorithm_get_requested(gnutls_session_t session, * gnutls_sign_algorithm_get: * @session: is a #gnutls_session_t type. * - * Returns the signature algorithm that is (or will be) used in this + * Returns the signature algorithm that is (or will be) used in this * session by the server to sign data. This function should be * used only with TLS 1.2 or later. * @@ -510,7 +505,7 @@ int gnutls_sign_algorithm_get(gnutls_session_t session) * gnutls_sign_algorithm_get_client: * @session: is a #gnutls_session_t type. * - * Returns the signature algorithm that is (or will be) used in this + * Returns the signature algorithm that is (or will be) used in this * session by the client to sign data. This function should be * used only with TLS 1.2 or later. * |