]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Small fixes for comments and log strings.
authorTom Vrancken <dev@tomvrancken.nl>
Sat, 19 May 2018 14:01:01 +0000 (16:01 +0200)
committerTom Vrancken <dev@tomvrancken.nl>
Thu, 18 Oct 2018 19:39:47 +0000 (21:39 +0200)
Signed-off-by: Tom Vrancken <dev@tomvrancken.nl>
lib/algorithms/ciphersuites.c
lib/algorithms/protocols.c
lib/auth/cert.c
lib/ext/signature.c

index 4e840bdd8b18bc3d83d6b195234a5bc485187e88..870a6ebbfcab550d7d891abfefc91d833acc99dc 100644 (file)
@@ -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.
index 501cf350c3bd0251909866eddc9b5075d88602f6..ce2ec48fcc593cc87ec28fe9f61f8296ff330f7d 100644 (file)
@@ -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;
index 61a55f0745e116ed93115d456657c18aa2fe6758..88ad807f7f16638bc19155c4c8e9a4d27cbb62d4 100644 (file)
@@ -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.
                 */
index a0e6e20b8973ef7efbe65d289c9959141618a49c..5992efe98631d9157499406e02b65f8ca7051351 100644 (file)
@@ -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.
  *