[gnutls-dev]const char* to gnutls.h

Timo Sirainen tss@iki.fi
Wed Jul 31 18:53:01 2002


--jq0ap7NbKX2Kqbes
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Currently there's char* parameters for setting x509 files. Annoying when I
use consts in my own code to pass the file names. Included patch to fix.

--jq0ap7NbKX2Kqbes
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="gnutls.diff"

diff -ru gnutls-0.5.1-old/includes/gnutls/gnutls.h gnutls-0.5.1/includes/gnutls/gnutls.h
--- gnutls-0.5.1-old/includes/gnutls/gnutls.h	2002-07-17 13:54:39.000000000 +0300
+++ gnutls-0.5.1/includes/gnutls/gnutls.h	2002-07-31 19:39:24.000000000 +0300
@@ -256,13 +256,13 @@
 
 int gnutls_certificate_set_dh_params(GNUTLS_CERTIFICATE_CREDENTIALS res, GNUTLS_DH_PARAMS);
 
-int gnutls_certificate_set_x509_trust_file( GNUTLS_CERTIFICATE_CREDENTIALS res, char* CAFILE, 
+int gnutls_certificate_set_x509_trust_file( GNUTLS_CERTIFICATE_CREDENTIALS res, const char* CAFILE,
 	GNUTLS_X509_CertificateFmt);
 int gnutls_certificate_set_x509_trust_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, 
 	const gnutls_datum *CA, GNUTLS_X509_CertificateFmt);
 
 int gnutls_certificate_set_x509_key_file( GNUTLS_CERTIFICATE_CREDENTIALS res, 
-	char *CERTFILE, char* KEYFILE, GNUTLS_X509_CertificateFmt);
+	const char* CERTFILE, const char* KEYFILE, GNUTLS_X509_CertificateFmt);
 int gnutls_certificate_set_x509_key_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, 
 	const gnutls_datum* CERT, const gnutls_datum* KEY,
 	GNUTLS_X509_CertificateFmt);
diff -ru gnutls-0.5.1-old/lib/gnutls_x509.c gnutls-0.5.1/lib/gnutls_x509.c
--- gnutls-0.5.1-old/lib/gnutls_x509.c	2002-07-13 00:12:30.000000000 +0300
+++ gnutls-0.5.1/lib/gnutls_x509.c	2002-07-31 19:38:21.000000000 +0300
@@ -1465,7 +1465,7 @@
 
 /* Reads a certificate file
  */
-static int read_cert_file(GNUTLS_CERTIFICATE_CREDENTIALS res, char *certfile,
+static int read_cert_file(GNUTLS_CERTIFICATE_CREDENTIALS res, const char *certfile,
 	GNUTLS_X509_CertificateFmt type)
 {
 	int siz;
@@ -1488,7 +1488,7 @@
 /* Reads a base64 encoded CA file (file contains multiple certificate
  * authorities). This is to be called once.
  */
-static int read_ca_file(GNUTLS_CERTIFICATE_CREDENTIALS res, char *cafile, 
+static int read_ca_file(GNUTLS_CERTIFICATE_CREDENTIALS res, const char *cafile,
 	GNUTLS_X509_CertificateFmt type)
 {
 	int siz;
@@ -1513,7 +1513,7 @@
 /* Reads PKCS-1 RSA private key file or a DSA file (in the format openssl
  * stores it).
  */
-static int read_key_file(GNUTLS_CERTIFICATE_CREDENTIALS res, char *keyfile,
+static int read_key_file(GNUTLS_CERTIFICATE_CREDENTIALS res, const char *keyfile,
 	GNUTLS_X509_CertificateFmt type)
 {
 	int siz;
@@ -1550,8 +1550,8 @@
   * this function.
   *
   **/
-int gnutls_certificate_set_x509_key_file(GNUTLS_CERTIFICATE_CREDENTIALS res, char *CERTFILE,
-			   char *KEYFILE, GNUTLS_X509_CertificateFmt type)
+int gnutls_certificate_set_x509_key_file(GNUTLS_CERTIFICATE_CREDENTIALS res, const char *CERTFILE,
+			   const char *KEYFILE, GNUTLS_X509_CertificateFmt type)
 {
 	int ret;
 
@@ -1661,7 +1661,7 @@
   *
   **/
 int gnutls_certificate_set_x509_trust_file(GNUTLS_CERTIFICATE_CREDENTIALS res, 
-		char *CAFILE, GNUTLS_X509_CertificateFmt type)
+		const char *CAFILE, GNUTLS_X509_CertificateFmt type)
 {
 	int ret, ret2;
 

--jq0ap7NbKX2Kqbes--