diff --git a/src/mscng/ciphers.c b/src/mscng/ciphers.c index 1c3f2dd0a..dec755856 100644 --- a/src/mscng/ciphers.c +++ b/src/mscng/ciphers.c @@ -290,6 +290,7 @@ xmlSecMSCngBlockCipherSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) { xmlSecInvalidKeyDataSizeError(bufDataSize, ctx->keySize, xmlSecTransformGetName(transform)); goto done; } + bufDataSize = ctx->keySize; /* allocate the key object */ dwKeyObjectLength = dwBytesWritten = 0;