Dear Sir;
bool parametersPresent = BERDecodeAlgorithmParameters(algorithm);
to:
bool parametersPresent = algorithm.EndReached() ? false :
BERDecodeAlgorithmParameters(algorithm);
this exchange at asn.cpp file fixed that parameter problem, we get a
false value for parametersPresent attiribute
but our problem still exists at this code block;
void PKCS8PrivateKey::BERDecode(BufferedTransformation &bt)
{
BERSequenceDecoder privateKeyInfo(bt);
word32 version;
BERDecodeUnsigned<word32>(privateKeyInfo, version, INTEGER, 0,
0); //
check version
BERSequenceDecoder algorithm(privateKeyInfo);
GetAlgorithmID().BERDecodeAndCheck(algorithm);
bool parametersPresent = algorithm.EndReached() ? false :
BERDecodeAlgorithmParameters(algorithm); <==fix works at here
algorithm.MessageEnd();
BERGeneralDecoder octetString(privateKeyInfo, OCTET_STRING);
BERDecodeKey2(octetString, parametersPresent,
privateKeyInfo.RemainingLength());
octetString.MessageEnd();
BERDecodeOptionalAttributes(privateKeyInfo);
privateKeyInfo.MessageEnd(); <=== ///!!!/// but here we get another
BerDecodeError ///!!!///
}
void BERGeneralDecoder::MessageEnd()
{
m_finished = true;
if (m_definiteLength)
{
if (m_length != 0)
BERDecodeError();<=== we get this error (m_length=15)
}
else
{ // remove end-of-content octets
word16 i;
if (m_inQueue.GetWord16(i) != 2 || i != 0)
BERDecodeError();
}
}
what is the purpose of this line / function ?
"privateKeyInfo.MessageEnd();"
/
BERGeneralDecoder::MessageEnd()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---