Changeset 31645b2 in mod_gnutls for src/gnutls_io.c


Ignore:
Timestamp:
Apr 21, 2005, 1:15:56 PM (15 years ago)
Author:
Paul Querna <chip@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, upstream
Children:
e924ddd
Parents:
0475f1bc
Message:

working SNI. Not so working Client Cert support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_io.c

    r0475f1bc r31645b2  
    354354}
    355355
    356 
    357 static void gnutls_do_handshake(mod_gnutls_handle_t * ctxt)
     356static int gnutls_do_handshake(mod_gnutls_handle_t * ctxt)
    358357{
    359358    int ret;
    360359    int errcode;
    361360    if (ctxt->status != 0) {
    362         return;
     361        return 0;
    363362    }
    364363
     
    389388                          gnutls_error_to_alert(ret, NULL));
    390389        gnutls_deinit(ctxt->session);
    391         return;
     390        return ret;
    392391    }
    393392    else {
     393        /* all done with the handshake */
    394394        ctxt->status = 1;
    395         return;             /* all done with the handshake */
     395        return ret;
     396    }
     397}
     398
     399int mod_gnutls_rehandshake(mod_gnutls_handle_t * ctxt)
     400{
     401    int rv;
     402
     403    rv = gnutls_rehandshake(ctxt->session);
     404   
     405    if (rv != 0) {
     406        /* the client did not want to rehandshake. goodbye */
     407        ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctxt->c->base_server,
     408                     "GnuTLS: Client Refused Rehandshake request.");
     409        return -1;
     410    }
     411   
     412    ctxt->status = 0;
     413
     414    gnutls_do_handshake(ctxt);
     415   
     416    if (ctxt->status == 1) {
     417        return 0;
     418    }
     419    else {
     420        return -1;
    396421    }
    397422}
     
    415440
    416441    if (ctxt->status == 0) {
    417         char* server_name;
    418         int server_type;
    419         int data_len = 256;
    420        
    421442        gnutls_do_handshake(ctxt);
    422        
    423         /**
    424          * Due to issues inside the GnuTLS API, we cannot currently do TLS 1.1
    425          * Server Name Indication.
    426          */
    427         server_name = apr_palloc(ctxt->c->pool, data_len);
    428         if (gnutls_server_name_get(ctxt->session, server_name, &data_len, &server_type, 0) == 0) {
    429             if (server_type == GNUTLS_NAME_DNS) {
    430                 ap_log_error(APLOG_MARK, APLOG_DEBUG, 0,
    431                              ctxt->c->base_server,
    432                              "GnuTLS: TLS 1.1 Server Name: "
    433                              "%s", server_name);
    434                
    435             }
    436         }
    437443    }
    438444
Note: See TracChangeset for help on using the changeset viewer.