@_jdepaz
unread,Oct 18, 2011, 4:12:31 PM10/18/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Crypto++ Users
Saludos a todos,
Usando Crypto++ 5.5.2, cuando se utiliza StreamTransformationFilter:
try
{
StreamTransformationFilter filter(Encryptor, new StringSink
(l_strTextoCifrado));
filter.Put(reinterpret_cast<const unsigned char*>(p_bufferEntrada),
p_nLargoEntrada);
/*en la siguiente línea ocurre una excepción*/
filter.MessageEnd(); //In this case an exception Exception
0xE06D7363
catch (CryptoPP::Exception e)
{
throw CExceptionCifrado(e.what());
}
catch (...)
{
throw CExceptionCifrado("Error Desconocido");
}
Utilizando el depurador de Visual C++ 6, -Using the debugger- en la
llamada a la pila:
Call Stack:
KERNEL32! 7c812afb()
LIBCIFRADO! _CxxThrowException@8 + 57 bytes
std::_Xlen() line 8 + 77 bytes
std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::replace(unsigned int 456, unsigned int 0, unsigned int 4294967213,
char 0) line 270
std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::replace(char * 0x003f5d09, char * 0x003f5d09, const char *
0x003f4af8, const char * 0x003f4aa5) line 301
std::basic_string<char,std::char_traits<char>,std::allocator<char>
>::append(const char * 0x003f4af8, const char * 0x003f4aa5) line 109 +
63 bytes
CryptoPP::StringSinkTemplate<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::Put2(const unsigned char * 0x003f4af8, unsigned int 4294967213,
int 0, unsigned char 1) line 557
CryptoPP::StreamTransformationFilter::LastPut(CryptoPP::StreamTransformationFilter
* const 0x00000000, const unsigned char * 0x0056660e, unsigned int
4294967295) line 704
LIBCIFRADO! ReadFile@20 + 232440 bytes
CryptoPP::CipherModeBase::BlockSize() line 46 + 75 bytes
y viendo la llamada: (view the call)
CryptoPP::StringSinkTemplate<std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >::Put2(const unsigned char * 0x003f4af8, unsigned int 4294967213,
int 0, unsigned char 1) line 557
Code in: filters.h (filters.cpp)
template <class T>
class StringSinkTemplate : public Bufferless<Sink>
{
public:
// VC60 workaround: no T::char_type
typedef typename T::traits_type::char_type char_type;
StringSinkTemplate(T &output)
: m_output(&output) {assert(sizeof(output[0])==1);}
void IsolatedInitialize(const NameValuePairs ¶meters)
{if (!parameters.GetValue("OutputStringPointer", m_output)) throw
InvalidArgument("StringSink: OutputStringPointer not specified");}
size_t Put2(const byte *begin, size_t length, int messageEnd, bool
blocking)
{
if (length > 0)
{
typename T::size_type size = m_output->size();
if (length < size && size + length > m_output->capacity())
m_output->reserve(2*size);
m_output->append((const char_type *)begin, (const char_type *)begin
+length);
}
return 0;
}
Code in String.cpp (Visual C++ 6)
// string -- template string support functions
#include <locale>
#include <istream>
_STD_BEGIN
// report a length_error
_CRTIMP2 void __cdecl _Xlen()
{_THROW(length_error, "string too long"); } /*Exception Visual C++*/
// report an out_of_range error
_CRTIMP2 void __cdecl _Xran()
{_THROW(out_of_range, "invalid string position"); }
_STD_END
/*
* Copyright (c) 1995 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
*/
Estoy utilizando el cifrado/decifrado 3DES, y funciona bien, pero al
revisar la depuración me está
generando 4 excepciones tipo Exception 0xE06D7363, que al final me
provocan un bajo rendimiento en una aplicación que está como servicio
de Windows.
La aplicación atrapa las excepciones, pero quisiera verificar si está
excepción es correcta o hay que corregir
en el código de la aplicación que está utilizando Crypto++
Saludos y gracias