Module: wine Branch: master Commit: 5b0928771397ff3d2fc07dda14499ce2eef8ad96 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5b0928771397ff3d2fc07dda14...
Author: Juan Lang juan.lang@gmail.com Date: Mon Oct 1 16:04:34 2007 -0700
crypt32: Don't check decoded length against encoded length for indefinite-form sequences.
---
dlls/crypt32/decode.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 082c28a..7bba04b 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -467,10 +467,14 @@ static BOOL CRYPT_AsnDecodeSequence(struct AsnDecodeSequenceItem items[], { DWORD lenBytes = GET_LEN_BYTES(pbEncoded[1]), cbDecoded; const BYTE *ptr = pbEncoded + 1 + lenBytes; + BOOL indefinite = FALSE;
cbEncoded -= 1 + lenBytes; if (dataLen == CMSG_INDEFINITE_LENGTH) + { dataLen = cbEncoded; + indefinite = TRUE; + } else if (cbEncoded < dataLen) { TRACE("dataLen %d exceeds cbEncoded %d, failing\n", dataLen, @@ -501,7 +505,7 @@ static BOOL CRYPT_AsnDecodeSequence(struct AsnDecodeSequenceItem items[], cbDecoded += 2; } } - if (ret && cbDecoded != dataLen) + if (ret && !indefinite && cbDecoded != dataLen) { TRACE("expected %d decoded, got %d, failing\n", dataLen, cbDecoded);