]> git.pld-linux.org Git - packages/mysql.git/blob - mysql-ssl.patch
This commit was manufactured by cvs2git to create branch 'MYSQL_5_0'.
[packages/mysql.git] / mysql-ssl.patch
1 From: msvenssonDate: February 7 2008 8:48am
2 Subject: bk commit into 5.0 tree (msvensson:1.2573) BUG#33050
3
4 Below is the list of changes that have just been committed into a local
5 5.0 repository of msvensson.  When msvensson does a push these changes
6 will be propagated to the main repository and, within 24 hours after the
7 push, to the public repository.
8 For information on how to access the public repository
9 see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
10
11 ChangeSet@stripped, 2008-02-07 08:48:28+01:00, msvensson@stripped +1 -0
12   Bug#33050 5.0.50 fails many SSL testcases
13
14   vio/viossl.c@stripped, 2008-02-07 08:48:27+01:00, msvensson@stripped +21 -14
15     Bug#33050 5.0.50 fails many SSL testcases
16
17 diff -Nrup a/vio/viossl.c b/vio/viossl.c
18 --- a/vio/viossl.c      2007-08-28 11:34:42 +02:00
19 +++ b/vio/viossl.c      2008-02-07 08:48:27 +01:00
20 @@ -172,20 +172,15 @@ void vio_ssl_delete(Vio *vio)
21    vio_delete(vio);
22  }
23  
24 -int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
25 -{
26 -  DBUG_ENTER("sslaccept");
27 -  DBUG_RETURN(sslconnect(ptr, vio, timeout));
28 -}
29 -
30  
31 -int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
32 +static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout,
33 +                  int (*connect_accept_func)(SSL*))
34  {
35    SSL *ssl;
36    my_bool unused;
37    my_bool was_blocking;
38  
39 -  DBUG_ENTER("sslconnect");
40 +  DBUG_ENTER("ssl_do");
41    DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d  ctx: 0x%lx",
42                         (long) ptr, vio->sd, (long) ptr->ssl_context));
43  
44 @@ -204,13 +199,9 @@ int sslconnect(struct st_VioSSLFd *ptr, 
45    SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
46    SSL_set_fd(ssl, vio->sd);
47  
48 -  /*
49 -    SSL_do_handshake will select between SSL_connect
50 -    or SSL_accept depending on server or client side
51 -  */
52 -  if (SSL_do_handshake(ssl) < 1)
53 +  if (connect_accept_func(ssl) < 1)
54    {
55 -    DBUG_PRINT("error", ("SSL_do_handshake failure"));
56 +    DBUG_PRINT("error", ("SSL_connect/accept failure"));
57      report_errors(ssl);
58      SSL_free(ssl);
59      vio_blocking(vio, was_blocking, &unused);
60 @@ -259,6 +250,20 @@ int sslconnect(struct st_VioSSLFd *ptr, 
61  }
62  
63  
64 +int sslaccept(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
65 +{
66 +  DBUG_ENTER("sslaccept");
67 +  DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_accept));
68 +}
69 +
70 +
71 +int sslconnect(struct st_VioSSLFd *ptr, Vio *vio, long timeout)
72 +{
73 +  DBUG_ENTER("sslconnect");
74 +  DBUG_RETURN(ssl_do(ptr, vio, timeout, SSL_connect));
75 +}
76 +
77 +
78  int vio_ssl_blocking(Vio *vio __attribute__((unused)),
79                      my_bool set_blocking_mode,
80                      my_bool *old_mode)
81 @@ -268,5 +273,7 @@ int vio_ssl_blocking(Vio *vio __attribut
82    /* Return error if we try to change to non_blocking mode */
83    return (set_blocking_mode ? 0 : 1);
84  }
85 +
86 +
87  
88  #endif /* HAVE_OPENSSL */
This page took 0.030746 seconds and 3 git commands to generate.