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
01faaacd
Commit
01faaacd
authored
May 05, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import from yaSSL
parent
bb5c6d43
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
72 additions
and
58 deletions
+72
-58
extra/yassl/examples/client/client.cpp
extra/yassl/examples/client/client.cpp
+2
-0
extra/yassl/examples/echoclient/echoclient.cpp
extra/yassl/examples/echoclient/echoclient.cpp
+1
-0
extra/yassl/examples/echoserver/echoserver.cpp
extra/yassl/examples/echoserver/echoserver.cpp
+2
-0
extra/yassl/examples/server/server.cpp
extra/yassl/examples/server/server.cpp
+2
-0
extra/yassl/include/openssl/ssl.h
extra/yassl/include/openssl/ssl.h
+6
-0
extra/yassl/include/yassl_types.hpp
extra/yassl/include/yassl_types.hpp
+0
-4
extra/yassl/src/make.bat
extra/yassl/src/make.bat
+1
-1
extra/yassl/src/ssl.cpp
extra/yassl/src/ssl.cpp
+49
-45
extra/yassl/src/yassl_imp.cpp
extra/yassl/src/yassl_imp.cpp
+3
-1
extra/yassl/src/yassl_int.cpp
extra/yassl/src/yassl_int.cpp
+1
-1
extra/yassl/taocrypt/benchmark/make.bat
extra/yassl/taocrypt/benchmark/make.bat
+2
-3
extra/yassl/taocrypt/src/make.bat
extra/yassl/taocrypt/src/make.bat
+0
-1
extra/yassl/taocrypt/test/make.bat
extra/yassl/taocrypt/test/make.bat
+1
-1
extra/yassl/testsuite/make.bat
extra/yassl/testsuite/make.bat
+1
-1
extra/yassl/testsuite/testsuite.cpp
extra/yassl/testsuite/testsuite.cpp
+1
-0
No files found.
extra/yassl/examples/client/client.cpp
View file @
01faaacd
...
...
@@ -89,6 +89,8 @@ void client_test(void* args)
args
.
argv
=
argv
;
client_test
(
&
args
);
yaSSL_CleanUp
();
return
args
.
return_code
;
}
...
...
extra/yassl/examples/echoclient/echoclient.cpp
View file @
01faaacd
...
...
@@ -82,6 +82,7 @@ void echoclient_test(void* args)
args
.
argv
=
argv
;
echoclient_test
(
&
args
);
yaSSL_CleanUp
();
return
args
.
return_code
;
}
...
...
extra/yassl/examples/echoserver/echoserver.cpp
View file @
01faaacd
...
...
@@ -15,6 +15,8 @@
args
.
argv
=
argv
;
echoserver_test
(
&
args
);
yaSSL_CleanUp
();
return
args
.
return_code
;
}
...
...
extra/yassl/examples/server/server.cpp
View file @
01faaacd
...
...
@@ -67,6 +67,8 @@ THREAD_RETURN YASSL_API server_test(void* args)
args
.
argv
=
argv
;
server_test
(
&
args
);
yaSSL_CleanUp
();
return
args
.
return_code
;
}
...
...
extra/yassl/include/openssl/ssl.h
View file @
01faaacd
...
...
@@ -32,6 +32,12 @@
#include "opensslv.h"
/* for version number */
#include "rsa.h"
extern
"C"
void
yaSSL_CleanUp
();
/* call once at end of application use to
free static singleton memory holders,
not a leak per se, but helpful when
looking for them */
#if defined(__cplusplus) && !defined(YASSL_MYSQL_COMPATIBLE)
namespace
yaSSL
{
extern
"C"
{
...
...
extra/yassl/include/yassl_types.hpp
View file @
01faaacd
...
...
@@ -35,10 +35,6 @@
namespace
yaSSL
{
// Delete static singleton memory holders
void
CleanUp
();
#ifdef YASSL_PURE_C
// library allocation
...
...
extra/yassl/src/make.bat
View file @
01faaacd
#
quick
and
dirty
build
file
for
testing
different
MSDEVs
REM
quick and dirty build file for testing different MSDEVs
setlocal
set
myFLAGS
=
/I
../include
/I
../mySTL
/I
../taocrypt/include
/W
3
/c /ZI
...
...
extra/yassl/src/ssl.cpp
View file @
01faaacd
...
...
@@ -53,6 +53,53 @@ namespace yaSSL {
using
mySTL
::
min
;
int
read_file
(
SSL_CTX
*
ctx
,
const
char
*
file
,
int
format
,
CertType
type
)
{
if
(
format
!=
SSL_FILETYPE_ASN1
&&
format
!=
SSL_FILETYPE_PEM
)
return
SSL_BAD_FILETYPE
;
FILE
*
input
=
fopen
(
file
,
"rb"
);
if
(
!
input
)
return
SSL_BAD_FILE
;
if
(
type
==
CA
)
{
x509
*
ptr
=
PemToDer
(
file
,
Cert
);
if
(
!
ptr
)
{
fclose
(
input
);
return
SSL_BAD_FILE
;
}
ctx
->
AddCA
(
ptr
);
// takes ownership
}
else
{
x509
*&
x
=
(
type
==
Cert
)
?
ctx
->
certificate_
:
ctx
->
privateKey_
;
if
(
format
==
SSL_FILETYPE_ASN1
)
{
fseek
(
input
,
0
,
SEEK_END
);
long
sz
=
ftell
(
input
);
rewind
(
input
);
x
=
NEW_YS
x509
(
sz
);
// takes ownership
size_t
bytes
=
fread
(
x
->
use_buffer
(),
sz
,
1
,
input
);
if
(
bytes
!=
1
)
{
fclose
(
input
);
return
SSL_BAD_FILE
;
}
}
else
{
x
=
PemToDer
(
file
,
type
);
if
(
!
x
)
{
fclose
(
input
);
return
SSL_BAD_FILE
;
}
}
}
fclose
(
input
);
return
SSL_SUCCESS
;
}
extern
"C"
{
SSL_METHOD
*
SSLv3_method
()
{
return
SSLv3_client_method
();
...
...
@@ -449,50 +496,6 @@ long SSL_CTX_set_tmp_dh(SSL_CTX* ctx, DH* dh)
}
int
read_file
(
SSL_CTX
*
ctx
,
const
char
*
file
,
int
format
,
CertType
type
)
{
if
(
format
!=
SSL_FILETYPE_ASN1
&&
format
!=
SSL_FILETYPE_PEM
)
return
SSL_BAD_FILETYPE
;
FILE
*
input
=
fopen
(
file
,
"rb"
);
if
(
!
input
)
return
SSL_BAD_FILE
;
if
(
type
==
CA
)
{
x509
*
ptr
=
PemToDer
(
file
,
Cert
);
if
(
!
ptr
)
{
fclose
(
input
);
return
SSL_BAD_FILE
;
}
ctx
->
AddCA
(
ptr
);
// takes ownership
}
else
{
x509
*&
x
=
(
type
==
Cert
)
?
ctx
->
certificate_
:
ctx
->
privateKey_
;
if
(
format
==
SSL_FILETYPE_ASN1
)
{
fseek
(
input
,
0
,
SEEK_END
);
long
sz
=
ftell
(
input
);
rewind
(
input
);
x
=
NEW_YS
x509
(
sz
);
// takes ownership
size_t
bytes
=
fread
(
x
->
use_buffer
(),
sz
,
1
,
input
);
if
(
bytes
!=
1
)
{
fclose
(
input
);
return
SSL_BAD_FILE
;
}
}
else
{
x
=
PemToDer
(
file
,
type
);
if
(
!
x
)
{
fclose
(
input
);
return
SSL_BAD_FILE
;
}
}
}
fclose
(
input
);
return
SSL_SUCCESS
;
}
int
SSL_CTX_use_certificate_file
(
SSL_CTX
*
ctx
,
const
char
*
file
,
int
format
)
{
return
read_file
(
ctx
,
file
,
format
,
Cert
);
...
...
@@ -1080,7 +1083,7 @@ int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos)
switch
(
nid
)
{
case
NID_commonName
:
char
*
found
=
strstr
(
start
,
"/CN="
);
c
onst
c
har
*
found
=
strstr
(
start
,
"/CN="
);
if
(
found
)
{
found
+=
4
;
// advance to str
idx
=
found
-
start
+
lastpos
+
1
;
...
...
@@ -1401,4 +1404,5 @@ void MD5_Final(unsigned char* hash, MD5_CTX* md5)
// end stunnel needs
}
// extern "C"
}
// namespace
extra/yassl/src/yassl_imp.cpp
View file @
01faaacd
...
...
@@ -1975,7 +1975,9 @@ Connection::Connection(ProtocolVersion v, RandomPool& ran)
:
pre_master_secret_
(
0
),
sequence_number_
(
0
),
peer_sequence_number_
(
0
),
pre_secret_len_
(
0
),
send_server_key_
(
false
),
master_clean_
(
false
),
TLS_
(
v
.
major_
>=
3
&&
v
.
minor_
>=
1
),
version_
(
v
),
random_
(
ran
)
{}
{
memset
(
sessionID_
,
0
,
sizeof
(
sessionID_
));
}
Connection
::~
Connection
()
...
...
extra/yassl/src/yassl_int.cpp
View file @
01faaacd
...
...
@@ -1415,7 +1415,7 @@ BulkCipher* CryptProvider::NewDesEde()
}
void
CleanUp
()
extern
"C"
void
yaSSL_
CleanUp
()
{
TaoCrypt
::
CleanUp
();
ysDelete
(
cryptProviderInstance
);
...
...
extra/yassl/taocrypt/benchmark/make.bat
View file @
01faaacd
#
quick
and
dirty
build
file
for
testing
different
MSDEVs
REM
quick and dirty build file for testing different MSDEVs
setlocal
set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
/G
6
/O
2
#set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
cl
%myFLAGS%
benchmark
.cpp
link
.exe
/out
:benchmark
.exe ../src/taocrypt.lib
benchmark
.obj
link
.exe
/out
:benchmark
.exe ../src/taocrypt.lib
benchmark
.obj
advapi32
.lib
extra/yassl/taocrypt/src/make.bat
View file @
01faaacd
...
...
@@ -2,7 +2,6 @@ REM quick and dirty build file for testing different MSDEVs
setlocal
set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
/G
6
/O
2
#set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
/O
1
cl
%myFLAGS%
aes
.cpp
cl
%myFLAGS%
aestables
.cpp
...
...
extra/yassl/taocrypt/test/make.bat
View file @
01faaacd
#
quick
and
dirty
build
file
for
testing
different
MSDEVs
REM
quick and dirty build file for testing different MSDEVs
setlocal
set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
/G
6
/O
2
...
...
extra/yassl/testsuite/make.bat
View file @
01faaacd
#
quick
and
dirty
build
file
for
testing
different
MSDEVs
REM
quick and dirty build file for testing different MSDEVs
setlocal
set
myFLAGS
=
/I
../include
/I
../taocrypt/include
/I
../mySTL
/c /W
3
/G
6
/O
2
/MT /D
"WIN32"
/D
"NO_MAIN_DRIVER"
...
...
extra/yassl/testsuite/testsuite.cpp
View file @
01faaacd
...
...
@@ -91,6 +91,7 @@ int main(int argc, char** argv)
assert
(
memcmp
(
input
,
output
,
sizeof
(
input
))
==
0
);
printf
(
"
\n
All tests passed!
\n
"
);
yaSSL_CleanUp
();
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