Update padding check logic
parent
f817fc7c2e
commit
3b4a9e2ccf
17
filters.cpp
17
filters.cpp
|
|
@ -611,14 +611,15 @@ void StreamTransformationFilter::InitializeDerivedAndReturnNewSizes(const NameVa
|
|||
else
|
||||
m_padding = padding;
|
||||
|
||||
if (!isBlockCipher && (m_padding == PKCS_PADDING))
|
||||
throw InvalidArgument("StreamTransformationFilter: PKCS_PADDING cannot be used with " + m_cipher.AlgorithmName());
|
||||
|
||||
if (!isBlockCipher && (m_padding == W3C_PADDING))
|
||||
throw InvalidArgument("StreamTransformationFilter: W3C_PADDING cannot be used with " + m_cipher.AlgorithmName());
|
||||
|
||||
if (!isBlockCipher && (m_padding == ONE_AND_ZEROS_PADDING))
|
||||
throw InvalidArgument("StreamTransformationFilter: ONE_AND_ZEROS_PADDING cannot be used with " + m_cipher.AlgorithmName());
|
||||
if (!isBlockCipher)
|
||||
{
|
||||
if (m_padding == PKCS_PADDING)
|
||||
throw InvalidArgument("StreamTransformationFilter: PKCS_PADDING cannot be used with " + m_cipher.AlgorithmName());
|
||||
else if (m_padding == W3C_PADDING)
|
||||
throw InvalidArgument("StreamTransformationFilter: W3C_PADDING cannot be used with " + m_cipher.AlgorithmName());
|
||||
else if (m_padding == ONE_AND_ZEROS_PADDING)
|
||||
throw InvalidArgument("StreamTransformationFilter: ONE_AND_ZEROS_PADDING cannot be used with " + m_cipher.AlgorithmName());
|
||||
}
|
||||
|
||||
firstSize = 0;
|
||||
blockSize = m_cipher.MandatoryBlockSize();
|
||||
|
|
|
|||
Loading…
Reference in New Issue