Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2db2a22c
Commit
2db2a22c
authored
Jun 08, 2001
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge tonu@work.mysql.com:/home/bk/mysql-4.0
into hundin.mysql.fi:/home/tonu/mysql-4.0
parents
9cda81a4
32692277
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
29 deletions
+33
-29
include/violite.h
include/violite.h
+8
-6
vio/viossl.c
vio/viossl.c
+23
-21
vio/viosslfactories.c
vio/viosslfactories.c
+2
-2
No files found.
include/violite.h
View file @
2db2a22c
...
@@ -35,6 +35,10 @@ extern "C" {
...
@@ -35,6 +35,10 @@ extern "C" {
enum
enum_vio_type
{
VIO_CLOSED
,
VIO_TYPE_TCPIP
,
VIO_TYPE_SOCKET
,
enum
enum_vio_type
{
VIO_CLOSED
,
VIO_TYPE_TCPIP
,
VIO_TYPE_SOCKET
,
VIO_TYPE_NAMEDPIPE
,
VIO_TYPE_SSL
};
VIO_TYPE_NAMEDPIPE
,
VIO_TYPE_SSL
};
#ifndef __WIN__
#define HANDLE void *
#endif
Vio
*
vio_new
(
my_socket
sd
,
Vio
*
vio_new
(
my_socket
sd
,
enum
enum_vio_type
type
,
enum
enum_vio_type
type
,
my_bool
localhost
);
my_bool
localhost
);
...
@@ -45,6 +49,10 @@ void vio_delete(Vio* vio);
...
@@ -45,6 +49,10 @@ void vio_delete(Vio* vio);
#ifdef EMBEDDED_LIBRARY
#ifdef EMBEDDED_LIBRARY
void
vio_reset
(
Vio
*
vio
);
void
vio_reset
(
Vio
*
vio
);
#else
void
vio_reset
(
Vio
*
vio
,
enum
enum_vio_type
type
,
my_socket
sd
,
HANDLE
hPipe
,
my_bool
localhost
);
#endif
#endif
/*
/*
...
@@ -188,8 +196,6 @@ struct st_VioSSLAcceptorFd
...
@@ -188,8 +196,6 @@ struct st_VioSSLAcceptorFd
/* One copy for client */
/* One copy for client */
struct
st_VioSSLConnectorFd
struct
st_VioSSLConnectorFd
{
{
BIO
*
bio_
;
gptr
ssl_
;
SSL_CTX
*
ssl_context_
;
SSL_CTX
*
ssl_context_
;
SSL_METHOD
*
ssl_method_
;
SSL_METHOD
*
ssl_method_
;
/* function pointers which are only once for SSL client */
/* function pointers which are only once for SSL client */
...
@@ -212,10 +218,6 @@ Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state);
...
@@ -212,10 +218,6 @@ Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state);
#endif
#endif
#endif
/* HAVE_OPENSSL */
#endif
/* HAVE_OPENSSL */
#ifndef __WIN__
#define HANDLE void *
#endif
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
/* This structure is for every connection on both sides */
/* This structure is for every connection on both sides */
struct
st_vio
struct
st_vio
...
...
vio/viossl.c
View file @
2db2a22c
...
@@ -63,6 +63,26 @@
...
@@ -63,6 +63,26 @@
#ifdef HAVE_OPENSSL
#ifdef HAVE_OPENSSL
static
void
report_errors
()
{
unsigned
long
l
;
const
char
*
file
;
const
char
*
data
;
int
line
,
flags
;
DBUG_ENTER
(
"report_errors"
);
while
((
l
=
ERR_get_error_line_data
(
&
file
,
&
line
,
&
data
,
&
flags
))
!=
0
)
{
char
buf
[
200
];
DBUG_PRINT
(
"error"
,
(
"OpenSSL: %s:%s:%d:%s
\n
"
,
ERR_error_string
(
l
,
buf
),
file
,
line
,(
flags
&
ERR_TXT_STRING
)
?
data
:
""
))
;
}
DBUG_VOID_RETURN
;
}
void
vio_ssl_delete
(
Vio
*
vio
)
void
vio_ssl_delete
(
Vio
*
vio
)
{
{
/* It must be safe to delete null pointers. */
/* It must be safe to delete null pointers. */
...
@@ -266,24 +286,6 @@ my_bool vio_ssl_poll_read(Vio *vio,uint timeout)
...
@@ -266,24 +286,6 @@ my_bool vio_ssl_poll_read(Vio *vio,uint timeout)
}
}
static
void
report_errors
()
{
unsigned
long
l
;
const
char
*
file
;
const
char
*
data
;
int
line
,
flags
;
DBUG_ENTER
(
"report_errors"
);
while
((
l
=
ERR_get_error_line_data
(
&
file
,
&
line
,
&
data
,
&
flags
))
!=
0
)
{
char
buf
[
200
];
DBUG_PRINT
(
"error"
,
(
"OpenSSL: %s:%s:%d:%s
\n
"
,
ERR_error_string
(
l
,
buf
),
file
,
line
,(
flags
&
ERR_TXT_STRING
)
?
data
:
""
))
;
}
DBUG_VOID_RETURN
;
}
/* FIXME: There are some duplicate code in
/* FIXME: There are some duplicate code in
* sslaccept()/sslconnect() which maybe can be eliminated
* sslaccept()/sslconnect() which maybe can be eliminated
*/
*/
...
@@ -326,7 +328,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd)
...
@@ -326,7 +328,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd)
DBUG_PRINT
(
"enter"
,
(
"sd=%s ptr=%p ctx: %p"
,
sd
->
desc
,
ptr
,
ptr
->
ssl_context_
));
DBUG_PRINT
(
"enter"
,
(
"sd=%s ptr=%p ctx: %p"
,
sd
->
desc
,
ptr
,
ptr
->
ssl_context_
));
vio_reset
(
sd
,
VIO_TYPE_SSL
,
sd
->
sd
,
0
,
FALSE
);
vio_reset
(
sd
,
VIO_TYPE_SSL
,
sd
->
sd
,
0
,
FALSE
);
ptr
->
bio_
=
0
;
sd
->
bio_
=
0
;
sd
->
ssl_
=
0
;
sd
->
ssl_
=
0
;
sd
->
open_
=
FALSE
;
sd
->
open_
=
FALSE
;
assert
(
sd
!=
0
);
assert
(
sd
!=
0
);
...
@@ -339,7 +341,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd)
...
@@ -339,7 +341,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd)
report_errors
();
report_errors
();
DBUG_RETURN
(
sd
);
DBUG_RETURN
(
sd
);
}
}
if
(
!
(
ptr
->
bio_
=
BIO_new_socket
(
sd
->
sd
,
BIO_NOCLOSE
)))
if
(
!
(
sd
->
bio_
=
BIO_new_socket
(
sd
->
sd
,
BIO_NOCLOSE
)))
{
{
DBUG_PRINT
(
"error"
,
(
"BIO_new_socket failure"
));
DBUG_PRINT
(
"error"
,
(
"BIO_new_socket failure"
));
report_errors
();
report_errors
();
...
@@ -347,7 +349,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd)
...
@@ -347,7 +349,7 @@ Vio *sslconnect(struct st_VioSSLConnectorFd* ptr, Vio* sd)
sd
->
ssl_
=
0
;
sd
->
ssl_
=
0
;
DBUG_RETURN
(
sd
);
DBUG_RETURN
(
sd
);
}
}
SSL_set_bio
(
sd
->
ssl_
,
ptr
->
bio_
,
ptr
->
bio_
);
SSL_set_bio
(
sd
->
ssl_
,
sd
->
bio_
,
sd
->
bio_
);
SSL_set_connect_state
(
sd
->
ssl_
);
SSL_set_connect_state
(
sd
->
ssl_
);
/* sprintf(ptr->desc_, "VioSSL(%d)", sd->sd);
/* sprintf(ptr->desc_, "VioSSL(%d)", sd->sd);
sd->ssl_cip_ = SSL_get_cipher(sd->ssl_);*/
sd->ssl_cip_ = SSL_get_cipher(sd->ssl_);*/
...
...
vio/viosslfactories.c
View file @
2db2a22c
...
@@ -186,7 +186,7 @@ struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file,
...
@@ -186,7 +186,7 @@ struct st_VioSSLConnectorFd* new_VioSSLConnectorFd(const char* key_file,
DBUG_RETURN
(
ptr
);
DBUG_RETURN
(
ptr
);
ctor_failure:
ctor_failure:
DBUG_PRINT
(
"exit"
,
(
"there was an error"
));
DBUG_PRINT
(
"exit"
,
(
"there was an error"
));
DBUG_
VOID_RETURN
;
DBUG_
RETURN
(
0
)
;
}
}
...
@@ -267,7 +267,7 @@ new_VioSSLAcceptorFd(const char* key_file,
...
@@ -267,7 +267,7 @@ new_VioSSLAcceptorFd(const char* key_file,
DBUG_RETURN
(
ptr
);
DBUG_RETURN
(
ptr
);
ctor_failure:
ctor_failure:
DBUG_PRINT
(
"exit"
,
(
"there was an error"
));
DBUG_PRINT
(
"exit"
,
(
"there was an error"
));
DBUG_
VOID_RETURN
;
DBUG_
RETURN
(
0
)
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment