Changeset 2ad3683 in mod_gnutls for src


Ignore:
Timestamp:
Apr 24, 2005, 7:51:47 PM (15 years ago)
Author:
Paul Querna <chip@…>
Branches:
debian/master, debian/stretch-backports, jessie-backports, master, msva, upstream
Children:
38435cc
Parents:
46e3920
Message:

We already have a Certificate, use it directly. With SNI, GnuTLS doesn't properly update it's internal state. ick.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gnutls_hooks.c

    r46e3920 r2ad3683  
    525525    int len;
    526526    mgs_handle_t *ctxt;
    527     int rv;
     527    int rv = OK;
    528528   
    529529    apr_table_t *env = r->subprocess_env;
     
    562562    /* TODO: There are many other env vars that we need to add */
    563563    {
    564         const gnutls_datum *certs;
    565         gnutls_x509_crt cert;
    566 
    567         certs = gnutls_certificate_get_ours(ctxt->session);
    568         if (certs) {
    569 
    570             rv = gnutls_x509_crt_init(&cert);
    571             if (rv < 0) {
    572                 goto end_fixups;
    573             }
    574            
    575             rv = gnutls_x509_crt_import(cert, &certs[0], GNUTLS_X509_FMT_DER);
    576             if (rv < 0) {
    577                 gnutls_x509_crt_deinit(cert);
    578                 goto end_fixups;
    579             }
    580            
    581             len = sizeof(buf);
    582             gnutls_x509_crt_get_dn(cert, buf, &len);
    583             apr_table_setn(env, "SSL_SERVER_S_DN", buf);
    584            
    585             len = sizeof(buf);
    586             gnutls_x509_crt_get_issuer_dn(cert, buf, &len);
    587             apr_table_setn(env, "SSL_SERVER_I_DN", buf);
    588            
    589             gnutls_x509_crt_deinit(cert);
    590         }
    591         else {
    592             apr_table_setn(env, "SSL_SERVER_S_DN", "Unknown");
    593             apr_table_setn(env, "SSL_SERVER_I_DN", "Unknown");
    594         }
    595     }
    596    
    597 end_fixups:
    598     return OK;
     564        len = sizeof(buf);
     565        gnutls_x509_crt_get_dn(ctxt->sc->cert_x509, buf, &len);
     566        apr_table_setn(env, "SSL_SERVER_S_DN", buf);
     567           
     568        len = sizeof(buf);
     569        gnutls_x509_crt_get_issuer_dn(ctxt->sc->cert_x509, buf, &len);
     570        apr_table_setn(env, "SSL_SERVER_I_DN", buf);
     571    }
     572   
     573    return rv;
    599574}
    600575
Note: See TracChangeset for help on using the changeset viewer.