[BACK]Return to s_client.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / openssl

Diff for /src/usr.bin/openssl/s_client.c between version 1.50 and 1.51

version 1.50, 2020/07/10 12:05:52 version 1.51, 2020/07/10 12:25:57
Line 171 
Line 171 
 #define BUFSIZZ 1024*8  #define BUFSIZZ 1024*8
   
 static void sc_usage(void);  static void sc_usage(void);
 static void print_stuff(BIO * berr, SSL * con, int full);  static void print_stuff(BIO *berr, SSL *con, int full);
 static int ocsp_resp_cb(SSL * s, void *arg);  static int ocsp_resp_cb(SSL *s, void *arg);
   static int ssl_servername_cb(SSL *s, int *ad, void *arg);
   
 enum {  enum {
         PROTO_OFF = 0,          PROTO_OFF = 0,
Line 184 
Line 185 
         PROTO_XMPP,          PROTO_XMPP,
 };  };
   
   /* This is a context that we pass to callbacks */
   typedef struct tlsextctx_st {
           BIO *biodebug;
           int ack;
   } tlsextctx;
   
 static struct {  static struct {
         int af;          int af;
         char *alpn_in;          char *alpn_in;
Line 839 
Line 846 
         fprintf(stderr, "\n");          fprintf(stderr, "\n");
 }  }
   
 /* This is a context that we pass to callbacks */  
 typedef struct tlsextctx_st {  
         BIO *biodebug;  
         int ack;  
 } tlsextctx;  
   
 static int  
 ssl_servername_cb(SSL * s, int *ad, void *arg)  
 {  
         tlsextctx *p = (tlsextctx *) arg;  
         const char *hn = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);  
         if (SSL_get_servername_type(s) != -1)  
                 p->ack = !SSL_session_reused(s) && hn != NULL;  
         else  
                 BIO_printf(bio_err, "Can't use SSL_get_servername\n");  
   
         return SSL_TLSEXT_ERR_OK;  
 }  
   
 int  int
 s_client_main(int argc, char **argv)  s_client_main(int argc, char **argv)
 {  {
Line 1626 
Line 1614 
 }  }
   
 static void  static void
 print_stuff(BIO * bio, SSL * s, int full)  print_stuff(BIO *bio, SSL *s, int full)
 {  {
         X509 *peer = NULL;          X509 *peer = NULL;
         char *p;          char *p;
         static const char *space = "                ";          static const char *space = "                ";
         char buf[BUFSIZ];          char buf[BUFSIZ];
         STACK_OF(X509) * sk;          STACK_OF(X509) *sk;
         STACK_OF(X509_NAME) * sk2;          STACK_OF(X509_NAME) *sk2;
         const SSL_CIPHER *c;          const SSL_CIPHER *c;
         X509_NAME *xn;          X509_NAME *xn;
         int j, i;          int j, i;
Line 1814 
Line 1802 
 }  }
   
 static int  static int
 ocsp_resp_cb(SSL * s, void *arg)  ocsp_resp_cb(SSL *s, void *arg)
 {  {
         const unsigned char *p;          const unsigned char *p;
         int len;          int len;
Line 1836 
Line 1824 
         BIO_puts(arg, "======================================\n");          BIO_puts(arg, "======================================\n");
         OCSP_RESPONSE_free(rsp);          OCSP_RESPONSE_free(rsp);
         return 1;          return 1;
   }
   
   static int
   ssl_servername_cb(SSL *s, int *ad, void *arg)
   {
           tlsextctx *p = (tlsextctx *) arg;
           const char *hn = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name);
           if (SSL_get_servername_type(s) != -1)
                   p->ack = !SSL_session_reused(s) && hn != NULL;
           else
                   BIO_printf(bio_err, "Can't use SSL_get_servername\n");
   
           return SSL_TLSEXT_ERR_OK;
 }  }
   

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51