wmbiff: Fix compiler warnings from deprecated gnutls types.
This commit is contained in:
		
							parent
							
								
									ef5a71aa20
								
							
						
					
					
						commit
						5280405ca6
					
				
					 3 changed files with 22 additions and 22 deletions
				
			
		| 
						 | 
					@ -34,10 +34,10 @@ static const char *my_ctime(const time_t * tv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void print_x509_info(gnutls_session session, const char* hostname)
 | 
					void print_x509_info(gnutls_session_t session, const char* hostname)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	gnutls_x509_crt crt;
 | 
						gnutls_x509_crt_t crt;
 | 
				
			||||||
	const gnutls_datum *cert_list;
 | 
						const gnutls_datum_t *cert_list;
 | 
				
			||||||
	unsigned int cert_list_size = 0;
 | 
						unsigned int cert_list_size = 0;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	char digest[20];
 | 
						char digest[20];
 | 
				
			||||||
| 
						 | 
					@ -107,7 +107,7 @@ void print_x509_info(gnutls_session session, const char* hostname)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (xml) {
 | 
							if (xml) {
 | 
				
			||||||
#ifdef ENABLE_PKI
 | 
					#ifdef ENABLE_PKI
 | 
				
			||||||
			gnutls_datum xml_data;
 | 
								gnutls_datum_t xml_data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ret = gnutls_x509_crt_to_xml( crt, &xml_data, 0);
 | 
								ret = gnutls_x509_crt_to_xml( crt, &xml_data, 0);
 | 
				
			||||||
			if (ret < 0) {
 | 
								if (ret < 0) {
 | 
				
			||||||
| 
						 | 
					@ -200,7 +200,7 @@ void print_x509_info(gnutls_session session, const char* hostname)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef HAVE_LIBOPENCDK
 | 
					#ifdef HAVE_LIBOPENCDK
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void print_openpgp_info(gnutls_session session, const char* hostname)
 | 
					void print_openpgp_info(gnutls_session_t session, const char* hostname)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char digest[20];
 | 
						char digest[20];
 | 
				
			||||||
| 
						 | 
					@ -212,7 +212,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname)
 | 
				
			||||||
	char name[256];
 | 
						char name[256];
 | 
				
			||||||
	size_t name_len = sizeof(name);
 | 
						size_t name_len = sizeof(name);
 | 
				
			||||||
	gnutls_openpgp_key crt;
 | 
						gnutls_openpgp_key crt;
 | 
				
			||||||
	const gnutls_datum *cert_list;
 | 
						const gnutls_datum_t *cert_list;
 | 
				
			||||||
	unsigned int cert_list_size = 0;
 | 
						unsigned int cert_list_size = 0;
 | 
				
			||||||
	time_t expiret;
 | 
						time_t expiret;
 | 
				
			||||||
	time_t activet;
 | 
						time_t activet;
 | 
				
			||||||
| 
						 | 
					@ -259,7 +259,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (xml) {
 | 
							if (xml) {
 | 
				
			||||||
			gnutls_datum xml_data;
 | 
								gnutls_datum_t xml_data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			ret = gnutls_openpgp_key_to_xml( crt, &xml_data, 0);
 | 
								ret = gnutls_openpgp_key_to_xml( crt, &xml_data, 0);
 | 
				
			||||||
			if (ret < 0) {
 | 
								if (ret < 0) {
 | 
				
			||||||
| 
						 | 
					@ -332,7 +332,7 @@ void print_openpgp_info(gnutls_session session, const char* hostname)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void print_cert_vrfy(gnutls_session session)
 | 
					void print_cert_vrfy(gnutls_session_t session)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	unsigned int status;
 | 
						unsigned int status;
 | 
				
			||||||
| 
						 | 
					@ -369,11 +369,11 @@ void print_cert_vrfy(gnutls_session session)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int print_info(gnutls_session session, const char* hostname)
 | 
					int print_info(gnutls_session_t session, const char* hostname)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const char *tmp;
 | 
						const char *tmp;
 | 
				
			||||||
	gnutls_credentials_type cred;
 | 
						gnutls_credentials_type_t cred;
 | 
				
			||||||
	gnutls_kx_algorithm kx;
 | 
						gnutls_kx_algorithm_t kx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* print the key exchange's algorithm name
 | 
						/* print the key exchange's algorithm name
 | 
				
			||||||
| 
						 | 
					@ -454,7 +454,7 @@ int print_info(gnutls_session session, const char* hostname)
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void print_cert_info(gnutls_session session, const char* hostname)
 | 
					void print_cert_info(gnutls_session_t session, const char* hostname)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	printf("- Certificate type: ");
 | 
						printf("- Certificate type: ");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,8 +25,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const char str_unknown[];
 | 
					extern const char str_unknown[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int print_info( gnutls_session state, const char* hostname);
 | 
					int print_info( gnutls_session_t state, const char* hostname);
 | 
				
			||||||
void print_cert_info( gnutls_session state, const char* hostname);
 | 
					void print_cert_info( gnutls_session_t state, const char* hostname);
 | 
				
			||||||
void print_list(void);
 | 
					void print_list(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void parse_comp( char** comp, int ncomp, int* comp_priority);
 | 
					void parse_comp( char** comp, int ncomp, int* comp_priority);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,8 +58,8 @@ struct connection_state {
 | 
				
			||||||
	int sd;
 | 
						int sd;
 | 
				
			||||||
	char *name;
 | 
						char *name;
 | 
				
			||||||
#ifdef USE_GNUTLS
 | 
					#ifdef USE_GNUTLS
 | 
				
			||||||
	gnutls_session tls_state;
 | 
						gnutls_session_t tls_state;
 | 
				
			||||||
	gnutls_certificate_credentials xcred;
 | 
						gnutls_certificate_credentials_t xcred;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	/*@null@ */ void *tls_state;
 | 
						/*@null@ */ void *tls_state;
 | 
				
			||||||
	/*@null@ */ void *xcred;
 | 
						/*@null@ */ void *xcred;
 | 
				
			||||||
| 
						 | 
					@ -364,13 +364,13 @@ warn_certificate(const struct connection_state *scs, const char *msg)
 | 
				
			||||||
#define CERT_SEP "-----BEGIN"
 | 
					#define CERT_SEP "-----BEGIN"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* this bit is based on read_ca_file() in gnutls */
 | 
					/* this bit is based on read_ca_file() in gnutls */
 | 
				
			||||||
static int tls_compare_certificates(const gnutls_datum * peercert)
 | 
					static int tls_compare_certificates(const gnutls_datum_t * peercert)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	gnutls_datum cert;
 | 
						gnutls_datum_t cert;
 | 
				
			||||||
	unsigned char *ptr;
 | 
						unsigned char *ptr;
 | 
				
			||||||
	FILE *fd1;
 | 
						FILE *fd1;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	gnutls_datum b64_data;
 | 
						gnutls_datum_t b64_data;
 | 
				
			||||||
	unsigned char *b64_data_data;
 | 
						unsigned char *b64_data_data;
 | 
				
			||||||
	struct stat filestat;
 | 
						struct stat filestat;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -427,9 +427,9 @@ tls_check_certificate(struct connection_state *scs,
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	unsigned int certstat;
 | 
						unsigned int certstat;
 | 
				
			||||||
	const gnutls_datum *cert_list;
 | 
						const gnutls_datum_t *cert_list;
 | 
				
			||||||
	unsigned int cert_list_size = 0;
 | 
						unsigned int cert_list_size = 0;
 | 
				
			||||||
	gnutls_x509_crt cert;
 | 
						gnutls_x509_crt_t cert;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (gnutls_auth_get_type(scs->tls_state) != GNUTLS_CRD_CERTIFICATE) {
 | 
						if (gnutls_auth_get_type(scs->tls_state) != GNUTLS_CRD_CERTIFICATE) {
 | 
				
			||||||
		bad_certificate(scs, "Unable to get certificate from peer.\n");
 | 
							bad_certificate(scs, "Unable to get certificate from peer.\n");
 | 
				
			||||||
| 
						 | 
					@ -598,7 +598,7 @@ struct connection_state *initialize_gnutls(int sd, char *name, Pop3 pc,
 | 
				
			||||||
		gnutls_cred_set(scs->tls_state, GNUTLS_CRD_CERTIFICATE,
 | 
							gnutls_cred_set(scs->tls_state, GNUTLS_CRD_CERTIFICATE,
 | 
				
			||||||
						scs->xcred);
 | 
											scs->xcred);
 | 
				
			||||||
		gnutls_transport_set_ptr(scs->tls_state,
 | 
							gnutls_transport_set_ptr(scs->tls_state,
 | 
				
			||||||
								 (gnutls_transport_ptr) sd);
 | 
													 (gnutls_transport_ptr_t) sd);
 | 
				
			||||||
		do {
 | 
							do {
 | 
				
			||||||
			zok = gnutls_handshake(scs->tls_state);
 | 
								zok = gnutls_handshake(scs->tls_state);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue