]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Several (internal) cleanups. Const flags are better used now.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 30 Jun 2002 11:09:11 +0000 (11:09 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 30 Jun 2002 11:09:11 +0000 (11:09 +0000)
22 files changed:
lib/gnutls_alert.c
lib/gnutls_algorithms.c
lib/gnutls_algorithms.h
lib/gnutls_auth.h
lib/gnutls_cipher.c
lib/gnutls_compress_int.c
lib/gnutls_compress_int.h
lib/gnutls_errors.c
lib/gnutls_extensions.c
lib/gnutls_extensions.h
lib/gnutls_handshake.c
lib/gnutls_hash_int.c
lib/gnutls_hash_int.h
lib/gnutls_int.h
lib/gnutls_mpi.c
lib/gnutls_mpi.h
lib/gnutls_state.c
lib/gnutls_state.h
lib/gnutls_x509.c
lib/x509_extensions.c
lib/x509_extensions.h
lib/x509_xml.c

index db517545230e37f795cd10d8907d864bb5a7656b..c3f5d3fcd3c8cbaf64911862fae308eec06c86e8 100644 (file)
@@ -27,7 +27,7 @@
 
 typedef struct {
        AlertDescription alert;
-       char *desc;
+       const char *desc;
 } gnutls_alert_entry;
 
 static const gnutls_alert_entry sup_alerts[] = {
@@ -73,7 +73,7 @@ static const gnutls_alert_entry sup_alerts[] = {
   *
   **/
 const char* gnutls_alert_get_name( int alert) {
-char* ret = NULL;
+const char* ret = NULL;
 
        GNUTLS_ALERT_ID_LOOP( ret = p->desc);
 
index 67cc817dd1e535d5ae999fea9997435b1781ec3e..17d7e64e394ab49ed2c0cc01bc250db00cd6f988 100644 (file)
@@ -51,7 +51,7 @@ static const gnutls_cred_map cred_mappings[] = {
 /* TLS Versions */
 
 typedef struct {
-       char *name;
+       const char *name;
        GNUTLS_Version id;      /* gnutls internal version number */
        int major;              /* defined by the protocol */
        int minor;              /* defined by the protocol */
@@ -74,7 +74,7 @@ static const gnutls_version_entry sup_versions[] = {
 
 
 struct gnutls_cipher_entry {
-       char *name;
+       const char *name;
        BulkCipherAlgorithm id;
        size_t blocksize;
        size_t keysize;
@@ -107,7 +107,7 @@ static const gnutls_cipher_entry algorithms[] = {
 
 
 struct gnutls_hash_entry {
-       char *name;
+       const char *name;
        MACAlgorithm id;
        size_t digestsize;
 };
@@ -133,7 +133,7 @@ static const gnutls_hash_entry hash_algorithms[] = {
        { #name, name, id }
 
 struct gnutls_compression_entry {
-       char *name;
+       const char *name;
        CompressionMethod id;
        int num; /* the number reserved in TLS for the specific compression method */
 };
@@ -192,7 +192,7 @@ gnutls_kx_algo_entry _gnutls_kx_algorithms[MAX_KX_ALGOS] = {
        { #name, {name}, block_algorithm, kx_algorithm, mac_algorithm, version }
 
 typedef struct {
-       char *name;
+       const char *name;
        GNUTLS_CipherSuite id;
        BulkCipherAlgorithm block_algorithm;
        KXAlgorithm kx_algorithm;
@@ -424,7 +424,7 @@ inline int _gnutls_mac_priority(GNUTLS_STATE state, MACAlgorithm algorithm)
   **/
 const char *gnutls_mac_get_name( GNUTLS_MACAlgorithm algorithm)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_HASH_ALG_LOOP(ret =
@@ -471,7 +471,7 @@ inline
   **/
 const char *gnutls_compression_get_name( GNUTLS_CompressionMethod algorithm)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_COMPRESSION_ALG_LOOP(ret =
@@ -588,7 +588,7 @@ int _gnutls_cipher_get_iv_size(BulkCipherAlgorithm algorithm)
   **/
 const char *gnutls_cipher_get_name( GNUTLS_BulkCipherAlgorithm algorithm)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_ALG_LOOP(ret = p->name);
@@ -639,7 +639,7 @@ inline int _gnutls_kx_priority(GNUTLS_STATE state, KXAlgorithm algorithm)
   **/
 const char *gnutls_kx_get_name( GNUTLS_KXAlgorithm algorithm)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_KX_ALG_LOOP(ret = p->name);
@@ -725,7 +725,7 @@ GNUTLS_Version _gnutls_version_max(GNUTLS_STATE state)
   **/
 const char *gnutls_protocol_get_name( GNUTLS_Version version)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_VERSION_ALG_LOOP(ret =
@@ -831,7 +831,7 @@ _gnutls_cipher_suite_get_mac_algo(const GNUTLS_CipherSuite suite)
 
 const char *_gnutls_cipher_suite_get_name(GNUTLS_CipherSuite suite)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_CIPHER_SUITE_ALG_LOOP(ret =
@@ -845,7 +845,7 @@ inline
 static int _gnutls_cipher_suite_is_ok(GNUTLS_CipherSuite suite)
 {
        size_t ret;
-       char *name = NULL;
+       const char *name = NULL;
 
        GNUTLS_CIPHER_SUITE_ALG_LOOP(name = p->name);
        if (name != NULL)
@@ -936,20 +936,20 @@ _gnutls_compare_algo(GNUTLS_STATE state, const void *i_A1,
                     const void *i_A2)
 {
        KXAlgorithm kA1 =
-           _gnutls_cipher_suite_get_kx_algo(*(GNUTLS_CipherSuite *) i_A1);
+           _gnutls_cipher_suite_get_kx_algo(*(const GNUTLS_CipherSuite *) i_A1);
        KXAlgorithm kA2 =
-           _gnutls_cipher_suite_get_kx_algo(*(GNUTLS_CipherSuite *) i_A2);
+           _gnutls_cipher_suite_get_kx_algo(*(const GNUTLS_CipherSuite *) i_A2);
        BulkCipherAlgorithm cA1 =
-           _gnutls_cipher_suite_get_cipher_algo(*(GNUTLS_CipherSuite *)
+           _gnutls_cipher_suite_get_cipher_algo(*(const GNUTLS_CipherSuite *)
                                                 i_A1);
        BulkCipherAlgorithm cA2 =
-           _gnutls_cipher_suite_get_cipher_algo(*(GNUTLS_CipherSuite *)
+           _gnutls_cipher_suite_get_cipher_algo(*(const GNUTLS_CipherSuite *)
                                                 i_A2);
        MACAlgorithm mA1 =
-           _gnutls_cipher_suite_get_mac_algo(*(GNUTLS_CipherSuite *)
+           _gnutls_cipher_suite_get_mac_algo(*(const GNUTLS_CipherSuite *)
                                              i_A1);
        MACAlgorithm mA2 =
-           _gnutls_cipher_suite_get_mac_algo(*(GNUTLS_CipherSuite *)
+           _gnutls_cipher_suite_get_mac_algo(*(const GNUTLS_CipherSuite *)
                                              i_A2);
 
        int p1 = (_gnutls_kx_priority(state, kA1) + 1) * 64;
@@ -1163,7 +1163,7 @@ _gnutls_supported_compression_methods(GNUTLS_STATE state, uint8 ** comp)
   **/
 const char *gnutls_cert_type_get_name( GNUTLS_CertificateType type)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        if (type==GNUTLS_CRT_X509) ret = "X.509";
        if (type==GNUTLS_CRT_OPENPGP) ret = "OPENPGP";
index bc095369a150050ddaf156e7ae166950bc4f305a..4a5ae8e623bdab66a17ba6e4e24a2b2885e8b210 100644 (file)
@@ -76,7 +76,7 @@ KXAlgorithm _gnutls_map_kx_get_kx(CredType type);
 CredType _gnutls_map_kx_get_cred(KXAlgorithm algorithm);
 
 struct gnutls_kx_algo_entry {
-       char *name;
+       const char *name;
        KXAlgorithm algorithm;
        MOD_AUTH_STRUCT *auth_struct;
 };
index 2a9442ce53d87816942732fdf279ebd9c4b13abd..846b0816ee11bbb60a1e82c3501c650bfff52668 100644 (file)
@@ -2,7 +2,7 @@
 # define GNUTLS_AUTH_H
 
 typedef struct MOD_AUTH_STRUCT_INT {
-       char* name; /* null terminated */
+       const char* name; /* null terminated */
        int (*gnutls_generate_server_certificate)( GNUTLS_STATE, opaque**);
        int (*gnutls_generate_client_certificate)( GNUTLS_STATE, opaque**);
        int (*gnutls_generate_server_kx)( GNUTLS_STATE, opaque**);
index e234eb14830f6deb88d09cd883d31f898e93233e..25982edf2e55225c5512bb8096c341f00666ca69 100644 (file)
@@ -60,7 +60,7 @@ int _gnutls_encrypt(GNUTLS_STATE state, const char* headers, int headers_size,
                const char *data, size_t data_size,
                opaque * ciphertext, int ciphertext_size, ContentType type, int random_pad)
 {
-       gnutls_datum plain = { (char*)data, data_size };
+       const gnutls_datum plain = { data, data_size };
        gnutls_datum comp;
        int ret;
        int free_comp = 1;
@@ -69,6 +69,9 @@ int _gnutls_encrypt(GNUTLS_STATE state, const char* headers, int headers_size,
                comp = plain;
                free_comp = 0;
        } else {
+               /* Here comp is allocated and must be 
+                * freed.
+                */
                ret = _gnutls_m_plaintext2compressed(state, &comp, plain);
                if (ret < 0) {
                        gnutls_assert();
index b30b8611fd371af28e85c7da0a1ee950267d3398..30f39663cd77a4543cd27d42210c07ef76ea97e8 100644 (file)
@@ -85,6 +85,7 @@ int err;
                                        err = deflateEnd( handle->handle);
                                break;
 #endif
+                       default:
                }
                gnutls_free( handle->handle);
                gnutls_free( handle);
@@ -97,7 +98,7 @@ int err;
 /* These functions are memory consuming 
  */
 
-int _gnutls_compress( GNUTLS_COMP_HANDLE handle, char* plain, int plain_size, char** compressed, int max_comp_size) {
+int _gnutls_compress( GNUTLS_COMP_HANDLE handle, const char* plain, int plain_size, char** compressed, int max_comp_size) {
 int compressed_size=GNUTLS_E_COMPRESSION_FAILED;
 #ifdef HAVE_LIBZ
 uLongf size;
index 284e6a1479c97d0e858774403578547f9fb925f7..037771a62871a21950829f58dcf67f45f1964093 100644 (file)
@@ -36,6 +36,6 @@ GNUTLS_COMP_HANDLE _gnutls_comp_init( CompressionMethod, int d);
 void _gnutls_comp_deinit(GNUTLS_COMP_HANDLE handle, int d);
 
 int _gnutls_decompress( GNUTLS_COMP_HANDLE handle, char* compressed, int compressed_size, char** plain, int max_record_size);
-int _gnutls_compress( GNUTLS_COMP_HANDLE, char* plain, int plain_size, char** compressed, int max_comp_size);
+int _gnutls_compress( GNUTLS_COMP_HANDLE, const char* plain, int plain_size, char** compressed, int max_comp_size);
 
 #endif
index 074a69307eb09f351338bd90ab18558bad60cf76..0b91e5332d983a80e59c0d70ee9223132b5aee31 100644 (file)
@@ -33,7 +33,7 @@ extern void (*_gnutls_log_func)( const char*);
        { #name, name, fatal }
 
 struct gnutls_error_entry {
-       char *name;
+       const char *name;
        int  number;
        int  fatal;
 };
@@ -176,7 +176,7 @@ void gnutls_perror(int error)
   **/
 const char* gnutls_strerror(int error)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_ERROR_ALG_LOOP(ret =
index 2a85bd2837b21824ce0fdd0d3202c083f544fb68..37028d53e7445406fb3156fc3b070f6cbfeaf222 100644 (file)
@@ -67,7 +67,7 @@ void* _gnutls_ext_func_send(uint16 type)
 
 const char *_gnutls_extension_get_name(uint16 type)
 {
-       char *ret = NULL;
+       const char *ret = NULL;
 
        /* avoid prefix */
        GNUTLS_EXTENSION_LOOP(ret = p->name + sizeof("EXTENSION_") - 1);
index 30243f8ca66250544ef93386d8fce1b2b2c5385e..9c9fd5a23fbed51b9a37a433898c518503bea323 100644 (file)
@@ -27,7 +27,7 @@ int _gnutls_parse_extensions( GNUTLS_STATE, const opaque*, int);
 int _gnutls_gen_extensions( GNUTLS_STATE state, opaque** data);
 
 typedef struct {
-       char *name;
+       const char *name;
        uint16 type;
        int (*gnutls_ext_func_recv)( GNUTLS_STATE, const opaque*, int); /* recv data */
        int (*gnutls_ext_func_send)( GNUTLS_STATE, opaque*, int); /* send data */
index 533e57cd351c1cfb34ff4a1fb4524af453668be8..155985cd3d2c84a173b194012ceae35f6be53561 100644 (file)
@@ -134,7 +134,7 @@ static int _gnutls_ssl3_finished(GNUTLS_STATE state, int type, opaque * ret)
        const int siz = SSL_MSG_LEN;
        GNUTLS_MAC_HANDLE td_md5;
        GNUTLS_MAC_HANDLE td_sha;
-       char *mesg;
+       const opaque *mesg;
 
        td_md5 = _gnutls_hash_copy( state->gnutls_internals.handshake_mac_handle_md5);
        if (td_md5 == NULL) {
@@ -173,7 +173,7 @@ int _gnutls_finished(GNUTLS_STATE state, int type, void *ret)
 {
        const int siz = TLS_MSG_LEN;
        opaque concat[36];
-       opaque *mesg;
+       const opaque *mesg;
        GNUTLS_MAC_HANDLE td_md5;
        GNUTLS_MAC_HANDLE td_sha;
 
@@ -1985,6 +1985,7 @@ int gnutls_handshake_client(GNUTLS_STATE state)
                IMED_RET("send client certificate verify", ret);
 
                STATE = STATE0;
+       default:
        }
 
 
@@ -2038,6 +2039,7 @@ static int _gnutls_send_handshake_final(GNUTLS_STATE state, int init)
                }
 
                STATE = STATE0;
+       default:
        }
 
        return 0;
@@ -2091,6 +2093,7 @@ static int _gnutls_recv_handshake_final(GNUTLS_STATE state, int init)
                        return ret;
                }
                STATE = STATE0;
+       default:
        }
 
 
@@ -2205,6 +2208,7 @@ int gnutls_handshake_server(GNUTLS_STATE state)
                IMED_RET("recv client certificate verify", ret);
 
                STATE = STATE0; /* finished thus clear state */
+       default:
        }
 
        return 0;
index ba5abe8eba16b239025491db797308f4dba2b06d..c12ee544d8df1f4f4c93442624d0ed870ff3209d 100644 (file)
@@ -165,7 +165,7 @@ void _gnutls_hash_deinit(GNUTLS_HASH_HANDLE handle, void* digest)
 }
 
 
-GNUTLS_MAC_HANDLE _gnutls_hmac_init(MACAlgorithm algorithm, void *key,
+GNUTLS_MAC_HANDLE _gnutls_hmac_init(MACAlgorithm algorithm, const void *key,
                                   int keylen)
 {
        GNUTLS_MAC_HANDLE ret;
index f21b700769cab130a356403e9aadc24af2b8f9bf..9804f518027d5f6d6012e27892b864ccfe820398 100644 (file)
@@ -36,7 +36,7 @@ typedef struct {
        GCRY_MD_HD handle;
 #endif
        MACAlgorithm algorithm;
-       void* key;
+       const void* key;
        int keysize;
 } GNUTLS_MAC_HANDLE_INT;
 typedef GNUTLS_MAC_HANDLE_INT* GNUTLS_MAC_HANDLE;
@@ -45,7 +45,7 @@ typedef GNUTLS_MAC_HANDLE GNUTLS_HASH_HANDLE;
 #define GNUTLS_HASH_FAILED NULL
 #define GNUTLS_MAC_FAILED NULL
 
-GNUTLS_MAC_HANDLE _gnutls_hmac_init( MACAlgorithm algorithm, void* key, int keylen);
+GNUTLS_MAC_HANDLE _gnutls_hmac_init( MACAlgorithm algorithm, const void* key, int keylen);
 int _gnutls_hmac_get_algo_len(MACAlgorithm algorithm);
 int _gnutls_hmac(GNUTLS_MAC_HANDLE handle, const void* text, int textlen);
 void _gnutls_hmac_deinit( GNUTLS_MAC_HANDLE handle, void* digest);
index 75de28307213bd31524d1e738f28c4dc4f90d3e0..b957da7e0662f6783a1bbe7dbdc2f28e97664748 100644 (file)
@@ -26,7 +26,7 @@
 #include <defines.h>
 
 /*
-#define IO_DEBUG 3 // define this to check non blocking behaviour 
+#define IO_DEBUG 3 // define this to check non blocking behaviour
 #define BUFFERS_DEBUG
 #define HARD_DEBUG
 #define WRITE_DEBUG
index f08f08b5a2c10599a8a86863d99603f7a2376b39..f8e6e8c42746032df4b13e8a01a0d39bf90368de 100644 (file)
@@ -54,7 +54,7 @@ int _gnutls_mpi_print_lz( opaque *buffer, size_t *nbytes, const GNUTLS_MPI a ) {
  * from asn1 structs. Combines the read and mpi_scan
  * steps.
  */
-int _gnutls_x509_read_int( ASN1_TYPE node, char* value, char* tmpstr, int tmpstr_size, GNUTLS_MPI* ret_mpi) {
+int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, const char* tmpstr, int tmpstr_size, GNUTLS_MPI* ret_mpi) {
 int len, result;
 
        len = tmpstr_size - 1;
@@ -74,8 +74,8 @@ int len, result;
 
 /* front end for asn1_create_element.
  */
-asn1_retCode _gnutls_asn1_create_element(ASN1_TYPE definitions,char *source_name,
-                                 ASN1_TYPE *element, char *dest_name) {
+asn1_retCode _gnutls_asn1_create_element(ASN1_TYPE definitions,const char *source_name,
+                                 ASN1_TYPE *element, const char *dest_name) {
 
        *element = ASN1_TYPE_EMPTY;
        
index 0507454028fc3d4e6458305f3228f81a271df69e..2a04816b699318f909bd8800f8fcd6549a5cc4ee 100644 (file)
@@ -31,9 +31,9 @@ int _gnutls_mpi_scan_pgp( GNUTLS_MPI *ret_mpi, const opaque *buffer, size_t *nby
 int _gnutls_mpi_print( opaque *buffer, size_t *nbytes, const GNUTLS_MPI a );
 int _gnutls_mpi_print_lz( opaque *buffer, size_t *nbytes, const GNUTLS_MPI a );
 
-int _gnutls_x509_read_int( ASN1_TYPE node, char* value, char* tmpstr, int tmpstr_size, MPI* ret_mpi);
+int _gnutls_x509_read_int( ASN1_TYPE node, const char* value, const char* tmpstr, int tmpstr_size, MPI* ret_mpi);
 
-asn1_retCode _gnutls_asn1_create_element(ASN1_TYPE definitions,char *source_name,
-                                 ASN1_TYPE *element, char *dest_name);
+asn1_retCode _gnutls_asn1_create_element(ASN1_TYPE definitions,const char *source_name,
+                                 ASN1_TYPE *element, const char *dest_name);
 
 #endif
index 90861913025b7da30aadb4e12cdd1edaab8ac53f..314e85f4838b0a9e503e6ab4d48546a2399bd30f 100644 (file)
@@ -471,7 +471,7 @@ void gnutls_handshake_set_rsa_pms_check(GNUTLS_STATE state, int check)
 }
 
 inline
-static void _gnutls_cal_PRF_A( MACAlgorithm algorithm, void *secret, int secret_size, void *seed, int seed_size, void* result)
+static void _gnutls_cal_PRF_A( MACAlgorithm algorithm, const void *secret, int secret_size, const void *seed, int seed_size, void* result)
 {
        GNUTLS_MAC_HANDLE td1;
 
@@ -487,7 +487,7 @@ static void _gnutls_cal_PRF_A( MACAlgorithm algorithm, void *secret, int secret_
 /* Produces "total_bytes" bytes using the hash algorithm specified.
  * (used in the PRF function)
  */
-static int _gnutls_P_hash( MACAlgorithm algorithm, opaque * secret, int secret_size, opaque * seed, int seed_size, int total_bytes, opaque* ret)
+static int _gnutls_P_hash( MACAlgorithm algorithm, const opaque * secret, int secret_size, const opaque * seed, int seed_size, int total_bytes, opaque* ret)
 {
 
        GNUTLS_MAC_HANDLE td2;
@@ -565,10 +565,10 @@ int modlen = _length%sizeof(unsigned long int);
  * needed by the TLS specification. ret must have a least total_bytes
  * available.
  */
-int _gnutls_PRF( opaque * secret, int secret_size, uint8 * label, int label_size, opaque * seed, int seed_size, int total_bytes, void* ret)
+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)
 {
        int l_s, s_seed_size;
-       char *s1, *s2;
+       const char *s1, *s2;
        opaque s_seed[MAX_SEED_SIZE];
        opaque o1[MAX_PRF_BYTES], o2[MAX_PRF_BYTES];
        int result;
index 1303e3cd0d464a783ad78d67f94a40887bd41eac..3e87691f95218d634ba697f25a22249f6cdbd661 100644 (file)
@@ -29,6 +29,6 @@ void _gnutls_handshake_internal_state_clear( GNUTLS_STATE);
 
 int _gnutls_openpgp_send_fingerprint( GNUTLS_STATE state);
 
-int _gnutls_PRF( opaque * secret, int secret_size, uint8 * label, int label_size, opaque * seed, int seed_size, int total_bytes, void* ret);
+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);
 
 #define DEFAULT_CERT_TYPE GNUTLS_CRT_X509
index 8bef6c42eefce26316616bf5f3b0d1079582d7b5..cb35ce1b4a52b0aa43892ede0d602a900c2ba39a 100644 (file)
@@ -265,7 +265,7 @@ void _gnutls_int2str(unsigned int k, char *data)
  * (they're complex enough)
  * --nmav
  */
-int _gnutls_x509_get_name_type(ASN1_TYPE rasn, char *root, gnutls_DN * dn)
+int _gnutls_x509_get_name_type(ASN1_TYPE rasn, const char *root, gnutls_DN * dn)
 {
        int k, k2, result, len;
        char name[128], str[1024], name2[128], counter[MAX_INT_DIGITS],
@@ -349,7 +349,7 @@ int _gnutls_x509_get_name_type(ASN1_TYPE rasn, char *root, gnutls_DN * dn)
 
 
 #define MAX_TIME 1024
-time_t _gnutls_x509_get_time(ASN1_TYPE c2, char *root, char *when)
+time_t _gnutls_x509_get_time(ASN1_TYPE c2, const char *root, const char *when)
 {
        opaque ttime[MAX_TIME];
        char name[1024];
@@ -400,7 +400,7 @@ time_t _gnutls_x509_get_time(ASN1_TYPE c2, char *root, char *when)
        return ctime;
 }
 
-int _gnutls_x509_get_version(ASN1_TYPE c2, char *root)
+int _gnutls_x509_get_version(ASN1_TYPE c2, const char *root)
 {
        opaque gversion[5];
        char name[1024];
@@ -1101,7 +1101,7 @@ static int parse_der_cert_mem( gnutls_cert** cert_list, int* ncerts,
                return GNUTLS_E_MEMORY_ERROR;
        }
 
-       tmp.data = (opaque*) input_cert;
+       tmp.data = (opaque*)input_cert;
        tmp.size = input_cert_size;
 
        if ((ret =
index 2c388275515df2298363b7e2ce32008d6101d64d..175c30bea142f97780af4c9f5c754f463e1f1e20 100644 (file)
@@ -157,7 +157,7 @@ static int _parse_extension(gnutls_cert * cert, char *extnID,
  * If no_critical_ext is non zero, then unsupported critical extensions
  * do not lead into a fatal error.
  */
-int _gnutls_get_ext_type(ASN1_TYPE rasn, char *root, gnutls_cert * cert,
+int _gnutls_get_ext_type(ASN1_TYPE rasn, const char *root, gnutls_cert * cert,
        int no_critical_ext)
 {
        int k, result, len;
index 755f942cbb00693b6b76bfc8708f6cae6478dd37..fc80dcca80ac57b633ff03bf924a0cae805e9e0c 100644 (file)
@@ -1,2 +1,2 @@
-int _gnutls_get_ext_type( ASN1_TYPE rasn, char *root, gnutls_cert *cert, int no_critical_ext);
+int _gnutls_get_ext_type( ASN1_TYPE rasn, const char *root, gnutls_cert *cert, int no_critical_ext);
 int _gnutls_get_extension( const gnutls_datum * cert, const char* extension_id, gnutls_datum* ret);
index 09dc64745094256543e9293e59b7a9f1942812f0..f327bf97736901eae7b745ce41fb983e87908da4 100644 (file)
@@ -37,7 +37,7 @@
 
 static int _gnutls_x509_expand_extensions(ASN1_TYPE* rasn, const char *root);
 
-static void *find_default_value(ASN1_TYPE x)
+static const void *find_default_value(ASN1_TYPE x)
 {
        ASN1_TYPE p = x;
 
@@ -173,7 +173,7 @@ static int normalize_name( ASN1_TYPE p, char* output, int output_size)
 
 
 static int
-_gnutls_asn1_get_structure_xml(ASN1_TYPE structure, char *name,
+_gnutls_asn1_get_structure_xml(ASN1_TYPE structure, const char *name,
                         gnutls_datum * res)
 {
        node_asn *p, *root;
@@ -315,7 +315,7 @@ _gnutls_asn1_get_structure_xml(ASN1_TYPE structure, char *name,
                        STR_APPEND( ">");
 
                if (is_node_printable(p)) {
-                       unsigned char *value;
+                       const unsigned char *value;
 
                        if (p->value == NULL)
                                value = find_default_value(p);