diff options
author | Yashwant Sahu <yashwant.sahu@oracle.com> | 2016-02-26 11:53:56 +0530 |
---|---|---|
committer | Yashwant Sahu <yashwant.sahu@oracle.com> | 2016-02-26 11:53:56 +0530 |
commit | e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69 (patch) | |
tree | 10d72b2871af980cc0084c67e3b88b41b682801a /extra/yassl/taocrypt | |
parent | 29cc2c28832ae4733804ac6b29d650238ee0559c (diff) | |
download | mariadb-git-e7061f7e5a96c66cb2e0bf46bec7f6ff35801a69.tar.gz |
Bug #22738607: YASSL FUNCTION X509_NAME_GET_INDEX_BY_NID IS NOT WORKING AS EXPECTED.mysql-5.5.49
Diffstat (limited to 'extra/yassl/taocrypt')
-rw-r--r-- | extra/yassl/taocrypt/include/asn.hpp | 8 | ||||
-rw-r--r-- | extra/yassl/taocrypt/src/asn.cpp | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/extra/yassl/taocrypt/include/asn.hpp b/extra/yassl/taocrypt/include/asn.hpp index c7d01d00323..9a10064ce02 100644 --- a/extra/yassl/taocrypt/include/asn.hpp +++ b/extra/yassl/taocrypt/include/asn.hpp @@ -283,6 +283,10 @@ public: const byte* GetHash() const { return subjectHash_; } const char* GetBeforeDate() const { return beforeDate_; } const char* GetAfterDate() const { return afterDate_; } + int GetSubjectCnStart() const { return subCnPos_; } + int GetIssuerCnStart() const { return issCnPos_; } + int GetSubjectCnLength() const { return subCnLen_; } + int GetIssuerCnLength() const { return issCnLen_; } void DecodeToKey(); private: @@ -292,6 +296,10 @@ private: word32 sigLength_; // length of signature word32 signatureOID_; // sum of algorithm object id word32 keyOID_; // sum of key algo object id + int subCnPos_; // subject common name start, -1 is none + int subCnLen_; // length of above + int issCnPos_; // issuer common name start, -1 is none + int issCnLen_; // length of above byte subjectHash_[SHA_SIZE]; // hash of all Names byte issuerHash_[SHA_SIZE]; // hash of all Names byte* signature_; diff --git a/extra/yassl/taocrypt/src/asn.cpp b/extra/yassl/taocrypt/src/asn.cpp index c419ec0a992..a210d805452 100644 --- a/extra/yassl/taocrypt/src/asn.cpp +++ b/extra/yassl/taocrypt/src/asn.cpp @@ -474,8 +474,9 @@ void DH_Decoder::Decode(DH& key) CertDecoder::CertDecoder(Source& s, bool decode, SignerList* signers, bool noVerify, CertType ct) - : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), - signature_(0), verify_(!noVerify) + : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), subCnPos_(-1), + subCnLen_(0), issCnPos_(-1), issCnLen_(0), signature_(0), + verify_(!noVerify) { issuer_[0] = 0; subject_[0] = 0; @@ -796,6 +797,13 @@ void CertDecoder::GetName(NameType nt) case COMMON_NAME: if (!(ptr = AddTag(ptr, buf_end, "/CN=", 4, strLen))) return; + if (nt == ISSUER) { + issCnPos_ = (int)(ptr - strLen - issuer_); + issCnLen_ = (int)strLen; + } else { + subCnPos_ = (int)(ptr - strLen - subject_); + subCnLen_ = (int)strLen; + } break; case SUR_NAME: if (!(ptr = AddTag(ptr, buf_end, "/SN=", 4, strLen))) |