X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftcpip.c;h=fcdcce12a695d74c1635d65491f4fbe70700b9c7;hb=bc384649b00fed1e378ac3f67b8b5e4872892942;hp=b948603d2620c3e3d7f136f2ff4d86d307074768;hpb=f8d2abd0349cdff6c9bcf41937cd1dfd5de54ed2;p=yaz-moved-to-github.git diff --git a/src/tcpip.c b/src/tcpip.c index b948603..fcdcce1 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -260,7 +260,7 @@ COMSTACK yaz_tcpip_create(int s, int flags, int protocol, static void tcpip_create_cred(COMSTACK cs) { tcpip_state *sp = (tcpip_state *) cs->cprivate; - sp->cred_ptr = xmalloc(sizeof(*sp->cred_ptr)); + sp->cred_ptr = (struct tcpip_cred_ptr *) xmalloc(sizeof(*sp->cred_ptr)); sp->cred_ptr->ref = 1; gnutls_certificate_allocate_credentials(&sp->cred_ptr->xcred); } @@ -599,7 +599,7 @@ int tcpip_rcvconnect(COMSTACK h) tcpip_create_cred(h); gnutls_init(&sp->session, GNUTLS_CLIENT); - gnutls_priority_set_direct(sp->session, "PERFORMANCE", NULL); + gnutls_set_default_priority(sp->session); gnutls_credentials_set (sp->session, GNUTLS_CRD_CERTIFICATE, sp->cred_ptr->xcred); @@ -938,8 +938,7 @@ COMSTACK tcpip_accept(COMSTACK h) xfree(state); return 0; } - res = gnutls_priority_set_direct(state->session, - "PERFORMANCE", NULL); + res = gnutls_set_default_priority(state->session); if (res != GNUTLS_E_SUCCESS) { xfree(cnew); @@ -1497,7 +1496,7 @@ char *tcpip_addrstr(COMSTACK h) return buf; } -int static tcpip_set_blocking(COMSTACK p, int flags) +static int tcpip_set_blocking(COMSTACK p, int flags) { unsigned long flag; @@ -1572,9 +1571,9 @@ void *cs_get_ssl(COMSTACK cs) #endif } -#if ENABLE_SSL int cs_set_ssl_ctx(COMSTACK cs, void *ctx) { +#if ENABLE_SSL struct tcpip_state *sp; if (!cs || cs->type != ssl_type) return 0; @@ -1585,10 +1584,14 @@ int cs_set_ssl_ctx(COMSTACK cs, void *ctx) sp->ctx = (SSL_CTX *) ctx; #endif return 1; +#else + return 0; +#endif } int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname) { +#if ENABLE_SSL struct tcpip_state *sp; if (!cs || cs->type != ssl_type) return 0; @@ -1596,6 +1599,9 @@ int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname) strncpy(sp->cert_fname, fname, sizeof(sp->cert_fname)-1); sp->cert_fname[sizeof(sp->cert_fname)-1] = '\0'; return 1; +#else + return 0; +#endif } int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len) @@ -1621,23 +1627,6 @@ int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len) #endif return 0; } -#else -int cs_set_ssl_ctx(COMSTACK cs, void *ctx) -{ - return 0; -} - -int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len) -{ - return 0; -} - -int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname) -{ - return 0; -} -#endif - static int tcpip_put_connect(COMSTACK h, char *buf, int size) {