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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e4676ef6
Commit
e4676ef6
authored
Sep 27, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import yaSSL version 1.4.3
parent
64a64d0f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
41 deletions
+72
-41
extra/yassl/examples/echoserver/echoserver.cpp
extra/yassl/examples/echoserver/echoserver.cpp
+17
-24
extra/yassl/examples/server/server.cpp
extra/yassl/examples/server/server.cpp
+12
-15
extra/yassl/include/openssl/ssl.h
extra/yassl/include/openssl/ssl.h
+1
-1
extra/yassl/src/template_instnt.cpp
extra/yassl/src/template_instnt.cpp
+1
-0
extra/yassl/taocrypt/src/crypto.cpp
extra/yassl/taocrypt/src/crypto.cpp
+39
-0
extra/yassl/taocrypt/src/misc.cpp
extra/yassl/taocrypt/src/misc.cpp
+1
-0
extra/yassl/testsuite/test.hpp
extra/yassl/testsuite/test.hpp
+1
-1
No files found.
extra/yassl/examples/echoserver/echoserver.cpp
View file @
e4676ef6
...
...
@@ -23,6 +23,18 @@
#endif // NO_MAIN_DRIVER
void
EchoError
(
SSL_CTX
*
ctx
,
SSL
*
ssl
,
SOCKET_T
&
s1
,
SOCKET_T
&
s2
,
const
char
*
msg
)
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
s1
);
tcp_close
(
s2
);
err_sys
(
msg
);
}
THREAD_RETURN
YASSL_API
echoserver_test
(
void
*
args
)
{
#ifdef _WIN32
...
...
@@ -65,10 +77,9 @@ THREAD_RETURN YASSL_API echoserver_test(void* args)
while
(
!
shutdown
)
{
sockaddr_in
client
;
socklen_t
client_len
=
sizeof
(
client
);
int
clientfd
=
accept
(
sockfd
,
(
sockaddr
*
)
&
client
,
SOCKET_T
clientfd
=
accept
(
sockfd
,
(
sockaddr
*
)
&
client
,
(
ACCEPT_THIRD_T
)
&
client_len
);
if
(
clientfd
==
-
1
)
{
if
(
clientfd
==
-
1
)
{
SSL_CTX_free
(
ctx
);
tcp_close
(
sockfd
);
err_sys
(
"tcp accept failed"
);
...
...
@@ -77,13 +88,7 @@ THREAD_RETURN YASSL_API echoserver_test(void* args)
SSL
*
ssl
=
SSL_new
(
ctx
);
SSL_set_fd
(
ssl
,
clientfd
);
if
(
SSL_accept
(
ssl
)
!=
SSL_SUCCESS
)
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
sockfd
);
tcp_close
(
clientfd
);
err_sys
(
"SSL_accept failed"
);
}
EchoError
(
ctx
,
ssl
,
sockfd
,
clientfd
,
"SSL_accept failed"
);
char
command
[
1024
];
int
echoSz
(
0
);
...
...
@@ -112,13 +117,7 @@ THREAD_RETURN YASSL_API echoserver_test(void* args)
echoSz
+=
sizeof
(
footer
);
if
(
SSL_write
(
ssl
,
command
,
echoSz
)
!=
echoSz
)
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
sockfd
);
tcp_close
(
clientfd
);
err_sys
(
"SSL_write failed"
);
}
EchoError
(
ctx
,
ssl
,
sockfd
,
clientfd
,
"SSL_write failed"
);
break
;
}
...
...
@@ -129,13 +128,7 @@ THREAD_RETURN YASSL_API echoserver_test(void* args)
#endif
if
(
SSL_write
(
ssl
,
command
,
echoSz
)
!=
echoSz
)
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
sockfd
);
tcp_close
(
clientfd
);
err_sys
(
"SSL_write failed"
);
}
EchoError
(
ctx
,
ssl
,
sockfd
,
clientfd
,
"SSL_write failed"
);
}
SSL_free
(
ssl
);
tcp_close
(
clientfd
);
...
...
extra/yassl/examples/server/server.cpp
View file @
e4676ef6
...
...
@@ -4,6 +4,15 @@
#include "../../testsuite/test.hpp"
void
ServerError
(
SSL_CTX
*
ctx
,
SSL
*
ssl
,
SOCKET_T
&
sockfd
,
const
char
*
msg
)
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
sockfd
);
err_sys
(
msg
);
}
THREAD_RETURN
YASSL_API
server_test
(
void
*
args
)
{
#ifdef _WIN32
...
...
@@ -12,7 +21,7 @@ THREAD_RETURN YASSL_API server_test(void* args)
#endif
SOCKET_T
sockfd
=
0
;
int
clientfd
=
0
;
SOCKET_T
clientfd
=
0
;
int
argc
=
0
;
char
**
argv
=
0
;
...
...
@@ -33,13 +42,7 @@ THREAD_RETURN YASSL_API server_test(void* args)
SSL_set_fd
(
ssl
,
clientfd
);
if
(
SSL_accept
(
ssl
)
!=
SSL_SUCCESS
)
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
sockfd
);
tcp_close
(
clientfd
);
err_sys
(
"SSL_accept failed"
);
}
ServerError
(
ctx
,
ssl
,
clientfd
,
"SSL_accept failed"
);
showPeer
(
ssl
);
printf
(
"Using Cipher Suite: %s
\n
"
,
SSL_get_cipher
(
ssl
));
...
...
@@ -50,13 +53,7 @@ THREAD_RETURN YASSL_API server_test(void* args)
char
msg
[]
=
"I hear you, fa shizzle!"
;
if
(
SSL_write
(
ssl
,
msg
,
sizeof
(
msg
))
!=
sizeof
(
msg
))
{
SSL_CTX_free
(
ctx
);
SSL_free
(
ssl
);
tcp_close
(
sockfd
);
tcp_close
(
clientfd
);
err_sys
(
"SSL_write failed"
);
}
ServerError
(
ctx
,
ssl
,
clientfd
,
"SSL_write failed"
);
DH_free
(
dh
);
SSL_CTX_free
(
ctx
);
...
...
extra/yassl/include/openssl/ssl.h
View file @
e4676ef6
...
...
@@ -41,7 +41,7 @@
#include "rsa.h"
#define YASSL_VERSION "1.4.
2
"
#define YASSL_VERSION "1.4.
3
"
#if defined(__cplusplus)
...
...
extra/yassl/src/template_instnt.cpp
View file @
e4676ef6
...
...
@@ -109,6 +109,7 @@ template void ysArrayDelete<char>(char*);
template
int
min
<
int
>(
int
,
int
);
template
unsigned
int
min
<
unsigned
int
>(
unsigned
int
,
unsigned
int
);
template
unsigned
long
min
<
unsigned
long
>(
unsigned
long
,
unsigned
long
);
}
#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
...
...
extra/yassl/taocrypt/src/crypto.cpp
0 → 100644
View file @
e4676ef6
/* crypto.cpp
*
* Copyright (C) 2003 Sawtooth Consulting Ltd.
*
* This file is part of yaSSL.
*
* yaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* There are special exceptions to the terms and conditions of the GPL as it
* is applied to yaSSL. View the full text of the exception in the file
* FLOSS-EXCEPTIONS in the directory of this software distribution.
*
* yaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
/* put features that other apps expect from OpenSSL type crypto */
extern
"C"
{
// for libcurl configure test, these are the signatures they use
// locking handled internally by library
char
CRYPTO_lock
()
{
return
0
;}
char
CRYPTO_add_lock
()
{
return
0
;}
}
// extern "C"
extra/yassl/taocrypt/src/misc.cpp
View file @
e4676ef6
...
...
@@ -29,6 +29,7 @@
#include "runtime.hpp"
#include "misc.hpp"
#ifdef YASSL_PURE_C
void
*
operator
new
(
size_t
sz
,
TaoCrypt
::
new_t
)
...
...
extra/yassl/testsuite/test.hpp
View file @
e4676ef6
...
...
@@ -312,7 +312,7 @@ inline void tcp_listen(SOCKET_T& sockfd)
}
inline
void
tcp_accept
(
SOCKET_T
&
sockfd
,
int
&
clientfd
,
func_args
&
args
)
inline
void
tcp_accept
(
SOCKET_T
&
sockfd
,
SOCKET_T
&
clientfd
,
func_args
&
args
)
{
tcp_listen
(
sockfd
);
...
...
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