tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jni/native/src sslinfo.c
Date Mon, 01 Aug 2005 07:23:10 GMT
mturk       2005/08/01 00:23:10

  Modified:    jni/java/org/apache/tomcat/jni SSL.java
               jni/native/include ssl_private.h
               jni/native/src sslinfo.c
  Log:
  Implement SSL_INFO_CLIENT_V_REMAIN cert info flag and call.
  
  Revision  Changes    Path
  1.23      +2 -1      jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/SSL.java
  
  Index: SSL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/java/org/apache/tomcat/jni/SSL.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- SSL.java	12 Jul 2005 14:56:09 -0000	1.22
  +++ SSL.java	1 Aug 2005 07:23:09 -0000	1.23
  @@ -195,6 +195,7 @@
       public static final int SSL_INFO_CLIENT_A_SIG              = 0x0105;
       public static final int SSL_INFO_CLIENT_A_KEY              = 0x0106;
       public static final int SSL_INFO_CLIENT_CERT               = 0x0107;
  +    public static final int SSL_INFO_CLIENT_V_REMAIN           = 0x0108;
   
       public static final int SSL_INFO_SERVER_M_VERSION          = 0x0201;
       public static final int SSL_INFO_SERVER_M_SERIAL           = 0x0202;
  
  
  
  1.35      +2 -1      jakarta-tomcat-connectors/jni/native/include/ssl_private.h
  
  Index: ssl_private.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/ssl_private.h,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- ssl_private.h	12 Jul 2005 14:56:10 -0000	1.34
  +++ ssl_private.h	1 Aug 2005 07:23:09 -0000	1.35
  @@ -178,6 +178,7 @@
   #define SSL_INFO_CLIENT_A_SIG               (0x0105)
   #define SSL_INFO_CLIENT_A_KEY               (0x0106)
   #define SSL_INFO_CLIENT_CERT                (0x0107)
  +#define SSL_INFO_CLIENT_V_REMAIN            (0x0108)
   
   #define SSL_INFO_SERVER_MASK                (0x0200)
   
  
  
  
  1.13      +19 -2     jakarta-tomcat-connectors/jni/native/src/sslinfo.c
  
  Index: sslinfo.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/src/sslinfo.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- sslinfo.c	1 Aug 2005 07:12:55 -0000	1.12
  +++ sslinfo.c	1 Aug 2005 07:23:09 -0000	1.13
  @@ -498,6 +498,7 @@
   {
       tcn_socket_t   *a = J2P(sock, tcn_socket_t *);
       tcn_ssl_conn_t *s;
  +    apr_status_t rv = APR_SUCCESS;
       jint value = -1;
   
       UNREFERENCED(o);
  @@ -528,10 +529,26 @@
           }
           break;
           default:
  -            tcn_ThrowAPRException(e, APR_EINVAL);
  +            rv = APR_EINVAL;
           break;
       }
  +    if (what & SSL_INFO_CLIENT_MASK) {
  +        X509 *xs;
  +        if ((xs = SSL_get_peer_certificate(s->ssl)) != NULL) {
  +            switch (what) {
  +                case SSL_INFO_CLIENT_V_REMAIN:
  +                    value = get_days_remaining(X509_get_notAfter(xs));
  +                    rv = APR_SUCCESS;
  +                break;
  +                default:
  +                    rv = APR_EINVAL;
  +                break;                    
  +           }
  +        }
  +    }
   
  +    if (rv != APR_SUCCESS)
  +        tcn_ThrowAPRException(e, rv);
       return value;
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message