diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-04-05 23:07:18 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-04-05 23:07:18 +0200 |
commit | a3073ecd96a829aaff87c6386e0766fc1440922b (patch) | |
tree | d91e26efc46ab64ee6cb8de880eac060cded0213 /extra/yassl/taocrypt/src/rsa.cpp | |
parent | 1a48919036a7746a15ff6bd19cb52c25fc6a57c1 (diff) | |
parent | cbd52a42ee9b93675e5cdaa043df878c423b6571 (diff) | |
download | mariadb-git-a3073ecd96a829aaff87c6386e0766fc1440922b.tar.gz |
merge
Diffstat (limited to 'extra/yassl/taocrypt/src/rsa.cpp')
-rw-r--r-- | extra/yassl/taocrypt/src/rsa.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extra/yassl/taocrypt/src/rsa.cpp b/extra/yassl/taocrypt/src/rsa.cpp index 57d19a59c76..576146377a3 100644 --- a/extra/yassl/taocrypt/src/rsa.cpp +++ b/extra/yassl/taocrypt/src/rsa.cpp @@ -61,7 +61,6 @@ Integer RSA_PrivateKey::CalculateInverse(RandomNumberGenerator& rng, Integer y = ModularRoot(re, dq_, dp_, q_, p_, u_); y = modn.Divide(y, r); // unblind - assert(modn.Exponentiate(y, e_) == x); // check return y; } @@ -124,7 +123,8 @@ word32 RSA_BlockType2::UnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen, unsigned i=1; while (i<pkcsBlockLen && pkcsBlock[i++]) { // null body } - assert(i==pkcsBlockLen || pkcsBlock[i-1]==0); + if (!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) + return 0; unsigned int outputLen = pkcsBlockLen - i; invalid = (outputLen > maxOutputLen) || invalid; @@ -179,7 +179,8 @@ word32 RSA_BlockType1::UnPad(const byte* pkcsBlock, word32 pkcsBlockLen, unsigned i=1; while (i<pkcsBlockLen && pkcsBlock[i++]) { // null body } - assert(i==pkcsBlockLen || pkcsBlock[i-1]==0); + if (!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) + return 0; unsigned int outputLen = pkcsBlockLen - i; invalid = (outputLen > maxOutputLen) || invalid; |