summaryrefslogtreecommitdiff
path: root/extra/yassl/taocrypt/src
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-10-09 17:12:26 +0200
committerSergei Golubchik <serg@mariadb.org>2015-10-09 17:12:26 +0200
commitcfeedbfd3e292f61c7da8f0a7f86307cbeeddb64 (patch)
tree3629d1de148b14915a35a21f809e1a2ea6a08619 /extra/yassl/taocrypt/src
parentbff1af983ad7b0bed6c3973e4d13297df5fe2791 (diff)
parent16c4b3c68b06653592a9500050ad977a38f4ebae (diff)
downloadmariadb-git-cfeedbfd3e292f61c7da8f0a7f86307cbeeddb64.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'extra/yassl/taocrypt/src')
-rw-r--r--extra/yassl/taocrypt/src/asn.cpp9
-rw-r--r--extra/yassl/taocrypt/src/rsa.cpp4
2 files changed, 11 insertions, 2 deletions
diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp
index 624148bdac8..d8b133a3f0a 100644
--- a/extra/yassl/taocrypt/src/asn.cpp
+++ b/extra/yassl/taocrypt/src/asn.cpp
@@ -84,7 +84,7 @@ void ASN1_TIME_extract(const unsigned char* date, unsigned char format,
namespace { // locals
-// to the minute
+// to the second
bool operator>(tm& a, tm& b)
{
if (a.tm_year > b.tm_year)
@@ -105,13 +105,18 @@ bool operator>(tm& a, tm& b)
a.tm_min > b.tm_min)
return true;
+ if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon &&
+ a.tm_mday == b.tm_mday && a.tm_hour == b.tm_hour &&
+ a.tm_min == b.tm_min && a.tm_sec > b.tm_sec)
+ return true;
+
return false;
}
bool operator<(tm& a, tm&b)
{
- return !(a>b);
+ return (b>a);
}
diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp
index 79a8a8f1c4f..73f678e2674 100644
--- a/extra/yassl/taocrypt/src/rsa.cpp
+++ b/extra/yassl/taocrypt/src/rsa.cpp
@@ -140,6 +140,10 @@ word32 RSA_BlockType2::UnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
void RSA_BlockType1::Pad(const byte* input, word32 inputLen, byte* pkcsBlock,
word32 pkcsBlockLen, RandomNumberGenerator&) const
{
+ // sanity checks
+ if (input == NULL || pkcsBlock == NULL)
+ return;
+
// convert from bit length to byte length
if (pkcsBlockLen % 8 != 0)
{