On Sunday 01 March 2015 11:31:57 Sander van Grieken wrote: > On Monday 23 February 2015 22:00:09 Andrey Kozhevnikov wrote: > > Hello Sailors! > > > > I need help in debugging issue in my simple test project: > > https://github.com/CODeRUS/aes-test > > In any platform/device it gives at least one failure during iterations. > > I googled and tried everything and have no ideas anymore. > > Any help/ideas/suggestions are appreciated. > > > > Best regards, > > Andrey Kozhevnikov > > QByteArray out(ciphertext.size(), '\0'); > > This looks like a possible off-by-one bug, it might on occasion not have a > trailing \0, when the plaintext is exactly of length ciphertext > > grtz, > Sander
Hmm it's not that.. Strange how the failed index number is different when additional unrelated code is added. When I replace unsigned char ecount[AES_BLOCK_SIZE]; memset(ecount, 0, AES_BLOCK_SIZE); with QByteArray ecount(AES_BLOCK_SIZE, '\0'); and change the parameter in the openssl function to (unsigned char*)ecount.data() it works correctly though.. It looks like something goes wrong when passing the locally scoped char array ptr.. (?) grtz, Sander _______________________________________________ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org