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
d61f1823
Commit
d61f1823
authored
Apr 26, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge 192.168.0.20:mysql/my50-maint-yassl/
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
parents
2f4f68be
18a8eaa7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
23 deletions
+74
-23
extra/yassl/mySTL/helpers.hpp
extra/yassl/mySTL/helpers.hpp
+5
-0
extra/yassl/src/template_instnt.cpp
extra/yassl/src/template_instnt.cpp
+0
-1
extra/yassl/taocrypt/include/asn.hpp
extra/yassl/taocrypt/include/asn.hpp
+13
-6
extra/yassl/taocrypt/src/asn.cpp
extra/yassl/taocrypt/src/asn.cpp
+52
-12
extra/yassl/taocrypt/src/make.bat
extra/yassl/taocrypt/src/make.bat
+1
-1
extra/yassl/taocrypt/src/template_instnt.cpp
extra/yassl/taocrypt/src/template_instnt.cpp
+1
-1
extra/yassl/testsuite/test.hpp
extra/yassl/testsuite/test.hpp
+2
-2
No files found.
extra/yassl/mySTL/helpers.hpp
View file @
d61f1823
...
@@ -44,6 +44,11 @@
...
@@ -44,6 +44,11 @@
return
static_cast
<
void
*>
(
d
);
return
static_cast
<
void
*>
(
d
);
}
}
// for compilers that want matching delete
inline
void
operator
delete
(
void
*
ptr
,
Dummy
*
d
)
{
}
typedef
Dummy
*
yassl_pointer
;
typedef
Dummy
*
yassl_pointer
;
namespace
mySTL
{
namespace
mySTL
{
...
...
extra/yassl/src/template_instnt.cpp
View file @
d61f1823
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
#include "hmac.hpp"
#include "hmac.hpp"
#include "md5.hpp"
#include "md5.hpp"
#include "sha.hpp"
#include "sha.hpp"
#include "ripemd.hpp"
#include "openssl/ssl.h"
#include "openssl/ssl.h"
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
...
...
extra/yassl/taocrypt/include/asn.hpp
View file @
d61f1823
...
@@ -79,7 +79,13 @@ enum ASNIdFlag
...
@@ -79,7 +79,13 @@ enum ASNIdFlag
enum
DNTags
enum
DNTags
{
{
COMMON_NAME
=
0x03
COMMON_NAME
=
0x03
,
// CN
SUR_NAME
=
0x04
,
// SN
COUNTRY_NAME
=
0x06
,
// C
LOCALITY_NAME
=
0x07
,
// L
STATE_NAME
=
0x08
,
// ST
ORG_NAME
=
0x0a
,
// O
ORGUNIT_NAME
=
0x0b
// OU
};
};
...
@@ -92,7 +98,8 @@ enum Constants
...
@@ -92,7 +98,8 @@ enum Constants
MAX_SEQ_SZ
=
5
,
// enum(seq|con) + length(4)
MAX_SEQ_SZ
=
5
,
// enum(seq|con) + length(4)
MAX_ALGO_SIZE
=
9
,
MAX_ALGO_SIZE
=
9
,
MAX_DIGEST_SZ
=
25
,
// SHA + enum(Bit or Octet) + length(4)
MAX_DIGEST_SZ
=
25
,
// SHA + enum(Bit or Octet) + length(4)
DSA_SIG_SZ
=
40
DSA_SIG_SZ
=
40
,
NAME_MAX
=
512
// max total of all included names
};
};
...
@@ -205,14 +212,14 @@ enum { SHA_SIZE = 20 };
...
@@ -205,14 +212,14 @@ enum { SHA_SIZE = 20 };
// A Signing Authority
// A Signing Authority
class
Signer
{
class
Signer
{
PublicKey
key_
;
PublicKey
key_
;
char
*
name_
;
char
name_
[
NAME_MAX
]
;
byte
hash_
[
SHA_SIZE
];
byte
hash_
[
SHA_SIZE
];
public:
public:
Signer
(
const
byte
*
k
,
word32
kSz
,
const
char
*
n
,
const
byte
*
h
);
Signer
(
const
byte
*
k
,
word32
kSz
,
const
char
*
n
,
const
byte
*
h
);
~
Signer
();
~
Signer
();
const
PublicKey
&
GetPublicKey
()
const
{
return
key_
;
}
const
PublicKey
&
GetPublicKey
()
const
{
return
key_
;
}
const
char
*
Get
CommonName
()
const
{
return
name_
;
}
const
char
*
Get
Name
()
const
{
return
name_
;
}
const
byte
*
GetHash
()
const
{
return
hash_
;
}
const
byte
*
GetHash
()
const
{
return
hash_
;
}
private:
private:
...
@@ -257,8 +264,8 @@ private:
...
@@ -257,8 +264,8 @@ private:
byte
subjectHash_
[
SHA_SIZE
];
// hash of all Names
byte
subjectHash_
[
SHA_SIZE
];
// hash of all Names
byte
issuerHash_
[
SHA_SIZE
];
// hash of all Names
byte
issuerHash_
[
SHA_SIZE
];
// hash of all Names
byte
*
signature_
;
byte
*
signature_
;
char
*
issuer_
;
// CommonName
char
issuer_
[
NAME_MAX
];
// Names
char
*
subject_
;
// CommonName
char
subject_
[
NAME_MAX
];
// Names
bool
verify_
;
// Default to yes, but could be off
bool
verify_
;
// Default to yes, but could be off
void
ReadHeader
();
void
ReadHeader
();
...
...
extra/yassl/taocrypt/src/asn.cpp
View file @
d61f1823
...
@@ -213,21 +213,17 @@ void PublicKey::AddToEnd(const byte* data, word32 len)
...
@@ -213,21 +213,17 @@ void PublicKey::AddToEnd(const byte* data, word32 len)
Signer
::
Signer
(
const
byte
*
k
,
word32
kSz
,
const
char
*
n
,
const
byte
*
h
)
Signer
::
Signer
(
const
byte
*
k
,
word32
kSz
,
const
char
*
n
,
const
byte
*
h
)
:
key_
(
k
,
kSz
)
,
name_
(
0
)
:
key_
(
k
,
kSz
)
{
{
if
(
n
)
{
int
sz
=
strlen
(
n
);
int
sz
=
strlen
(
n
);
name_
=
NEW_TC
char
[
sz
+
1
];
memcpy
(
name_
,
n
,
sz
);
memcpy
(
name_
,
n
,
sz
);
name_
[
sz
]
=
0
;
name_
[
sz
]
=
0
;
}
memcpy
(
hash_
,
h
,
SHA
::
DIGEST_SIZE
);
memcpy
(
hash_
,
h
,
SHA
::
DIGEST_SIZE
);
}
}
Signer
::~
Signer
()
Signer
::~
Signer
()
{
{
tcArrayDelete
(
name_
);
}
}
...
@@ -424,17 +420,19 @@ void DH_Decoder::Decode(DH& key)
...
@@ -424,17 +420,19 @@ void DH_Decoder::Decode(DH& key)
CertDecoder
::
CertDecoder
(
Source
&
s
,
bool
decode
,
SignerList
*
signers
,
CertDecoder
::
CertDecoder
(
Source
&
s
,
bool
decode
,
SignerList
*
signers
,
bool
noVerify
,
CertType
ct
)
bool
noVerify
,
CertType
ct
)
:
BER_Decoder
(
s
),
certBegin_
(
0
),
sigIndex_
(
0
),
sigLength_
(
0
),
:
BER_Decoder
(
s
),
certBegin_
(
0
),
sigIndex_
(
0
),
sigLength_
(
0
),
signature_
(
0
),
issuer_
(
0
),
subject_
(
0
),
verify_
(
!
noVerify
)
signature_
(
0
),
verify_
(
!
noVerify
)
{
{
issuer_
[
0
]
=
0
;
subject_
[
0
]
=
0
;
if
(
decode
)
if
(
decode
)
Decode
(
signers
,
ct
);
Decode
(
signers
,
ct
);
}
}
CertDecoder
::~
CertDecoder
()
CertDecoder
::~
CertDecoder
()
{
{
tcArrayDelete
(
subject_
);
tcArrayDelete
(
issuer_
);
tcArrayDelete
(
signature_
);
tcArrayDelete
(
signature_
);
}
}
...
@@ -672,8 +670,12 @@ void CertDecoder::GetName(NameType nt)
...
@@ -672,8 +670,12 @@ void CertDecoder::GetName(NameType nt)
SHA
sha
;
SHA
sha
;
word32
length
=
GetSequence
();
// length of all distinguished names
word32
length
=
GetSequence
();
// length of all distinguished names
assert
(
length
<
NAME_MAX
);
length
+=
source_
.
get_index
();
length
+=
source_
.
get_index
();
char
*
ptr
=
(
nt
==
ISSUER
)
?
issuer_
:
subject_
;
word32
idx
=
0
;
while
(
source_
.
get_index
()
<
length
)
{
while
(
source_
.
get_index
()
<
length
)
{
GetSet
();
GetSet
();
GetSequence
();
GetSequence
();
...
@@ -694,13 +696,49 @@ void CertDecoder::GetName(NameType nt)
...
@@ -694,13 +696,49 @@ void CertDecoder::GetName(NameType nt)
byte
id
=
source_
.
next
();
byte
id
=
source_
.
next
();
b
=
source_
.
next
();
// strType
b
=
source_
.
next
();
// strType
word32
strLen
=
GetLength
(
source_
);
word32
strLen
=
GetLength
(
source_
);
bool
copy
=
false
;
if
(
id
==
COMMON_NAME
)
{
if
(
id
==
COMMON_NAME
)
{
char
*&
ptr
=
(
nt
==
ISSUER
)
?
issuer_
:
subject_
;
memcpy
(
&
ptr
[
idx
],
"/CN="
,
4
);
ptr
=
NEW_TC
char
[
strLen
+
1
];
idx
+=
4
;
memcpy
(
ptr
,
source_
.
get_current
(),
strLen
);
copy
=
true
;
ptr
[
strLen
]
=
0
;
}
else
if
(
id
==
SUR_NAME
)
{
memcpy
(
&
ptr
[
idx
],
"/SN="
,
4
);
idx
+=
4
;
copy
=
true
;
}
else
if
(
id
==
COUNTRY_NAME
)
{
memcpy
(
&
ptr
[
idx
],
"/C="
,
3
);
idx
+=
3
;
copy
=
true
;
}
else
if
(
id
==
LOCALITY_NAME
)
{
memcpy
(
&
ptr
[
idx
],
"/L="
,
3
);
idx
+=
3
;
copy
=
true
;
}
}
else
if
(
id
==
STATE_NAME
)
{
memcpy
(
&
ptr
[
idx
],
"/ST="
,
4
);
idx
+=
4
;
copy
=
true
;
}
else
if
(
id
==
ORG_NAME
)
{
memcpy
(
&
ptr
[
idx
],
"/O="
,
3
);
idx
+=
3
;
copy
=
true
;
}
else
if
(
id
==
ORGUNIT_NAME
)
{
memcpy
(
&
ptr
[
idx
],
"/OU="
,
4
);
idx
+=
4
;
copy
=
true
;
}
if
(
copy
)
{
memcpy
(
&
ptr
[
idx
],
source_
.
get_current
(),
strLen
);
idx
+=
strLen
;
}
sha
.
Update
(
source_
.
get_current
(),
strLen
);
sha
.
Update
(
source_
.
get_current
(),
strLen
);
source_
.
advance
(
strLen
);
source_
.
advance
(
strLen
);
}
}
...
@@ -711,6 +749,8 @@ void CertDecoder::GetName(NameType nt)
...
@@ -711,6 +749,8 @@ void CertDecoder::GetName(NameType nt)
source_
.
advance
(
length
);
source_
.
advance
(
length
);
}
}
}
}
ptr
[
idx
++
]
=
0
;
if
(
nt
==
ISSUER
)
if
(
nt
==
ISSUER
)
sha
.
Final
(
issuerHash_
);
sha
.
Final
(
issuerHash_
);
else
else
...
...
extra/yassl/taocrypt/src/make.bat
View file @
d61f1823
#
quick
and
dirty
build
file
for
testing
different
MSDEVs
REM
quick and dirty build file for testing different MSDEVs
setlocal
setlocal
set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
/G
6
/O
2
set
myFLAGS
=
/I
../include
/I
../../mySTL
/c /W
3
/G
6
/O
2
...
...
extra/yassl/taocrypt/src/template_instnt.cpp
View file @
d61f1823
...
@@ -30,11 +30,11 @@
...
@@ -30,11 +30,11 @@
#include "sha.hpp"
#include "sha.hpp"
#include "md5.hpp"
#include "md5.hpp"
#include "hmac.hpp"
#include "hmac.hpp"
#include "ripemd.hpp"
#include "pwdbased.hpp"
#include "pwdbased.hpp"
#include "algebra.hpp"
#include "algebra.hpp"
#include "vector.hpp"
#include "vector.hpp"
#include "hash.hpp"
#include "hash.hpp"
#include "ripemd.hpp"
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
namespace
TaoCrypt
{
namespace
TaoCrypt
{
...
...
extra/yassl/testsuite/test.hpp
View file @
d61f1823
...
@@ -305,8 +305,8 @@ inline void showPeer(SSL* ssl)
...
@@ -305,8 +305,8 @@ inline void showPeer(SSL* ssl)
char
*
subject
=
X509_NAME_oneline
(
X509_get_subject_name
(
peer
),
0
,
0
);
char
*
subject
=
X509_NAME_oneline
(
X509_get_subject_name
(
peer
),
0
,
0
);
printf
(
"peer's cert info:
\n
"
);
printf
(
"peer's cert info:
\n
"
);
printf
(
"issuer
is
: %s
\n
"
,
issuer
);
printf
(
"issuer : %s
\n
"
,
issuer
);
printf
(
"subject
is
: %s
\n
"
,
subject
);
printf
(
"subject: %s
\n
"
,
subject
);
free
(
subject
);
free
(
subject
);
free
(
issuer
);
free
(
issuer
);
...
...
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