Skip to content

Commit 5ed02ce

Browse files
committed
1 parent a20d0a5 commit 5ed02ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/third-parties/cryptopp/filters.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -618,8 +618,14 @@ void StreamTransformationFilter::InitializeDerivedAndReturnNewSizes(const NameVa
618618
else
619619
m_padding = padding;
620620

621-
if (!isBlockCipher && (m_padding == PKCS_PADDING || m_padding == ONE_AND_ZEROS_PADDING))
622-
throw InvalidArgument("StreamTransformationFilter: PKCS_PADDING and ONE_AND_ZEROS_PADDING cannot be used with " + m_cipher.AlgorithmName());
621+
if (!isBlockCipher && (m_padding == PKCS_PADDING))
622+
throw InvalidArgument("StreamTransformationFilter: PKCS_PADDING cannot be used with " + m_cipher.AlgorithmName());
623+
624+
if (!isBlockCipher && (m_padding == W3C_PADDING))
625+
throw InvalidArgument("StreamTransformationFilter: W3C_PADDING cannot be used with " + m_cipher.AlgorithmName());
626+
627+
if (!isBlockCipher && (m_padding == ONE_AND_ZEROS_PADDING))
628+
throw InvalidArgument("StreamTransformationFilter: ONE_AND_ZEROS_PADDING cannot be used with " + m_cipher.AlgorithmName());
623629

624630
firstSize = 0;
625631
blockSize = m_cipher.MandatoryBlockSize();

0 commit comments

Comments
 (0)