On Monday, January 11, 2016 at 2:10:58 PM UTC-5, [email protected] wrote:
>
> I'm able to narrow down the failure to decoding base32. Encoding works
>> fine. Decoding fails with a stack overflow just like the report in 2010
>> here:
>>
>
> http://comments.gmane.org/gmane.comp.encryption.cryptopp/5355
>
> Here's a very simple test program that demonstrates the base32 decoding
> error:
>
> https://github.com/w8rbt/oathgen/blob/master/base32_test.cpp
>
> Here's how I compile the test program:
>
> g++ -g -g3 -std=c++11 -Wall -Wextra -Werror \
> -Weffc++ -pedantic-errors base32_test.cpp \
> -o b32_test \
> /usr/lib/libcryptopp.so
>
It looks like it has something to do with the Decoder's
DefaultDecodingLookupArray():
(lldb) n
Process 76482 stopped
* thread #1: tid = 0x5308bf, 0x00007fff8ece5297
libsystem_malloc.dylib`szone_malloc_should_clear + 20, queue =
'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2,
address=0x7fff5f3ffff4)
frame #0: 0x00007fff8ece5297
libsystem_malloc.dylib`szone_malloc_should_clear + 20
libsystem_malloc.dylib`szone_malloc_should_clear + 20:
-> 0x7fff8ece5297: movl %edx, -0xac(%rbp)
0x7fff8ece529d: movq %rsi, %r14
0x7fff8ece52a0: movq %rdi, %r12
0x7fff8ece52a3: movq %r12, -0x68(%rbp)
(lldb) p Base32Decoder::GetDefaultDecodingLookupArray()
error: Trying to put the stack in unreadable memory at: 0x7fff5f3fff50.
The lookup array actually a parallel data structure, and it needs to be 256
elements in size. It provides indexes into your 32-character alphabet or -1
for 'invalid'. Most entries are marked as invalid. But this looks like a
pointer problem....
I've got to finish up some work in the yard so I can let my dogs out. Give
me an hour or two.
Jeff
--
--
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/d/optout.