On Mar 12, 2:15 am, Albert Skara <[email protected]> wrote:
>...
> crtyptopp uses one dynamic cast in
> filters.cpp, which may be a problem
Not sure if this matters, but there is a fair number of
typeid().name() being used.

I also beileve the tests performed by Crypto++ are positive. You
should also check that you can catch Crypto++ exceptions by crafting
some negative tests.

Jeff

Find all "typeid", Subfolders, Find Results 1, "Entire Solution"
  ...\cryptopp562\algparam.h(92):
NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(std::string),
*m_valueType);
  ...\cryptopp562\algparam.h(95):                       if (typeid(T) != 
typeid(BASE))
  ...\cryptopp562\algparam.h(97):                       
((*reinterpret_cast<std::string
*>(m_pValue) += "ThisPointer:") += typeid(T).name()) += ';';
  ...\cryptopp562\algparam.h(100):              if (!m_found && strncmp(m_name,
"ThisPointer:", 12) == 0 && strcmp(m_name+12, typeid(T).name()) == 0)
  ...\cryptopp562\algparam.h(102):
NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T *),
*m_valueType);
  ...\cryptopp562\algparam.h(111):              if (!m_found && typeid(T) !=
typeid(BASE))
  ...\cryptopp562\algparam.h(124):
NameValuePairs::ThrowIfTypeMismatch(name, typeid(R), *m_valueType);
  ...\cryptopp562\algparam.h(135):                      
((*reinterpret_cast<std::string
*>(m_pValue) += "ThisObject:") += typeid(T).name()) += ';';
  ...\cryptopp562\algparam.h(136):              if (!m_found && strncmp(m_name,
"ThisObject:", 11) == 0 && strcmp(m_name+11, typeid(T).name()) == 0)
  ...\cryptopp562\algparam.h(138):
NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T), *m_valueType);
  ...\cryptopp562\algparam.h(189):              else if (typeid(BASE) !=
typeid(T))
  ...\cryptopp562\algparam.h(200):                              throw
InvalidArgument(std::string(typeid(T).name()) + ": Missing required
parameter '" + name + "'");
  ...\cryptopp562\algparam.h(213):                              throw
InvalidArgument(std::string(typeid(T).name()) + ": Missing required
parameter '" + name1 + "'");
  ...\cryptopp562\algparam.h(216):                              throw
InvalidArgument(std::string(typeid(T).name()) + ": Missing required
parameter '" + name2 + "'");
  ...\cryptopp562\algparam.h(246):CRYPTOPP_DLL const std::type_info &
CRYPTOPP_API IntegerTypeId();
  ...\cryptopp562\algparam.h(313):              if (!(g_pAssignIntToInteger !=
NULL && typeid(T) == typeid(int) && g_pAssignIntToInteger(valueType,
pValue, &m_value)))
  ...\cryptopp562\algparam.h(315):
NameValuePairs::ThrowIfTypeMismatch(name, typeid(T), valueType);
  ...\cryptopp562\cryptlib.h(250):              return
GetValue((std::string("ThisObject:")+typeid(T).name()).c_str(),
object);
  ...\cryptopp562\cryptlib.h(257):              return
GetValue((std::string("ThisPointer:")+typeid(T).name()).c_str(), p);
  ...\cryptopp562\cryptlib.h(264):              return GetVoidValue(name,
typeid(T), &value);
  ...\cryptopp562\algparam.cpp(30):
NameValuePairs::ThrowIfTypeMismatch(name, typeid(std::string),
valueType);
  ...\cryptopp562\eccrypto.cpp(454):            this->ThrowIfTypeMismatch(name,
typeid(OID), valueType);
  ...\cryptopp562\integer.cpp(39):      if (valueType != typeid(Integer))
  ...\cryptopp562\datatest.cpp(148):                    if (std::string(name) ==
Name::DigestSize() && valueType == typeid(int))
  ...\cryptopp562\datatest.cpp(167):            if (valueType == typeid(int))
  ...\cryptopp562\datatest.cpp(169):            else if (valueType ==
typeid(Integer))
  ...\cryptopp562\datatest.cpp(171):            else if (valueType ==
typeid(ConstByteArrayParameter))
  ...\cryptopp562\datatest.cpp(178):                    throw 
ValueTypeMismatch(name,
typeid(std::string), valueType);
  ...\cryptopp562\fipsalgt.cpp(380):            if (typeid(Result) ==
typeid(PK_Verifier))
  ...\cryptopp562\fipsalgt.cpp(389):            else if (typeid(Result) ==
typeid(PK_Signer))
  ...\cryptopp562\algparam.h(92):
NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(std::string),
*m_valueType);
  ...\cryptopp562\algparam.h(95):                       if (typeid(T) != 
typeid(BASE))
  ...\cryptopp562\algparam.h(97):                       
((*reinterpret_cast<std::string
*>(m_pValue) += "ThisPointer:") += typeid(T).name()) += ';';
  ...\cryptopp562\algparam.h(100):              if (!m_found && strncmp(m_name,
"ThisPointer:", 12) == 0 && strcmp(m_name+12, typeid(T).name()) == 0)
  ...\cryptopp562\algparam.h(102):
NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T *),
*m_valueType);
  ...\cryptopp562\algparam.h(111):              if (!m_found && typeid(T) !=
typeid(BASE))
  ...\cryptopp562\algparam.h(124):
NameValuePairs::ThrowIfTypeMismatch(name, typeid(R), *m_valueType);
  ...\cryptopp562\algparam.h(135):                      
((*reinterpret_cast<std::string
*>(m_pValue) += "ThisObject:") += typeid(T).name()) += ';';
  ...\cryptopp562\algparam.h(136):              if (!m_found && strncmp(m_name,
"ThisObject:", 11) == 0 && strcmp(m_name+11, typeid(T).name()) == 0)
  ...\cryptopp562\algparam.h(138):
NameValuePairs::ThrowIfTypeMismatch(m_name, typeid(T), *m_valueType);
  ...\cryptopp562\algparam.h(189):              else if (typeid(BASE) !=
typeid(T))
  ...\cryptopp562\algparam.h(200):                              throw
InvalidArgument(std::string(typeid(T).name()) + ": Missing required
parameter '" + name + "'");
  ...\cryptopp562\algparam.h(213):                              throw
InvalidArgument(std::string(typeid(T).name()) + ": Missing required
parameter '" + name1 + "'");
  ...\cryptopp562\algparam.h(216):                              throw
InvalidArgument(std::string(typeid(T).name()) + ": Missing required
parameter '" + name2 + "'");
  ...\cryptopp562\algparam.h(246):CRYPTOPP_DLL const std::type_info &
CRYPTOPP_API IntegerTypeId();
  ...\cryptopp562\algparam.h(313):              if (!(g_pAssignIntToInteger !=
NULL && typeid(T) == typeid(int) && g_pAssignIntToInteger(valueType,
pValue, &m_value)))
  ...\cryptopp562\algparam.h(315):
NameValuePairs::ThrowIfTypeMismatch(name, typeid(T), valueType);
  ...\cryptopp562\cryptlib.h(250):              return
GetValue((std::string("ThisObject:")+typeid(T).name()).c_str(),
object);
  ...\cryptopp562\cryptlib.h(257):              return
GetValue((std::string("ThisPointer:")+typeid(T).name()).c_str(), p);
  ...\cryptopp562\cryptlib.h(264):              return GetVoidValue(name,
typeid(T), &value);
  ...\cryptopp562\algparam.cpp(30):
NameValuePairs::ThrowIfTypeMismatch(name, typeid(std::string),
valueType);
  ...\cryptopp562\eccrypto.cpp(454):            this->ThrowIfTypeMismatch(name,
typeid(OID), valueType);
  ...\cryptopp562\integer.cpp(39):      if (valueType != typeid(Integer))
  Matching lines: 53    Matching files: 12    Total files searched:
482

-- 
-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to