fix bug decoding optional parameters

pull/2/head
weidai 2007-04-16 00:38:29 +00:00
parent ffd84849eb
commit 3802d23c07
1 changed files with 1 additions and 1 deletions

View File

@ -550,7 +550,7 @@ void PKCS8PrivateKey::BERDecode(BufferedTransformation &bt)
BERSequenceDecoder algorithm(privateKeyInfo); BERSequenceDecoder algorithm(privateKeyInfo);
GetAlgorithmID().BERDecodeAndCheck(algorithm); GetAlgorithmID().BERDecodeAndCheck(algorithm);
bool parametersPresent = BERDecodeAlgorithmParameters(algorithm); bool parametersPresent = algorithm.EndReached() ? false : BERDecodeAlgorithmParameters(algorithm);
algorithm.MessageEnd(); algorithm.MessageEnd();
BERGeneralDecoder octetString(privateKeyInfo, OCTET_STRING); BERGeneralDecoder octetString(privateKeyInfo, OCTET_STRING);