]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added some hints on the file purpose, and some other cleanups.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 10 Jul 2002 15:49:24 +0000 (15:49 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 10 Jul 2002 15:49:24 +0000 (15:49 +0000)
35 files changed:
lib/auth_anon.c
lib/auth_cert.c
lib/auth_dhe.c
lib/auth_rsa.c
lib/ext_cert_type.c
lib/ext_max_record.c
lib/gnutls_buffers.c
lib/gnutls_cert.c
lib/gnutls_cipher.c
lib/gnutls_compress.c
lib/gnutls_constate.c
lib/gnutls_datum.c
lib/gnutls_db.c
lib/gnutls_extensions.c
lib/gnutls_handshake.c
lib/gnutls_hash_int.c
lib/gnutls_int.h
lib/gnutls_kx.c
lib/gnutls_mpi.c
lib/gnutls_num.c
lib/gnutls_pk.c
lib/gnutls_priority.c
lib/gnutls_privkey.c
lib/gnutls_random.c
lib/gnutls_record.c
lib/gnutls_session_pack.c
lib/gnutls_state.c
lib/gnutls_state.h
lib/gnutls_ui.c
lib/gnutls_v2_compat.c
lib/x509_b64.c
lib/x509_extensions.c
lib/x509_sig_check.c
lib/x509_verify.c
lib/x509_xml.c

index 7aa72f2619a49f6a3d534f286798f55316708315..16e53adb06a69dfe74ba035c46837e25eecc116a 100644 (file)
  *  You should have received a copy of the GNU Lesser General Public
  *  License along with this library; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- * */
+ * 
+ */
+
+/* This file contains the Anonymous Diffie Hellman key exchange part of
+ * the anonymous authentication. The functions here are used in the
+ * handshake.
+ */
 
 #include "gnutls_int.h"
 
index f2c5b7a8c5982cb67d450f262de8686ec8a2866a..6448921abd5555e6aaed9da30fbc0f433afa5b61 100644 (file)
  *  You should have received a copy of the GNU Lesser General Public
  *  License along with this library; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- * */
+ * 
+ */
+
+/* The certificate authentication functions which are needed in the handshake,
+ * and are common to RSA and DHE key exchange, are in this file.
+ */
 
 #include <gnutls_int.h>
 #include "gnutls_auth_int.h"
index 62bfa09449322c38724247091eb2350b6871e7ea..92abbe4d8ee24f771b8435d60cb001e43a6ac97f 100644 (file)
  *  You should have received a copy of the GNU Lesser General Public
  *  License along with this library; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- * */
+ * 
+ */
 
+/* This file contains everything for the Ephemeral Diffie Hellman (DHE)
+ * key exchange. This is used in the handshake procedure of the certificate
+ * authentication.
+ */
 
 #include "gnutls_int.h"
 #include "gnutls_auth_int.h"
index 3de7113a1d5f0fbf2776c9ef9d01cf9cd4b4d554..5b9bfea96aa83c5e263b6454117a04776a383d70 100644 (file)
  *  You should have received a copy of the GNU Lesser General Public
  *  License along with this library; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
- * */
+ * 
+ */
+
+/* This file contains the RSA key exchange part of the certificate
+ * authentication.
+ */
 
 #include "gnutls_int.h"
 #include "gnutls_auth_int.h"
index d32b0109a63ef2f24971c0251949f782f541c30b..dfa974ac96bab852518b06b5751d5e4121e3ab34 100644 (file)
  *
  */
 
+/* This file contains the code the Certificate Type TLS extension.
+ * This extension is currently gnutls specific.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_num.h"
index 38e0dba6e320670825c91c7eedcc0565bb4b1c88..2fccce533d8dd7935c09b6d455669316a96560b6 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* This file contains the code for the Max Record Size TLS extension.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_num.h"
index fe6cc4cec75d76e8c11a22059a0e835d94fff972..eba4ae7bc8d5c324612a729cf2818fb0097238a2 100644 (file)
  *
  */
 
-#include <gnutls_int.h>
-#include <gnutls_errors.h>
-#include <gnutls_num.h>
-#include <gnutls_record.h>
-#include <gnutls_buffers.h>
-#include <gnutls_datum.h>
-
 /* This is the only file that uses the berkeley sockets API.
  * 
  * Also holds all the buffering code used in gnutls.
  *
  */
 
+#include <gnutls_int.h>
+#include <gnutls_errors.h>
+#include <gnutls_num.h>
+#include <gnutls_record.h>
+#include <gnutls_buffers.h>
+#include <gnutls_datum.h>
+
 #ifdef HAVE_ERRNO_H
 # include <errno.h>
 #endif
index bcc16951f9b4dd7968e76bcf03711fbb7e8911c7..3b2525edd4c3763bc82ee6102ce29d406ea0d2ea 100644 (file)
  *
  */
 
+/* Some of the stuff needed for Certificate authentication is contained
+ * in this file.
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_errors.h>
 #include <auth_cert.h>
index 27403793548f0fc5e94767ccc3740a52cf57b6b4..cd226306ad49f6b1b1ec31ff9d32b69dd3caa50e 100644 (file)
  *
  */
 
+/* Some high level functions to be used in the record encryption are
+ * included here.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_compress.h"
index 589b38655e11d9067e4e294b1f0460c8b49700fa..cebc3d21ea0d7d3812b7d812706f8d5795aa6795 100644 (file)
  *
  */
 
+/* This file contains the functions which convert the TLS plaintext
+ * packet to TLS compressed packet.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_compress.h"
 #include "gnutls_errors.h"
index ae4630c7035ec6f7b4bb603a0eac174d105d1544..e8e9300d57f1ec532f4e98e8be266908e75f58db 100644 (file)
  *
  */
 
+/* Functions that are supposed to run after the handshake procedure is
+ * finished. These functions activate the established security parameters.
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_constate.h>
 #include <gnutls_errors.h>
index f8e5f38ed7a610d757985712346d0f821e2a1394..af9a3660bbd08437c24eee964ba5e2ab974be5b5 100644 (file)
  *
  */
 
+/* contains functions that make it easier to
+ * write vectors of <size|data>. The destination size
+ * should be preallocated (datum.size+(bits/8))
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_num.h>
 #include <gnutls_datum.h>
 #include <gnutls_errors.h>
 
-/* contains functions that make it easier to
- * write vectors of <size|data>. The destination size
- * should be preallocated (datum.size+(bits/8))
- */
 
 void _gnutls_write_datum16( opaque* dest, gnutls_datum dat) {
        _gnutls_write_uint16( dat.size, dest);
index fd420595b5016c93e31610ed0280b210fafe3b48..14e1238439fa374dc0b341628a34d33f73de3f32 100644 (file)
  *
  */
 
-/* This file contains functions that manipulate a database
+/* This file contains functions that manipulate a database backend
  * for resumed sessions. 
  */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_session.h"
@@ -29,8 +30,6 @@
 #include "debug.h"
 #include <gnutls_session_pack.h>
 
-#define GNUTLS_DBNAME state->gnutls_internals.db_name
-
 /**
   * gnutls_db_set_retrieve_function - Sets the function that will be used to get data
   * @state: is a &GNUTLS_STATE structure.
@@ -210,7 +209,7 @@ gnutls_datum data;
 gnutls_datum key = { session_id, session_id_size };
 int ret;
 
-       if (GNUTLS_DBNAME==NULL && _gnutls_db_func_is_ok(state)!=0) {
+       if (_gnutls_db_func_is_ok(state)!=0) {
                gnutls_assert();
                return GNUTLS_E_INVALID_SESSION;
        }
@@ -254,7 +253,7 @@ int ret = 0;
                return GNUTLS_E_INVALID_SESSION;
        }
        
-       if (GNUTLS_DBNAME==NULL && _gnutls_db_func_is_ok(state)!=0) {
+       if (_gnutls_db_func_is_ok(state)!=0) {
                return GNUTLS_E_DB_ERROR;
        }
        
@@ -300,7 +299,7 @@ int _gnutls_remove_session( GNUTLS_STATE state, gnutls_datum session_id)
 {
 int ret = 0;
 
-       if (GNUTLS_DBNAME==NULL && _gnutls_db_func_is_ok(state)!=0) {
+       if (_gnutls_db_func_is_ok(state)!=0) {
                return GNUTLS_E_DB_ERROR;
        }
        
index 37028d53e7445406fb3156fc3b070f6cbfeaf222..d95abb6e5b7c68f519c4f77bdb49196ceaf38a5a 100644 (file)
  *
  */
 
+/* Functions that relate to the TLS hello extension parsing.
+ * Hello extensions are packets appended in the TLS hello packet, and
+ * allow for extra functionality.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_extensions.h"
 #include "gnutls_errors.h"
index c5a3c03bcadbaf4a69cb32fb6f28f5c0b3984ef9..faea7d8e482ada1c85fb430667b9ab9708fd0e42 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions that relate to the TLS handshake procedure.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_dh.h"
index c12ee544d8df1f4f4c93442624d0ed870ff3209d..51eb9b985c03c1eb12db86a5d0889aa24cffa4de 100644 (file)
  *
  */
 
-#include <gnutls_int.h>
-#include <gnutls_hash_int.h>
-#include <gnutls_errors.h>
-
 /* This file handles all the internal functions that cope with hashes
- * and hmacs. Currently it uses the functions provided by
+ * and HMACs. Currently it uses the functions provided by
  * the gcrypt library that this can be easily changed.
  */
 
+#include <gnutls_int.h>
+#include <gnutls_hash_int.h>
+#include <gnutls_errors.h>
+
 GNUTLS_HASH_HANDLE _gnutls_hash_init(MACAlgorithm algorithm)
 {
        GNUTLS_MAC_HANDLE ret;
index b957da7e0662f6783a1bbe7dbdc2f28e97664748..f5a72719ad3aa1ed7e6f17a4010bac5fd41489d3 100644 (file)
@@ -470,8 +470,6 @@ typedef struct {
                                         */
        int                             have_peeked_data;
 
-       /* gdbm */
-       char*                           db_name;
        int                             expire_time; /* after expire_time seconds this session will expire */
        struct MOD_AUTH_STRUCT_INT*     auth_struct; /* used in handshake packets and KX algorithms */
        int                             v2_hello; /* 0 if the client hello is v3+.
index f3afe380779c715c10db75d43650c8dab9fa3539..6570d5a458dbc3cd401ee23f68bccd071914f853 100644 (file)
  *
  */
 
+/* This file contains functions which are wrappers for the key exchange
+ * part of TLS. They are called by the handshake functions (gnutls_handshake)
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_handshake.h"
 #include "gnutls_kx.h"
@@ -43,6 +47,8 @@ int _gnutls_generate_master( GNUTLS_STATE state) {
        return 0;
 }
 
+/* here we generate the TLS Master secret.
+ */
 #define PREMASTER state->gnutls_key->key
 static int generate_normal_master( GNUTLS_STATE state) {
 int ret = 0;
index 62595951bfe210cecf13b8057b18efdedd85bdf8..436a356ea390805ae5246ac037cefaef7c030c8f 100644 (file)
  *
  */
 
+/* Here lie everything that has to do with large numbers, libgcrypt and
+ * other stuff that didn't fit anywhere else.
+ */
+
 #include <gnutls_int.h>
 #include <libtasn1.h>
 #include <gnutls_errors.h>
index 8f165353d399742bfea1a4af93d961d2d7fa0b10..9925d6671adf39cbbe4815e16de4bd7ec4a4fa80 100644 (file)
  *
  */
 
+/* This file contains the functions needed for 64 bit integer support in
+ * TLS, and functions which ease the access to TLS vectors (data of given size).
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_num.h>
 #include <gnutls_errors.h>
index 28aa3da152b8dd07230f11082e6d597efc8a7e56..53af12d312d68b22b0c75e74b7f6af2ec35e44c1 100644 (file)
@@ -19,7 +19,8 @@
  *
  */
 
-/* This file contains function for RSA/DSA etc. 
+/* This file contains the functions needed for RSA/DSA public key
+ * encryption and signatures. 
  */
 
 #include <gnutls_int.h>
index 246ad9be6b82de77b3f26a945af4f74c62ca98b4..a299dfd4d34fa692f811b418fc7c17a53f0b405a 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Here lies the code of the gnutls_*_set_priority() functions.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_algorithms.h"
 #include "gnutls_errors.h"
index d3e34d013a3c860cbb61479c1608246c772f9e1c..df78898e6ddde32f58ad936474deea3a062cf4ff 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* This file contains functions needed to read DSA or RSA private keys
+ * from files, or memory.
+ */
 
 #include <gnutls_int.h>
 #include <gnutls_errors.h>
index 6c64c87aac945ef3ea0425ea4ff6c088bd9e72b5..130e14f53fae51bfc67de3be2a0007abaa7f0831 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions to return random bytes.
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_random.h>
 #include <gnutls_errors.h>
index e31119bb0a78676c9fc825fab207759ffc9ef4c3..72fb582331e4f6422552d0d1ec033b97fc89b530 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions that are record layer specific, are included in this file.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "debug.h"
index a8e5a71228b9739555c718072c582defccc51729..dd4ca6ab043fd24e4d8fc5798ba6e148c8bd4ab7 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  *
  */
+/* Contains functions that are supposed to pack and unpack session data,
+ * before and after they are sent to the database backend.
+ */
+
 #include <gnutls_int.h>
 #include <auth_srp.h>
 #include <auth_anon.h>
index 3fc5756256ac559093dfd2e982a857f6b6f6c019..244111b57e82af4e17866993d59a2bc6b9da61f2 100644 (file)
  *
  */
 
+/* Functions to manipulate the state (gnutls_int.h), and some other stuff
+ * are included here.
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_errors.h>
 #include <gnutls_auth_int.h>
@@ -280,8 +284,6 @@ void _gnutls_deinit(GNUTLS_STATE state)
                state->gnutls_key = NULL;
        }
 
-       _gnutls_free(state->gnutls_internals.db_name);
-
        memset( state, 0, sizeof(struct GNUTLS_STATE_INT));
        gnutls_free(state);
 
index 3e87691f95218d634ba697f25a22249f6cdbd661..d1a704dc2d0f63099629115d3976860000c0a05c 100644 (file)
@@ -27,6 +27,8 @@ int _gnutls_dh_get_prime_bits( GNUTLS_STATE state);
 void gnutls_dh_set_prime_bits( GNUTLS_STATE state, int bits);
 void _gnutls_handshake_internal_state_clear( GNUTLS_STATE);
 
+int _gnutls_session_is_resumable( GNUTLS_STATE state);
+
 int _gnutls_openpgp_send_fingerprint( GNUTLS_STATE state);
 
 int _gnutls_PRF( const opaque * secret, int secret_size, const uint8 * label, int label_size, opaque * seed, int seed_size, int total_bytes, void* ret);
index a6894d1579ba7c337f5a351b57aa15c1bc6887b0..9bce05c51d0bbf3db892dcc05fae7202ec60df6d 100644 (file)
  *
  */
 
+/* This file was intended to contains functions to be exported in the
+ * API and did not fit elsewhere.
+ */
+
 #include <gnutls_int.h>
 #include <auth_srp.h>
 #include <auth_anon.h>
index 3f6ab174af6f6c9c6a49178cf2bf1ae7a9407ea6..32c473d343a70fdb0da4c7725c1e83dcf8b4f908 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions to parse the SSLv2.0 hello message.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_dh.h"
index 435b9b776c75b7a1560aad5ad1a6b9308f22302a..71af0f30dc34893cc9147964d1682571abeacd84 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions that relate to base64 encoding and decoding.
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include <gnutls_datum.h>
index 175c30bea142f97780af4c9f5c754f463e1f1e20..fc8eaa6255fed3ef20abd8706d2a1bf3e1527ab5 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions that relate to the X.509 extension parsing.
+ */
+
 #include <gnutls_int.h>
 #include <libtasn1.h>
 #include <gnutls_num.h>
index 3987e7684a9e18bd133a70919894815221cef170..b1982e65b829e5e397e57e7911cf51c9b295a874 100644 (file)
@@ -19,6 +19,9 @@
  *
  */
 
+/* Functions that relate to X.509 certificate signature checking.
+ */
+
 #include <gnutls_int.h>
 #include <gnutls_errors.h>
 #include <x509_b64.h>
index c352b0aa5f81cefcbed7edcc09e6c7eb9e4b54ff..b1685079f4fc70ac6f04e04d878157c877525b28 100644 (file)
  *
  */
 
+/* All functions which relate to X.509 certificate verification stuff are
+ * included here
+ */
+
 #include "gnutls_int.h"
 #include "gnutls_errors.h"
 #include "gnutls_cert.h"
index 9afa33cd0d6193028d641b358d4737cf3cab41f2..a8e1287664947f7644e8a714732f66dfb7032df6 100644 (file)
  */
 
 
+/* This file has the required functions to convert an X.509 DER certificate
+ * to XML format.
+ */
+
 #include <int.h>
 #include <errors.h>
 #include <structure.h>
@@ -201,9 +205,6 @@ _gnutls_asn1_get_structure_xml(ASN1_TYPE structure, const char *name,
                                        &structure);
        ret = _gnutls_x509_expand_extensions( &structure, name);
 
-//asn1_print_structure( stdout, structure, name, ASN1_PRINT_ALL);
-//return 0;
-////
        p = root;
        while (p) {